background preloader

Phpgroupware.org

Phpgroupware.org

Ten PHP Best Practices Tips that will get you a job | PHP vs .Net Posted by blake on Jun 4, 2008 in Code, Performance, PHP | 167 comments The last couple of weeks have been quite the experience for me. I was part of a big layoff at my former company, which was interesting. I've never been in that position before, and it's hard not to take it personally. Find the errors in the following code: So, give it a shot. If you got the missing comma in the parameter list, the "new Array()" error, the colon instead of a semi-colon, the '=' instead of '=>' in the foreach statement, and the erroneous use of '+' on the echo line, then congratulations, you found all the errors! That's not how I answered the question though. After pointing out the actual errors, I made a point of adding comments about those things I just mentioned. So, read on for my Ten PHP Best Practices Tips that will get you a job: 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. That being said, I hate all you space-indenters. … sorry, pet peeve. Anyway, I hope these tips are helpful.

CPS Last modified: 12/08/2010 08:31 AM CPS (for Collaborative Portal Server) is a complete Free / Libre / Open Source platform available for building Enterprise Content Management (ECM) applications. CPS comes also as a user-friendly accessible application ready to for entreprise-grade content management with many collaboration features. CPS at a glance: Free / Libre / Open source Software (GNU GPL v2)Very coherent, very stable (exists since 2001)Enterprise-ready, connects to any directory hierarchy (LDAP, ActiveDirectory, SSO, CAS, etc.)Easy and efficient theme styling for web designers (the new CPSDesignerThemes)Multilingual (Unicode UTF-8)Semantic HTML (XHTML 1.0 Strict)Web accessible compliant (WAI-A)Commercial support You will find here news about CPS and its components, documentation, links, users and developers mailing-lists and information about the future and roadmap of the platform. CPS development is open to every one. More about CPS

7 Secure, Lightweight, and Easy to Use PHP Frameworks Choosing a good PHP frameworks can help you develop complex Rich Internet Applications quickly, with a best practices oriented approach, and saving a lot of time reusing code snippets that are already available. There are a lot of interesting PHP frameworks you can choose for your next web project. Which framework you choose is really a personal decision. There is no one “best” framework on the market at the moment. Today we will focus on 7 secure, lightweight and easy to use PHP Frameworks. Why Use a PHP Framework? There are plenty of reasons to use a PHP Framework to build your websites. 1. Below we’ve covered some of the best frameworks available today. 1. CodeIgniter is a powerful, high-performance, open-source PHP framework that helps you author PHP applications rapidly. CodeIgniter has an exciting online manual, a couple of helpful video tutorials and an active user forum. Useful Resources for getting started with CodeIgniter 2. Useful Resources for getting started with Kohana 3. 4.

30 game scripts you can write in PHP, Part 1: Creating 10 fundamental scripts Getting started As both a game master/storyteller and a developer, I frequently find myself writing little utilities and scripts to help me when running, planning, and playing games. Sometimes I need a quick idea. Other times, I just need a whole pile of names for Non-Player Characters (NPCs). Occasionally, I need to geek out on numbers, work out some odds, or integrate some word puzzles into a game. Many of these tasks become more manageable with a little bit of script work ahead of time. This article will explore 10 fundamental scripts that can be used in various types of games. We will blaze through these scripts pretty quickly. Back to top A basic die roller Many games and game systems need dice. In many cases, that would be more or less fine. Listing 1. function roll () { return mt_rand(1,6); } echo roll(); Then we can pass the type of die we want to roll as a parameter to the function. Listing 2. Random name generator Listing 3. Listing 4. Listing 5. Scenario generator Listing 6. Summary

PHP include() and require() PHP encryption for the common man Consider how today's world differs from the world of just 20 years ago. Long ago, in the 1980s, encryption was spy stuff -- something you read about in a techno-thriller by Tom Clancy. If somebody wanted to keep a bit of information private, he encrypted the data with a password, a pass phrase, or another basic method. Fast-forward to today and encryption is everywhere. Passwords are stored encrypted in databases. Encrypted tunnels through cyberspace are possible via SSL, SSH, and other technologies -- not to mention virtual private networks. As a PHP developer, you should be aware that strong security practices aren't just for exotic applications -- they're for the project you're working on now. There's not enough time or room to discuss every aspect of encryption here, but you'll learn the essentials that will cover most situations you'll find yourself in. Cryptography primer Cryptography is the art of "secret writing," as the word's Greek roots attest. Listing 1. Listing 2. Summary

Practical PHP Programming Build seven good object-oriented habits in PHP Make your PHP applications better with object orientation Nathan GoodPublished on October 28, 2008 In the early days of PHP programming, PHP code was limited to being procedural in nature. Procedural code is characterized by the use of procedures for the building blocks of the application. Procedures offer a certain level of reuse by allowing procedures to be called by other procedures. However, without object-oriented language constructs, a programmer can still introduce OO characteristics into PHP code. While purely procedural designs without much modularity run just fine, the advantages of OO design show up in the maintenance. Modularity— one of the key characteristics of good OO design — helps with this maintenance. While there are more than seven habits to building OO software overall, the seven habits here are what you need to make your code fit basic OO design criteria. The seven good PHP OO habits are: Be modest Bad habit: Expose public fields Listing 1. Listing 2. Listing 3.

Related: