PHP

PHP Coding Guidelines

PHP coding guidelines

The guidelines that I follow when writing my PHP scripts; can be helpful to have something like this if you're working on a joint project.

These are only the guidelines that I personally chose to follow for the code I write. This is not an indication that any other coding styles, guidelines or standards are wrong. Feel free to use this document as a template to manage your own coding guideline and change whatever you wish as you see fit.

Why are guidelines important?

First of all, let's make one point crystal clear: it doesn't matter what your guidelines are, so long as everyone understands and sticks to them. I've worked on a team where the person in charge preferred to put braces following the expression, rather than on a line all by themselves. Whilst I didn't necessarily agree with this convention, I stuck to it because it made maintaining the whole project much easier.

It cannot be emphasised enough that guidelines are only useful if they are followed. It's no use having a definitive set of coding guidelines for a joint programming project if everyone continues to write in their own style regardless. It is arguable that you can get away with different coding styles if every team member works on a different section which is encapsulated and therefore their coding style doesn't affect the other developers. Unfortunately, this only holds true until a developer leaves and someone else has to take over their role.

If you are running a joint project, you might consider putting your foot down and basically refuse to accept any code that does not conform to your published guidelines, regardless of its technical merit (or lack thereof). This may sound somewhat draconian and off-putting to developers at first, but once everyone begins to code to the guidelines you'll find it a lot easier to manage the project and you'll get more work done in the same time. It will require a lot of effort from some of your developers who don't want to abandon their coding habits, but at the end of the day different coding styles will cause more problems than they're worth.

Oracle lauches their new PHP Developer site on OTN

John Coggeshall talks about Oracles new addition to their OTN site for php developers.

While I was attending the International PHP Conference in Amsterdam, I had an opportunity to stop by the Oracle exhibit and get introduced to a brand-new PHP Developer Center on Oracle's Developer Network! This is the second such announcement from a major database company (SAP recently launched a new PHP Development Forum which I am moderating as part of a SAP/Zend joint effort). Between Oracle, SAP and of course IBM it is becoming increasingly clear that PHP has moved from a thriving open source project to an enterprise solution powerhouse for web applications!

Oracle lauches their new PHP Developer site on OTN

John Coggeshall talks about Oracles new addition to their OTN site for php developers.

While I was attending the International PHP Conference in Amsterdam, I had an opportunity to stop by the Oracle exhibit and get introduced to a brand-new PHP Developer Center on Oracle's Developer Network! This is the second such announcement from a major database company (SAP recently launched a new PHP Development Forum
which I am moderating as part of a SAP/Zend joint effort). Between
Oracle, SAP and of course IBM it is becoming increasingly clear that
PHP has moved from a thriving open source project to an enterprise
solution powerhouse for web applications!

Downloading a file via HTTPS using PHP

Here is some information on how to download a file over an HTTPS connection from PHP. This normally is not a big issue in both IE and Mozilla for HTTP but changing to a HTTPS connection breaks using IE for downloading.

For anyone looking at this issue of http vs https downloads I found that the only change I had to make to my working script was to add the header line:

header("Pragma: cache");


So my script ended up with the following:

Yahoo! Search Web Services Are Alive!

Yahoo has one-upped Google with the announcement of their API. Google has been doing this for a while now (3 years), but you never hear anything new about it like you do with Amazon's API where new applications seems to appear on a daily basis.

The SDK includes BSD-licensed examples in Perl, Python, PHP, Java and JavaScript (Google's SDK includes Java and .NET examples), and accesses Image, Web, Video, Local, and News searches (last time I looked, Google did Web, Cache, and Spelling)! Yahoo's API uses REST rather than SOAP, which I personally find much easier to work with.

The big deal about IBM and Zend's partnership

IBM is putting its corporate heft behind your favorite web development technology.

IBM announced a partnership with Zend to create a bundle called Zend Core, which includes IBM's Cloudscape-embedded database and Zend's PHP development tools. Zend sells tools built on the open-source edition of PHP and offers related services.

Syndicate content