DevShed: Introducing Static Members and Methods in PHP 5
235064
DevShed has posted the first part of a two part series today looking at the use of static members and methods in classes in your PHP5 scripts.    Static properties and methods can be quite useful in a range of situations, not merely for constructing a Singleton class. This article, the first in a two-part series, introduces the basic concepts of static properties and methods, using plenty of hands-on examples.   Hopefully, by the end of this series you should be equipped with a decent knowledge of how to include static members and methods within your PHP applications with minor difficulties.    They start with a simple example of using both in a class before moving on to using the Singleton pattern working up to making a Factory for creating static objects.
733804
Continuing in their series looking at how to handle static data in a dynamic PHP application (see part one here), DevShed has posted the next piece in the puzzle, working with static properties in PHP5.   Provided that you already have an average background in using static methods with PHP 5, over the course of this second article of the series I'll dive a bit deeper into this interesting  topic and show you how to take advantage of static properties defined inside a given PHP class, in this manner completing, at least basically, the implementation of static data with PHP 5.   They start by reviewing the functionality from the previous part of the series and build on it, creating static properties within the class (user data in this case) and how to use it in a mini app to set and display the information.
743840
Chris Shiflett has posted his own recap of the (just passed) php|works conference up in Toronto over on his blog.   I've been traveling non-stop since php|works, so I haven't had a chance to reflect on the conference, what I learned, who I met, and things like that. (Zak has been doing a good job of this lately, and I'd like to follow his lead.) I've probably forgotten more than I remember, but this is my recap.   Included in the things he mentions are:  The people he was able to meet (like Joshua Eichorn and Sebastian Bergmann) The talks he gave ("Truth about XSS" and "Agile PHP Testing") His interview with Cal Evans of the Zend Developer Zone The PHP 5 Certification and Wez Furlong's "Not PDO" talk
769389
Latest PHPClasses.org Releases:Class TreeviewPHP User ClassDHTMLDumpSalatCSV Parse and ReadRSAsmb4phpClient infoTrue Singleton ClassRounded Border Table Generator
146149
An introduction to using refactoring, unit testing and ZenTest on existing code.
288007
After long discussions and much opinion being thrown around, Andrei Zmievski points outintegration of namespaces into the upcoming PHP6 release.   Ladies and gentlemen, we have namespaces.   According to the post from  \
305676
Raphael Stolt has posted a book review of one of Manning Publishing's PHP-related books, "PHP in Action: Modern Software Practices for PHP".   Over the last few days I got the chance to skim through the upcoming Manning release "PHP in Action: Modern Software Practices for PHP" by Dagfinn ReiersÃ¸l et al. The reviewed book is seperated into four main parts, covering lots of interesting topics in a good and fluent writing style.   Raphael outlines the book, mentioning the four parts the book is divided up into:  Basic PHP tools and concepts Developing applications via Test Driven Development Web presentation and user interfaces Object-oriented development including things like database abstraction  Raphael gives the book a positive rating and recommends it for anyone that has the basics down and is looking to extend their knowledge that much more.
84867
Tobias Schlitt has a great (long) post responding to a proposal made on the php.internals mailing list for the inclusion of "taint mode" in upcoming PHP versions.   Tobias starts with an overview of what "taint mode" is so that everyone's on the same page. His example involves the incoming and outgoing data usually involved in an application and how the incoming can be the most problematic when it comes to the values inside. This is where taint mode can come to the rescue. At its most basic level, it's a method for, assuming everything coming in is "tainted", creating a mechanism to automatically clean the data before it's even touched.   With the basics down, Tobias looks back to the proposal for a few additional comments. He considers the proposal a great way to introduce the functionality to the language. There are some draw backs he mentions, though, including the additional overhead of working through every inputted value.   Overall, I think this whole thing would be a great addition to PHP and I hope this could come for 6.0. What do you think?   You can also check out some other opinions on the matter:  "Tainted mode" pour php on the Kamelot Blog
317911
DevShed takes a look at another of the design patterns in a new series starting with this new tutorial - a look at the implementation of Adapter objects in PHP.   You may have already encountered situations in coding PHP applications in which you would like to use inheritance, but could not for one reason or another. Fortunately, there is an alternative for these situations that can help you achieve the same result. In this first article in a two-part series, you'll learn about the adapter pattern.   They start off with the basics of the Adapter pattern and move quickly into the first definition of a class using them - a directory processor. Once that's built, they show how it all works with a more practical example.
624249
On the Zend Developer Zone, there's a new post pointing to the second part of their look at the Manning Publishing book "PHP in Action".   If you've been anxiously awaiting part two of this series then your wait is over. Here's a short introduction to the section part of this series written by the author of the book, Dagfinn Reiersol. I had the privilege of meeting Dagfinn at phpuk last week. Below the introduction is the link I know youâve been waiting for.   The new PDF they link to focus on two different patterns - the Decorator (a wrapper class) pattern and the Null Object (an object that works like the others but does nothing behind the scenes) pattern.
568782
DevShed has posted the next-to-last (part four) of their series looking at destructors in PHP5 applications today. This time they focus on passing information back out of the destructors as the script is finishing.   In this fourth article of the series I'm going to teach you how perform this process when working with multiple objects (remember that you already learned how to achieve this using only one class instance).   They start simple, showing how to handle one object to give you a base to work from. They modify this to expand it out and show the management instead of three different user data objects.
765764
Devshed is continuing their look at OOP and design patterns (started here) with the second part of the series - a look at the Adapter and Template Patterns. It's another excerpt from Advanced PHP Programming by George Schlossnagle.    You have likely heard of design patterns, but you might not know what they are. Design patterns are generalized solutions to classes of problems that software developers encounter frequently.   To claim that a single chapter on design patterns is in any way complete would be ridiculous. The following sections explore a few patterns, mainly as a vehicle for showcasing some of the advanced OO techniques available in PHP.    They cover the Adapter pattern first, showing how it can be used to create an alternative to an API object (a database layer, in their case). They follow this up with a quick look at the Template pattern, handy to create a set of "hidden" values inside of a extended class.
437494
Popular posts from PHPDeveloper.org for the past week:PHPClasses.org: A PHP killer feature - Streams abstractionRob Thompson's Blog: Switch vs. IfPHPEverywhere: Octopussy numbers in PHPJob Posting: MODE Visual Seeks PHP Developer (Charlotte, NC)ProDevTips.com: Why PHP as a templating language sucksMatthew Turland's Blog: The Yin and Yang of TypingStubbles Blog: Stubbles 0.5.0 releasedChristopher Jones' Blog: Updated connection pooling in PHP's OCI8 extensionBen Ramsey's Blog: Congrats Costa Rica PHP!Carsten Lucke's Blog: Configuration issues with Xdebug on Debian Etch
710066
DevShed continues their series covering SQLite in PHP5 today with the final tutorial - "Additional Methods for Using SQLite with PHP 5":   The list of additional features offered by SQLite is really impressive. Therefore, in this last article of the series, I'll be taking an in-depth look at them. This will complete our analysis of this excellent RDBMS integrated with PHP 5.   First up is a look at the usage of the seek and lastInsertRowid functions followed by the changes and queryExec methods. They show how to use the createFunction method and show one of the more advanced features of SQLite - creating a database that only exists in the server's memory.
188981
DevShed is continuing on with their series looking at advanced concepts of object oriented PHP with this new tutorial. It's part three of four parts, looking this time at polymorphism and design patterns in PHP.   Last week, we continued our discussion of the object-oriented features of PHP 5 by taking a first look at design patterns. This week, we will continue looking at design patterns, and examine polymorphism. This article, the third of four parts, is excerpted from chapter two of the book Advanced PHP Programming, written by George Schlossnagle.   They cover some of the more handy features OOP in PHP5, including interfaces, type hinting, the factory pattern and the singleton pattern.
86944
DevShed continues their tutorial series looking at working with PHP and databases today with more excerpted material from the O'Reilly book "Programming PHP, Second Edition" (by Kevin Tatroe, Rasmus Lerdorf, and Peter MacIntyre).   Picking up from where we left off last week, we'll be discussing shortcuts, query responses, metadata, and more.   They start off looking at shortcuts, those handy things the PEAR DB package offers to make life simpler (like getRow and getAssoc) before moving on to how to get the details about the response itself (like affectedRows and tableInfo). Next up is working with the metadata (using getListOf) and, finally, a sample application to tie them all together.
194190
Matthew O'Phinney has two new posts that talk about something object-oriented developers seem to shy away from - globals in their classes and how they can make things more difficult to make "embeddable applications" a reality.   In my previous entry, I ranted about the use of globals in popular PHP applications, and how they make embedding said applications difficult. I develop using object-oriented practices, and can honestly say I can't recall ever having slung a global variable around in my own code. Globals seem hackish to me, and as a result, trying to get applications that use them to behave correctly has been a challenge.   In the first part, he notes an interesting find about the $GLOBALS value and illustrates with a code example how he was able to get around it in his instance (wrapping a Serendipity instance in a Zend Framework app).   In part two, though, and uses another code example to show what kind of issues he was seeing with the $GLOBALS - a script that sets some globals in different instances and echoes the results back out.