News Feed
Jobs Feed
Sections

Recent Jobs

News Archive
feed this:

devReview.com:
The Big List of PHP Frameworks
January 07, 2009 @ 14:12:10

The devReview.com website has put together The Big List of as many of the PHP frameworks out there they could find:

For the start of a new year, it was time to clean out the list of PHP frameworks. A few have fallen by the wayside, but many new ones have been added. It seems that patterns and MVC is still all the rage, but less are professing to being Rails clones, though the inspiration of convention is still strong. There are a wide variety of framework types. From full stack (cakePHP, Symfony) to components (eZ), a bit of both (Zend) and minimalist (LightVC, TinyMVC, Pluf).

Requirements to be on the list include that the framework must be PHP-based, have a recent code release in the last 12 months, needs to be available in English and not including frameworks that can be considered content systems themselves.

As of the time of this post, there are around 50 active frameworks listed - everything from CakePHP and the Zend Framework out to eZ Components and Prado. Links for each include their project homepage and some reviews the site has done.

0 comments voice your opinion now!
list framework active project php4 php5 release english



Johannes Schluter's Blog:
Goto your Christmas presents with PHP 5.3
January 06, 2009 @ 10:20:56

Johannes Schluter recently looked at one of the new features coming with PHP 5.3 - the goto functionality:

Over the last few days I already mentioned a few hidden gems from PHP 5.3. Now at Christmas I wanted to take a look at some new language feature of the upcoming PHP version: Added "jump label" operator (limited "goto"). (Dmitry, Sara)

No, its not the sort of "goto" you're thinking of - its a bit more limited than that. Johannes mentions that it only allows you to jump within the same execution unit and you can't jump into loops. Used incorrectly, it can be bad but he points out two useful instances - one being a code generator and the other an instance where you might need to drop out of code but not kill off the script in the process (sample code is included for this second one).

1 comment voice your opinion now!
php5 goto new feature generate code error handle


Jordi Boggiano's Blog:
Multiton base class
December 30, 2008 @ 11:17:49

In this recent post Jordi Boggiano looks at a different sort of design pattern - a sort of extension of the Singleton pattern: Multition.

While I like the Singleton pattern every now and then, I prefer the flexibility that the Multiton potentially offers, and well it's just an extended version of the Singleton, so it's "compatible" with the Singleton model. Anyway, to the point, PHP5.3 is coming, and with Late Static Binding you can do a base Multiton (or Singleton if you insist), which wasn't possible before. Now I like this very much because you can simply extend it rather than rewriting those (few, I know, but still) lines each time.

Included in the post is an example of the design pattern showing how to create its structure in the class and use it to grab the same or unique instances (defined with an ID).

0 comments voice your opinion now!
multiton base class singleton php5 latestaticbinding lsb


Johannes Schluter's Blog:
Data structures in PHP 5.3
December 29, 2008 @ 11:19:28

Continuing on his his series looking at improvements in the upcoming PHP 5.3 release, Johannes Schluter uses this new post to look at some of the new data structures their update will have to offers in the Standard PHP Library.

In the programming world there are quite a few well understood and explored data structures. Which are commonly used in tons of applications, still the only things PHP offered till 5.3 in regards to structuring data were arrays (more precise: hash tables) and objects. So people had to either abuse them for other structures or implement the structures themselves on top of these. Thanks to Etienne things now are changing and PHP's Standard PHP Library (SPL) extension will offer quite a few standard implementations of data structures.

These new data structures are SplDoublyLinkedList, SplStack, SplQueue/SplPirorityQueue, SplHeap/SplMinHeap/SplMaxHeap and SplFixedArray. He explains a bit of what they are and more detail on one specifically - SplFixedArray.

0 comments voice your opinion now!
data structure php5 spl standard library doublylinked stack queue heap fixedarray


Johannes Schluter's Blog:
Improved getopt() in PHP 5.3
December 23, 2008 @ 15:02:14

Johannes Schluter has posted about another update to be included in PHP 5.3 - an improved getopt function:

So PHP 5.3 has lots of new stuff offer, so let's take a look at one change: Added long-option feature to getopt() and made getopt() available also on win32 systems by adding a common getopt implementation into core. (David Soria Parra, Jani)

This gives Windows users a function they haven't had before in both web-based applications and on the command line. You can get more information about the use of the function from its page in the manual.

0 comments voice your opinion now!
php5 improvement getopt function windows userland


Arpad Ray's Blog:
The adventure of PHP and the magic quotes
December 17, 2008 @ 12:03:07

One of the things that's been hanging around PHP's neck since its early days is the magic_quotes setting that was introduces to try to make things easier. In this interesting post Arpad Ray takes a look at this setting and why its a bad thing for PHP to have around.

Like register_globals, it helped lower the barrier of entry to building a dynamic website by removing some of the complexity. However it certainly wasn't without sacrifice, problems with the implementation quickly appeared and continued to abound for the next ten years. Finally in PHP 5.2.2 we got an implementation which (as far as its intentions went) seemed to be bug free, but of course by then it was turned off by default and was already slated to be dropped in PHP 6.

He looks at a few reasons they're bad (not good enough for escaping, inconsistent, performance issues) and some methods - code snippets - on how to deal with it being turned on on your server.

2 comments voice your opinion now!
adventure magic quotes bad php5 php6 code fix


Johannes Schluter's Blog:
A hidden gem in PHP 5.3 fileinfo
December 17, 2008 @ 09:35:59

Johannes Schluter has pointed out a "hidden gem" for PHP 5.3 in his latest blog post - the fileinfo extension.

This series is not meant to be complete but some personal choice, these blog postings are also no replacement for documentation, but just pointers. My goal is that you try out 5.3 right now so we can fix bugs as soon as possible before releasing it The NEWS file has a quite short entry for my first subject: Added fileinfo extension as replacement for mime_magic extension. (Derick)

He looks at one situation where the extension could come in very handy - getting the content type of the file for a download push - as well as why its better than the older mime_content_type function.

0 comments voice your opinion now!
php5 gem fileinfo mimecontenttype function extension hidden


Gopal Vijayaraghavan's Blog:
APC 3.1.2 Released!
December 17, 2008 @ 08:47:35

On his blog today Gopal Vijayaraghavan has posted about the release of the latest version of the APC sofware (Alternative PHP Cache) - version 3.1.2.

Finally, after nearly a year of work, it's into a release. Some new stuff has sneaked into it undocumented, that people might find interesting - apc.preload_path would be one of them. The backend memory allocation has been re-done - the api part by me and the internals by shire. There's a hell of a lot of new code in there, both rewritten and added. Tons of php4 cruft removed, php5 stuff optimized, made more stable, then less stable, made faster, then applied brakes. Made leak-proof, quake-proof and in general, idiot-proof. So, on & so forth.

To show the difference, he includes a diff of the current version against the previous - 68 files changed, 3255 insertions and 5545 deletions.

0 comments voice your opinion now!
apc cache release version memory allocation api internals php4 php5


Robert Basic's Blog:
Data filtering with PHP's Filter extension
December 16, 2008 @ 11:17:44

Robert Basic has a new blog post looking at the filtering extension included with most PHP5 distributions.

Filter extension? Maybe it's nothing new for some of you, but it is for me. I've never heard of it before. So I quickly hopped over to PHP.net and the Filter chapter of the manual.

The filter extension (included as of PHP 5.2) helps clean up and validate user input - really any input - like number matching, regular expressions and email addresses. He includes some examples of filtering strings, email and integers as well as ways to sanitize the same strings, ensuring they are valid and clean values.

1 comment voice your opinion now!
filter extension tutorial php5 validate sanitize


Scott MacVicar's Blog:
Accessing pseudo random data with PHP
December 15, 2008 @ 10:24:17

To help alleviate some recent complaints about the pseudo-random nature of the random functions in PHP, Scott MacVicar has proposed an alternate solution:

With all these potential different ways to get some pseudo random data it would be hard to do this in native PHP. Now we could do this in C and implement all the code ourselves but why risk implementing our own random functions and potentially making a mistake? The answer is OpenSSL, we already have an OpenSSL module and obviously they have some random functionality built in for when you go to generate SSL certificates.

You can make a call to the openssl_random_pseudo_bytes (in PHP 5.3) to grab the number of bytes you need and pass in a "strong" value to get a more cryptographically secure value.

0 comments voice your opinion now!
random string data openssl pseudo bytes php5


Vidyut Luther's Blog:
Adding Subscribers to Campaign Monitor Lists using PHP5 and SOAP
December 15, 2008 @ 09:33:07

If you're a Campaign Monitor user (an email marketing tool targeted at designers) and have wanted to dynamically add people to your lists, Vidyut Luther has a solution for you:

This is a quick how to, for people interested in adding subscribers to their Campaign Monitor lists. What you'll need: PHP 5 with SOAP built in, a Valid Campaign Monitor Account, a Campaign Monitor list.

His simple script (about 10 lines with comments removed) makes a call to the service's API and passes in your key, a list and client ID and a call to the AddSubscriber method to push the new contact into the list.

0 comments voice your opinion now!
campaignmonitor mailing list add subscriber tutorial php5 soap


Tiffany Brown's Blog:
Simple pagination for arrays with PHP 5
December 15, 2008 @ 08:48:20

Tiffany Brown has a quick tutorial on a pagination method she's come up with for splitting out array contents over multiple pages.

While working on a recent project, I had to build a feature that displayed a list of files available in a directory. A simple way is just to use scandir() and a foreach loop to spit out a pretty list. There's a small problem though: long lists aren't all that user friendly. I decided instead to paginate the results. Here's one way to do it using PHP 5.

Her method reads in all of the (valid) files from the directory, assigns them to an array and uses the array_chunk function to split them up into groups on five. These groups can be easily looped through and displayed out as links easily.

0 comments voice your opinion now!
pagination php5 arraychunk directory files


Adam Hosker's Blog:
Differences Between PHP 4 and 5
December 12, 2008 @ 13:42:49

Adam Hosker has posted some of the differences between PHP4 and PHP5 to help you make the transition.

He's broken it up into a few different sections:

  • Language Features
  • Objects
  • Magic Methods
  • Selected New Extensions
  • Error Management

Each of the sections has several subpoints detailing changes, updates and tips. The post is a part of his studies working up to talking the Zend Certified Engineer test.

0 comments voice your opinion now!
php4 php5 difference version list object magic extension error


Brian Snugg's Blog:
Reverse Proxy in PHP5
December 11, 2008 @ 11:14:03

Brian Snugg has two new posts relating to his script for a reverse proxy in PHP5. The first lays the foundation, the second makes some updates to make it a bit more efficient.

So I have been working on a little class to run a reverse proxy from PHP using cURL. I have extended this class for my own purposes (single-sign-on) to handle some special request parameters, but here it is. It has some warts, but it's a good starting point.

He creates the ProxyHandler class in the first post and in the second updates the script to pass a more correct version of the headers to the proxy server to get a better response back.

0 comments voice your opinion now!
reverse proxy php5 tutorial curl header


IBM developerWorks:
What's new in PHP V5.3, Part 2 Closures and lambda functions
December 11, 2008 @ 08:49:51

IBM developerWorks has posted part two of their look at new features included in the upcoming PHP 5.3 release. This part looks specifically at closures and lambda functions.

Follow along in this "What's new in PHP V5.3" series of articles that covers the new and exciting features found in PHP V5.3, which will be released by the end of 2008. Part 1 looks at the changes made to the object-oriented programming and object handling in PHP V5.3. Here in Part 2, we look at closures and lambda functions. They are designed to make programming much easier by allowing you to easily define throwaway functions that can be used in many contexts.

Lambda functions (or as they describe them "throwaway functions") are ones created dynamically as the script runs, possibly as a callback to one of the many PHP functions that allow for one. It removes the need for a call to create_function. Closures let you assign a function to a variable/return value, including variables to use, and call it later.

They also look at closures and objects, using reflection on them and some reasoning on why you should use closures in your future applications.

0 comments voice your opinion now!
php5 new closure lambda function series


Community News:
PHP 5.2.8 Released
December 09, 2008 @ 06:39:35

The PHP Group has officially released the next version in the PHP 5.2.x series (as an update to the flaw in PHP 5.2.7) - version 5.2.8:

The PHP development team would like to announce the immediate availability of PHP 5.2.8. This release addresses a regression introduced by 5.2.7 in regard to the magic_quotes functionality, that was broken by an incorrect fix to the filter extension. All users who have upgraded to 5.2.7 are encouraged to upgrade to this release, alternatively you can apply a work-around for the bug by changing "filter.default_flags=0" in php.ini.

You can download this latest release from the downloads page on the main php.net website or from your favorite local mirror.

0 comments voice your opinion now!
php5 release security flaw update phpini


Lukas Smith's Blog:
PHP 5.3.0alpha3 is finally out
December 05, 2008 @ 09:31:26

As Lukas Smith mentions, the latest alpha release for the PHP 5.3 series has been released - PHP 5.3alpha2.

Wow, after what feels like ages PHP 5.3.0alpha3 was just released. Originally we hoped to be able to release now intermediate releases every 2-3 weeks, this one took a good 2 months. Somehow this releases did its very best to stall itself. People that needed to work on things together by chance ended up being busy with other things and vacations in just the right order to make things impossible. Most of this was to be attributed to the namespace discussions, which climaxed in the backslash FUD campaign.

He notes that a stable release is probably looking good in Q1 of 2009 (with namespaces being the delaying factor). He also suggests something that could help make things a bit simpler in the future - making the internals@ mailing list read-only for anyone outside of core developers. A good bit of the confusion and bickering came from those outside the dev team and it didn't help the group come to a decision any earlier.

You can find the official release information for the alpha2 on the main PHP.net website.

0 comments voice your opinion now!
php5 alpha2 release namespace internals mailing list readonly


Community News:
PHP 5.2.7 Released
December 05, 2008 @ 08:43:37

NOTE: This release has been recalled due to a security bug found involving magic_quotes_gpc.

The latest version in the PHP 5.2.x series has been released today - PHP 5.2.7:

The PHP development team would like to announce the immediate availability of PHP 5.2.7. This release focuses on improving the stability ofthe PHP 5.2.x branch with over 120 bug fixes, several of which are security related. All users of PHP are encouraged to upgrade to this release.

These security updates include an update of the PCRE version, fixing an incorrect order with php_value, correcting a possible overflow in memnstr and more. Check out the full Changelog for more information on these updates and improvements. You can download this latest update from the PHP.net website (or your favorite mirror).

1 comment voice your opinion now!
php5 release security update patch fix stability


Chris Jones' Blog:
Which OCI8 DLL to use in PHP 5.3
December 05, 2008 @ 07:58:54

With the release of another DLL driver for PHP on Windows to access Oracle databases, Chris Jones wanted to alleviate any confusion there might be between the two in a new blog post.

As I foreshadowed in a now distant post, Pierre has installed Oracle 11g Instant Client on the PHP Windows build box and updated the OCI8 build scripts for PHP 5.3 (and PHP 6). PHP 5.3 now has two mutually exclusive versions of the OCI8 extension DLL [...] The two DLLs have the same user script API that do the same thing. You only need to (and only can) enable one at any one time. Choose the one that matches your Oracle client libraries.

The two DLLs - php_oci8.dll and php_oci8_11h.dll - have pretty self-explanitory names, but it could be confusing as to whether you need both or not if you go the 11g route.

0 comments voice your opinion now!
oracle dll driver windows 11g oci8 extension php5 php6


Hiveminds.com:
PHP 5.3 and PHP 6 risk becoming vaporware
December 04, 2008 @ 07:51:57

Content no longer valid

1 comment voice your opinion now!
php5 php6 vaporware alpha1 alpha2 release wiki roadmap perl6


Martynas Jusevicius' Blog:
Method overloading in PHP 5
December 02, 2008 @ 10:28:50

Martynas Jusevicius has a new post looking at method overloading in PHP5 - a workaround to make it possible at least.

Method overloading (a feature of object-oriented programing which allows having several class methods with the same name but different signatures) is not implemented in PHP, which is a drawback compared to Java. However, PHP 5 provides a way to imitate overloading by catching calls to "inaccessible methods" with magic method __call.

In his example he uses __call to route the request to the correct version of the constructor (__construct0 or __construct1) based on the number of arguments passed in

0 comments voice your opinion now!
method overload php5 construct call magic function route


Sebastian Bergmann's Blog:
Freezing and Thawing PHP Objects
December 01, 2008 @ 11:12:18

Sebastian Bergmann has posted details (and a patch) for freezing and unfreezing objects via the new setAccessible method included in the SPL in PHP 5.3.

One of the many new features that have been added for PHP 5.3 is the setAccessible() method of the ReflectionProperty class that is part of PHP's Reflection API. This method makes protected and private attributes (unfortunately, the class is called ReflectionProperty instead of ReflectionAttribute) of a class or object accessible for the ReflectionProperty::getValue() and ReflectionProperty::setValue() methods, thus making protected and private attributes "open" for full read and write access from the outside.

A bit of code shows how to "freeze" and "thaw" the objects out - creating an object, calling the freeze() method on it to protect it from use, then the thaw() method to bring it back out where it can be accessed. Stefan Priebsch helped to create this class and the patch.

0 comments voice your opinion now!
freeze thaw object php5 patch spl setaccessible


PHPro.org:
Calculate Friday The 13th With Datetime Class
December 01, 2008 @ 08:46:51

As an introduction to the Datetime class functionality PHP 5 has, Kevin Waterson shows how to use it to calculate the "Friday the 13th" for any year.

This class is a request from a PHPRO.ORG regular who asked for a method to calculate Friday the 13th for the next n years. The calculation itself is easy, however, it presents a good opportunity to introduce the PHP datetime class.

He points out that timestamps, because of they way integers are handled, have a somewhat limited lifespan (2038) and dates beyond that cannot be determined by the usual date functions. Instead, he shows how to set up a DateTime object, set a timezone and loop through the days to find the Fridays that land on the 13th.

0 comments voice your opinion now!
tutorial datetime class php5 friday thirteenth


Marco Tabini's Blog:
It turns out, I was wrong
December 01, 2008 @ 07:54:29

Correcting himself from some previous comments concerning PHP 5 versus PHP 4 usage among developers, Marco Tabini has posted something new to his blog with some updated stats.

In the past, I have not been shy about sharing my opinion that the impending death of PHP 4 would have wreaked all sorts of havoc over the PHP world. I am glad to say that I've been wrong - dead wrong, in fact - and that I have never been as happy to be so far off the mark before.

According to a readers survey that the php|architect magazine ran (about a year ago even) PHP 5 is stronger than ever, taking up well over sixty percent of the usage with only a small part still hanging with PHP 4. Check out his graph for the full rankings.

0 comments voice your opinion now!
statistics php4 php5 usage correction phparchitect survey reader


DevShed:
Building a User Management Application
November 25, 2008 @ 10:24:33

On DevShed.com today they're continuing a series with part two of their look at user management - more specifically at the creation of a user management application for access control.

Any application that is security critical will have some kind of method to track and maintain user activity. In this article we will begin to build a user management system that will give us control over who has access to which part of our application.

The system's functionality will also provide authentication support (not just role management) and allows for user registration, "forgot my password" and password management. Code and database information for the ten files needed to make the system are included.

0 comments voice your opinion now!
user management application php5 tutorial password authentication


NETTUTS.com:
Create a PHP5 Framework - Part 3
November 25, 2008 @ 08:47:01

NETTUTS.com has posted the third part of their series on creating a simple PHP5 framework today:

Now that we've got a basic framework (see part 1 and part 2 of this series), we can start thinking about integrating designs with our PHP framework. For now, we'll concentrate on the front-end design, including how we can make it easy to 'skin' our new framework.

This part looks mostly at the HTML and CSS for the presentation layer (the views) to make a simple two-column layout with some basic image and text content.

0 comments voice your opinion now!
tutorial series php5 framework view layer html css output


Builder.com.au:
Quickly Install a LAMP server on Ubuntu
November 24, 2008 @ 11:14:17

This recent article from the Builder.com.au website shows exactly how simple it is to get a LAMP server up and running on your Ubuntu installation.

I can't tell you how many times I have been asked what is the fastest, easiest way to install a LAMP (Linux Apache, MySQL, PHP) server on Ubuntu. Well, I guess it's time I just post it here for everyone to enjoy.

You're just two apt-get calls and a few various commands away from pulling in an Apache 2 web server and a PHP5 module that has MySQL support already built in. Set the password for the MySQL installation and you're all set to go.

0 comments voice your opinion now!
lamp server ubuntu linux apache php5 mysql tutorial


WebReference.com:
Administering RBAC in PHP 5 CMS Framework
November 20, 2008 @ 10:28:15

WebReference.com continues their series looking at user administration in content management systems. This time they look at the importance of user roles and some code to add to help manage them.

Although the operations are simple, it is vital that they be handled correctly. It is generally a poor principle to allow access to the mechanisms of a system rather than providing an interface through class methods. The latter approach ideally allows the creation of a robust interface that changes relatively infrequently, while details of implementation can be modified without affecting the rest of the system.

Their code includes methods to get all roles for a user, check to see which they are permitted to use, add a "permit" role and remove it back out. The tutorial is an excerpt from the Packt book PHP5 CMS Framework Development (Martin Brampton).

0 comments voice your opinion now!
rbac php5 framework tutorial excerpt packt role


Sameer's Blog:
Easy way to build GET query strings in php
November 13, 2008 @ 12:47:01

Sameer has come up with an easy way to build out query strings to use in your GET requests:

Passing variables with a url is such a frequent thing programmers do that most of you may think this post is unwarranted. We call this method of passing variables as GET, the other being POST. It is one of those things which can be easily done in php. [...] The best way to pass GET variables is to use the http_build_query() function available from php version 5; which takes an array of variables and builds a nice URL encoded string which you can append to a url. And example is shown below.

He includes two code examples - one showing "the old way" of building it out by hand and the other using the http_build_query function. You pass in an array and what to connect them with and it builds out the string, no matter how many arguments there are.

0 comments voice your opinion now!
php5 httpbuildquery query string build tutorial


IBM developerWorks:
What's new in PHP V5.3, Part 1 Changes to the object interface
November 12, 2008 @ 11:13:30

John Mertic has put together a what's new list in the upcoming PHP 5.3 release:

PHP V5.3 is set to be released by the end of 2008, and many of the new features in this release have been in the planning stages for a few years. Originally touted as "PHP V6 without native Unicode support," PHP V5.3 has been developed into a feature-rich upgrade to the PHP V5 line. [...] In this "What's new in PHP V5.3" series, we'll look at these new V5.3 features, and see how they are used and how they can be used in your Web application.

In this first part of the series he talks about:

  • Improved static method and member handling
  • The _callStatic() magic method
  • Dynamic static calls
  • Late static binding
  • Standard PHP Library
  • Circular garbage collection
0 comments voice your opinion now!
object interface php5 whatsnew static lsb spl garbage collection


Pierre-Alain Joye's Blog:
PHP 5.2.7RC3 Released (Go test!)
November 10, 2008 @ 11:13:18

Pierre-Alain Joye has pointed out that the latest release candidate of the PHP 5.2.x series (5.2.7RC3) has been posted for download.

PHP 5.2.7RC3 has been released. It is likely to be the last RC and the final release is planed for Thursday next week. Please test it and report any issue you may found. The sources can be fetched here and the binaries in the windows site.

He also mentions a milestone for the PHP project - releasing the Windows builds at the same time as the normal source builds. Check out on the php.internals list for more information.

0 comments voice your opinion now!
php5 release candidate test windows build binary


Nexen.net:
PHP Statistics for October 2008
November 07, 2008 @ 14:39:54

Damien Seguy has passed on the latest PHP statistics for October 2008 on the nexen.net site. Here's a few highlights:

  • This was the last month of PHP 4 dominance
  • PHP 5 tops PHP market share with 47.50% usage
  • PHP 4.4.9's usage is moving even lower

The full stats (including graphs) can be found here and the evolution stats are here.

0 comments voice your opinion now!
statistic usage domain ip php4 php5 october08


DevShed:
Building a Modular Exception Class in PHP 5
November 05, 2008 @ 14:03:49

DevShed has posted the final part of their series on handling exceptions in PHP5 applications. In this part they wrap up the creation of their modular exceptions class.

By means of a hands-on approach, this series walks you through using inheritance to build finely-tuned exception subclasses. These subclasses can be used to handle, via multiple "try-catch" blocks, several failures that might occur during the execution of a given web application.

They show how to handle MySQL exceptions with two different subclasses - one for the MySQL connection itself and another for problems with the results. They then merge these two classes into one and show how to use the new hybrid creation in a sample SQL connection and query.

0 comments voice your opinion now!
modular exception class php5 tutorial


Danne Lundqvist's Blog:
SOAP structures in PHP
November 04, 2008 @ 09:33:14

Danne Lundqvist is frustrated with the SOAP functionality that comes native with PHP on one very specific subject - its handling of SOAP structures.

Handling SOAP structures in PHP can sometimes be really annoying. If an interface is defined in the WSDL as returning an array I can't be sure that I will get an array. If there is only one element in the array PHP tries to be clever and turn the wanted array into an object which, too me, isn't really smart. I don't know if this is a problem/limitation on the client side, server side or if it is just me doing something stupid in the wsdl.

He gives an example of the WSDL that was requested and the differing results from a call that returned one Map item verses several (how the objects were returned). In asking for help, it looks like he got some in the comments - an attribute called SOAP_SINGLE_ELEMENT_ARRAYS that can be added to the configuration array when creating the SoapClient object.

0 comments voice your opinion now!
soap structure wsdl inconsistent soapsingleelementarrays soapclient php5


WebReference.com:
Access Control (in a PHP5 CMS)
November 03, 2008 @ 09:36:22

In an excerpt from this book from Packt Publishing, Martin Brampton look sat access control for content management systems and considerations that need to be made to make it effective.

Now we have some ideas about database, we quickly run into another requirement. Many websites will want to control who has access to what. Once embarked on this route, it turns out there are many situations where access control is appropriate, and they can easily become very complex. In this chapter we look at the most highly regarded model'"role-based access control'"and find ways to implement it. The aim is to achieve a flexible and efficient implementation that can be exploited by increasingly sophisticated software.

He looks a the different kinds of access control (discretionary access control, mandatory access control) and topics surrounding them like:

  • Adding Hierarchy
  • Avoiding Unnecessary Restrictions
  • Special Roles
  • Implementation Efficiency
  • Real Difficulties

The tutorial finishes up with the start of a hierarchical access control system (including a few screenshots showing the tables and their relationships).

0 comments voice your opinion now!
access control cms php5 tutorial packt excerpt martinbrampton


Ibuildings Blog:
Review PHP5 CMS Framework Development
October 31, 2008 @ 09:33:29

On the Ibuildings blog today Marcello Duarte has a new review of the Packt Publishing book "PHP5 CMS Framework Development" (by Martin Brampton).

Martin left Mambo (before they announced to drop support for PHP4 last September) to write his own CMS and "evolve out of the Mambo history", by taking advantage of PHP5 OO enhancements. The result is Aliro: a CMS, a framework and an extension project with traits and genes of the Mambo family. Aliro code is used throughout the book to support and illustrate his presentation.

Topics of the different chapters include basic CMS system needs, organizing code, extensions and editing and presenting content.

0 comments voice your opinion now!
book review packt publishing php5 cms framework martinbrampton


DevShed:
Handling MySQL Data Set Failures in PHP 5
October 29, 2008 @ 13:35:39

DevShed continues their look at custom exception handling in PHP5 application with this third part of their series, a look at handling exceptions from MySQL calls.

Having already introduced you to the main subject of this article series, it's time to summarize the topics that were discussed in the last article, in case you haven't read it yet. In that particular tutorial I explained how to implement a fully-functional customized exception system with PHP 5, which came in handy for handling a number of specific exceptions thrown by a basic MySQL abstraction class.

They create a custom MySQL exception class that sits on top of their MySQL abstraction layer (and Result handling class) and catches exceptions thrown from sample queries.

0 comments voice your opinion now!
php5 data failure set query mysql database abstraction exception


DevShed:
Intercepting Customized Exceptions in PHP 5
October 22, 2008 @ 10:24:41

DevShed continues their series looking at exceptions in PHP with this second part focusing on throwing and handling customized exceptions in your PHP5 application.

While the built-in exception system that comes bundled natively with PHP 5 is usually good enough to handle errors and other critical conditions during the execution of a given web application, it's worthwhile to mention that there are a number of additional cases where it is necessary to implement an exceptions system that can handle different failures in a more specific way.

They show how to trigger some basic custom exceptions and detail the creation of a class to handle catching these exceptions in a bit more OOP kind of way.

0 comments voice your opinion now!
php5 exception custom class tutorial throw handle


Stefan Mischook's Blog:
Free PDF Chapter PHP5 CMS Framework Development
October 17, 2008 @ 08:44:04

On the KillerPHP blog Stefan Mischook shares a sample chapter from a recent PHP-related book published by Packt, "PHP 5 CMS Framework Development":

The people at Packt Publishing just sent me a free sample chapter (in PDF format) of their latest PHP book (PHP5 CMS Framework Development) for me to pass on to you guys.

The sample chapter looks at access control in a CMS application. Stefan also includes a brief outline of the contents of the remainder of the book. Other chapters cover topics like decreasing code bloat, security, specialized handlers and localization.

0 comments voice your opinion now!
free chapter php5 packt cms development outline


DevShed:
Sub Classing Exceptions in PHP 5
October 15, 2008 @ 12:06:24

DevShed has start up a new series today with the first part in a four-part series looking at exception handling in PHP5.

If you do any serious programming, whether it's in PHP 5 or some other language, you've needed to know how to handle run time errors and other "exceptional" conditions. You can do this by making your program throw generic exceptions. Or you can unlock the potential of PHP 5 and learn how to create custom exceptions, which is the subject of this four-part series.

In this first part they get you started with exceptions, showing how to throw them and catch them correctly (try/catch). They put it to good use in an example catching exceptions thrown from a MySQL connection and select.

0 comments voice your opinion now!
php5 exception tutorial subclass try catch


Yannick's Blog:
mbstring vs iconv benchmarking
October 06, 2008 @ 12:50:20

Recently on his blog Yannick has done some benchmarking comparing mbstring and iconv in PHP 5.2.4 release.

Following up on my previous post about the differences between the mbstring and iconv international characters libraries (which resulted in a tentative conclusion that nobody knew anything about those differences), and particularly the comments by Nicola, we have combined forces (mostly efforts from Nicola, actually) to provide you with a little benchmarking, if that can help you decide.

His code for the test script is included (for you to gather your own results) and a full listing of his results comparing the effects of possible caching, running up to ten executions. You can download the text file that he ran the script on here.

0 comments voice your opinion now!
mbstring iconv benchmark php5 text file statistic


TotalPHP:
Using an autoload function to make your life easier
October 02, 2008 @ 08:46:59

On the TotalPHP blog there's a recent post introducing you to a feature in PHP5 that can make life much easier - autoload.

In PHP 5 you can make your life a lot easier by writing an autoload function. This function will automatically load your classes, so you do not need to repeatedly include classes on every page.

Included are examples of it in action - both a simple definition and as it might be used in an application to conditionally load a class from multiple locations.

0 comments voice your opinion now!
autoload function php5 load class


Mark Brady's Blog:
Closures in PHP 5.3
October 01, 2008 @ 08:47:50

Mark Brady has a recent post he's worked up that looks at a feature in the upcoming PHP 5.3 version - closures.

According to object-oriented programming expert Martin Fowler, closures are defined as a block of code that can be passed to a function. [...] PHP's upcoming syntax for closures is shaping up to be comparable to the C# 2.0 implementation.

He includes two code examples to compare the two language's methods - one for C# and the other for PHP - that divides the input by a denominator and returns a true or false depending on the result. For more information on closures, see this proposal on the PHP.net wiki.

0 comments voice your opinion now!
closures php5 example c# compare code


Stefan Esser's Blog:
PHP 5.3 and Delayed Cross Site Request Forgeries/Hijacking
October 01, 2008 @ 07:53:22

In this new post to his blog Stefan Esser looks at cross-site request forgeries and how they can be prevented in PHP 5.3 by two things - the request_order directive in your php.ini and by not using $_REQUEST anymore.

Although PHP 5.3 is still in alpha stage and certain features like the PHAR extension or the whole namespace support are still topics of endless discussions it already contains smaller changes that could improve the security of PHP applications a lot. [...] With request_order it is now possible to control in what order $_REQUEST is created and what variable sources are taken into account. This finally allows removing cookie data from $_REQUEST without removing them from $_COOKIE also.

He explains why the use of $_REQUEST can lead to such problems (and security holes) and notes that its use makes overriding an application's GET or POST values as simple as adding a cookie. There's even a method for creating a Denial of Service attack against a site using $_REQUEST like this. He points to an example similar to this that happened with phpMyAdmin a while back.

His recommendation?

Once PHP 5.3 is out it is recommended for hosters to set request_order to "GP" on all the servers running arbitrary PHP applications to protect applications [and] application developers on the other hand should finally move away from using $_REQUEST for user input.
0 comments voice your opinion now!
php5 crosssiterequest forgery hijack request get requestorder


Mutant PHP Blog:
Specifications for PHP5
September 30, 2008 @ 11:17:47

In a recent entry to his blog Sean shows off a new specifications library he's created to replace common comparison functionality with a series of specs.

I thought I'd share a PHP library implementing this idea by Evans and Fowler. Written for PHP5, it's a library for defining custom specifications using composition and inheritance.

He gives the example of "Person" objects with name and age properties. A search might involve looking directly at the properties to location one that's, say, younger than 35 and has a last name of Johnson. His specification class replaces this and makes it more reusable by applying things like GreaterOrEqualSpecifications and EqualSpecifications to standardize the evaluation. Then its just a quick call to the isSatisfiedBy method to check for correctness.

0 comments voice your opinion now!
specification php5 class download evaluate reuse


David Parra's Blog:
Compiling PHP under OpenSolaris
September 30, 2008 @ 08:46:09

David Parra has posted his method for getting the latest version of PHP compiled under a machine running OpenSolaris.

As I switched my main system recently from Linux to OpenSolaris I compiled PHP. Quiet obvious things are a little bit different on Solaris. The usual ./buildconf && ./configure && make install doesn't work anymore. The good news: It's not much harder.

A few extra packages are required (like SUNWgmake, SUNWgcc and SUNWbison) and the Re2c library, but after that, it's just like a normal install. All commands needed to make the build are included in the post.

0 comments voice your opinion now!
opensolaris compile php5 library package sun


Nick Williams' Blog:
The New .phar PHP Package
September 24, 2008 @ 09:38:40

In a quick post to his blog, Nick Williams points out a very handy extension for PHP - Phar.

Today I discovered a very powerful addition to the PHP world. Phar is an archive extension for PHP that allows an entire PHP application to be packaged into a single file. It's basically PHP's answer to Java's .jar archive format. Don't get excited yet, it gets better...

He mentions the reasons that make it "particularly handy" such as it being integrated into the next major PHP release (5.3) and that it makes deployment quick and easy. He includes a brief code snippet to show how a sample Phar archive could be created (via streams).

0 comments voice your opinion now!
phar package deployment extension php5 stream


PHPJack:
Zend Framework's Future
September 23, 2008 @ 09:32:44

In this post to his PHPJack blog Richard Heyes comments on the trending he's seeing in the Zend Framework and where its future might lie.

I have been critical of ZF in the past because the performance has pretty much been going down every release and I am not the only one seeing this, there have been a number of benchmarks that show this trend. Having contributed to ZF in the past I brought this issue up multiple times both on the mailing list and even during the meetings the past zendcons and it the general response was they where focusing on features not performance.

He points out a few things that were brought up at this year's Zend/PHP Conference & Expo including the performance focus of future releases, a push to 2.0 after PHP 5.3's release and some of the changes that can cause breaks in backwards compatibility.

Be sure to also check out Matthew Weier O'Phinney's response to the post and some of the comments Richard made.

0 comments voice your opinion now!
zendframework future trend performance release php5


Total PHP:
Choosing a PHP Web Host
September 22, 2008 @ 11:19:54

The Total PHP site has a few suggestions for you to look at before choosing your next web host - five of them:

  • PHP 4 or 5? - if you haven't made the switch to PHP5, there's no better time
  • Linux/Apache - Windows is largely an ASP.NET platform
  • Access to outside the document root - it can be very useful for templates, config files and the like
  • Scripting requirements - be sure anything you might need for an outside application (like WordPress) is there
  • General advice

There's a bit more detail on each of the points to round out the advice.

0 comments voice your opinion now!
choose web hosting php5 php4 linux apache docroot requirement


Lucas Baltes' Site:
PHP Museum Visual Timeline
September 22, 2008 @ 09:33:50

Richard Heyes has pointed out an interesting little app that Lucas Baltes created to visually show the timeline of PHP releases from now back.

The timeline stretches all the way from the current PHP 5 release (bye bye PHP 4) back to some of the initial releases Rasmus made as the "PHP Tools version 1.0" back in 1995. Each entry is timestamped with when it was released and some of the more recent ones have "tails" showing how long their life lasted.

Lucas also links to the museum on the PHP.net website where all of these versions can be downloaded.

0 comments voice your opinion now!
visual timeline release php4 php5 tools history


Christoph Dorn's Blog:
Your Mac can talk FeedBurner stats via PHP!
September 18, 2008 @ 17:35:39

In a recent post to his blog Christoph Dorn shows off a cool little trick to getting your Mac to respond to your (vocal) request for website stats from FeedBurner.

You have a blog and you are proud of it. Your sense of self-worth depends on how many people are following it. Making a detour to FeedBurner every day (the feed stats only update once a day) to check on your vitals is simple and does not take long (with a bookmark) but there has to be a more automated way.

His better way involves tying together the speech recognition that OS X offers, the "say" command line tool and a PHP5 script that can go out and read/parse the FeedBurner XML information for your website. Throw in a little command line script and some set up in the Speech tools and you have a handy little script that can fetch your latest stat information just from your request.

1 comment voice your opinion now!
feedburner statistics mac osx php5 xml simplexml


Debuggable Blog:
Installing PHP5.3 via MacPorts
September 17, 2008 @ 10:16:55

On the Debuggable blog, Felix Geisendorfer has a quick post showing the (basically) one step installation of the latest development version in the PHP 5 series, PHP 5.3.

I'll share an easy way to play around with PHP5.3 if you're on a Mac. First of all install MacPorts (don't forget to install XCode before).

He also includes a one-liner to be sure its all installed and working with the right version.

0 comments voice your opinion now!
macports php5 install tutorial xcode


Lukas Smith's Blog:
Who is using namespaces in PHP already?
September 08, 2008 @ 08:42:18

Lukas Smith has asked a question of the community with the release of PHP 5.3 coming nearer and nearer - who out there is using namespaces already?

As I said in my last post we are not yet sure if we need to make some changes to namespaces before we can move from alpha to beta in the current 5.3.0 release cycle. What I did not ask for explicitly is feedback from people that have already started developing code with namespaces. These people are likely the best source of feedback on the current state of namespaces and if the proposed changes to namespaces would be useful or not

He mentions that the Doctrine project is already playing with them and, apparently, some of his commentors - one using them on a library in development, porting over XJConf to use them and other various projects.

0 comments voice your opinion now!
namespace php5 use project application question


Lukas Smith's Blog:
PHP 5.3.0alpha2 is released
September 04, 2008 @ 07:55:12

In a new blog entry Lukas Smith notes that the latest alpha release, version 2, of the PHP 5.3 series is now available for download from the PHP QA website.

If you check the qa website you will see that there is a new alpha release of our next minor version PHP 5.3.0 out that is awaiting your testing (remember no whining about BC breaks if you did not test the pre-release versions). [...] Aside from a few additions, it was mainly bug fixing in this release. The biggest changes happened in the fileinfo extension.

The Windows infrastructure has been moved off on its own with lots of different binaries to choose from. The next version could either be another alpha release or make the jump up to beta - feedback for the aplha2 and the namespacing inclusion will make that determination.

0 comments voice your opinion now!
alpha beta php5 release qa windows


PHPClasses.org:
Book Review PHP 5 CMS Framework Development
August 29, 2008 @ 12:09:59

On the PHPClasses.org website there's a new book review posted from Alexandre Altair de Melo about a new book from Packt Publishing - "PHP 5 CMS Framework Development" (by Martin Brampton).

Often developers have to think about several aspects of the architecture of a system for the Web, not necessarily restricted to requirements of the software. With this in mind the book "PHP 5 CMS - Framework Development" is very rewarding reading.

Alexandre talks about the author of the book, the wide range of topics discussed in it (some not just applying to CMSes) and a breakdown of the contents of each chapter.

It is great work from the book author and the publisher, as we now have another great title, not only about PHP, but also about designing an architecture for software not just for only for creating content management systems.
0 comments voice your opinion now!
bookreview php5 cms development framework packt martinbrampton


Chris Hartjes' Blog:
Reader Feedback Working with XML In PHP
August 28, 2008 @ 09:39:07

Chris Hartjes has answered some more questions his readers have asked in a new post to his blog today. This time the focus is on XML handling.

Welcome to the 3rd installment of me answering reader feedback questions. Today we deal with a topic that I deal with every day at my day job - working with XML in PHP.

He talks about SimpleXML (and how well it does its job) and their (his work's) current method of handling the storage of XML in a database. He describes both their current process and his ideal one, how he'd want to interface with their eXist backend.

0 comments voice your opinion now!
xml simplexml php5 exist database xquery xpath


Lifehacker:
Host Your Own Music Playlist with Opentape
August 28, 2008 @ 08:45:20

With the demise of the muxtape service, a new option has popped up - the ability to run your own version with a PHP application called OpenTape. Lifehacker has posted a guide to getting this software set up and working.

Beloved music playlist hosting service Muxtape's gone offline to "sort out a problem with the RIAA," but if you've got some web server space, you can host, stream, and share your own digital music mixes Muxtape-style with newly-launched PHP web application Opentape.

It's not a direct copy, but it's pretty close (and pretty easy to get up and running). It'd PHP5 only, so if you're still living in the past and only have PHP4, you're out of luck. Their guide shows a sample installation on a Windows machine, but its not much of a stretch to follow along on a unix-based machine. You'll also need the curl extension to get some parts of it working - it's not required, though. They have a work-around for that too.

0 comments voice your opinion now!
opentape playlist music php5 application mp3


ONLamp.com:
Important PHP 5.3 Changes for those of you Running Microsoft Windows
August 27, 2008 @ 07:57:00

On the O'Reilly ONLamp blog Todd Ogasawara points out a few things that Windows users should watch out for with the upcoming PHP 5.3 release.

PHP 5.3.0 is only in its first alpha release. But, if you run PHP in Microsoft Windows, you should talk a look at the release notes for Windows binaries.

Among the changes are things like the drop of support for Windows versions less than Win2000, the changeover for compiling needs (VC6 versus the newer VC9) and that 64-bit binaries will be provided as well as the normal 32-bit (on a trial basis).

0 comments voice your opinion now!
php5 change windows compile binary w2k visualc 64bit


Paul Jones' Blog:
Solar System
August 26, 2008 @ 07:54:33

Paul Jones points out a new system for the Solar framework that will help those new to using it get started - a sample application that you can grab from Subversion in the traditional "hello world" style.

In the spirit of some other framework projects, the Solar Framework for PHP 5 now offers a ready-to-use Solar system to get new users off to a quick start. It's not prepared as a tarball just yet, but it is available for checkout or export using Subversion from http://svn.solarphp.com/system/trunk.

The sample installation creates a front controller, an authentication system and a "bookmarks" application to give you an idea of how everything fits together. You can get more information on each of these parts and how they all work on the Solar manual/wiki.

0 comments voice your opinion now!
solar php5 framework sample application helloworld bookmarks svn subversion


Christian Weiske's Blog:
Importing huge XML files using PHP5 - efficiently and conveniently
August 25, 2008 @ 09:34:38

Christian Weiske has a quick tip on how to get larger XML files to pull into PHP5 and be usable:

At work I had the task to implement the synchronization between an online shop and a commodity management system. Data exchange format was XML - one big XML file for all of the products (some thousands with dozens of attributes). Big question: How do I import the file in a way that is most convenient for me as a programmer - and without exceeding the machine's RAM when loading a 1 GiB file?

The newer alternatives both use the same technology (DOM and SimpleXML - with DOM behind it) so he goes more "low tech" than that and opts for the XMLReader extension to pull in the large amounts of data. Available in PHP5, the XMLReader extension, which he combines with an Iterator from the SPL to makes for a simple, quick little parser.

0 comments voice your opinion now!
import xml file php5 efficient convenient xmlreader spl iterator


Nexen.net:
PHP Statistics for July 2008
August 14, 2008 @ 11:16:06

Damien Seguy has official published the PHP statistics for July 2008 to the Nexen.net website today. Here's a summary:

  • PHP 5 reaches 40,63% of PHP market share
  • PHP 5.2.6 usage is growing fast, about to take over PHP 5.2.5
  • PHP 4.4.9 and 5.2.6 will threaten PHP 4.4.8's dominance in August 2008

You can find the evolution stats for this past month here and the full statistics here.

0 comments voice your opinion now!
statistics evolution usage