DevShed: Using Introspective Methods with the DirectoryIterator Class in PHP 5
602334
DevShed continues their look at the DirectoryItertaor class in PHP 5 with part three posted today, a look at using the introspective methods to find out information about things like if a file can be read or not and what its permissions are.   This class still has some additional methods that require special attention. For this reason, this last tutorial of the series will be focused mostly on covering all the methods related to performing some kind of introspective process, which can be quite useful when analyzing the types and permissions of each entry included in a given directory.   They go through the functionality, pointing out the functions to check:  if an entry is a directory or not if an entry is a "dot" or not ("." or ":") if the entry can be executed/read/written to to grab the permissions and the type of the entry  And, of course, there is code to go with each example, making it easy to pick out the parts you'd find useful and include them in your own code.
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
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
445025
Popular posts from PHPDeveloper.org for the past week:Stijn Leenknegt's Blog: [PHP6] function-return-array idea!GeesNotNerds Blog: Free PHP + Ajax chat appStefan Mischook's Blog: Object Oriented PHP Tutorial Updated - Steps 18 - 22Dave Dash's Blog: SymfonyCampWebDigity.com: PHP geotargeting techniquesEtienne Kneuss' Blog: Late Static Bindings ExplainedDevShed: Handling Static Data with PHP 5PHP-Learn-It.com: Cooking Cookies with PHPMichael Kimsal's Blog: PHP PredictionJob Posting: Steinman Recruiting Seeks Senior Developer (Littleton, CO)
769015
Felix Geisendorfer shares, in this new post to the ThinkingPHP blog, some of his experiences with writing his code using test driven development.   So far I've had tons of fun trying to create php code using test driven development. It caused my code to become a lot more structured/consistent because writing the tests shows you interfaces problems right away. This is because the process of writing the test forces you to think a lot more about *how* you want to use some class / piece of code vs. your traditional "how can I get task x done"-thinking.   He also points out another benefit - it makes refactoring the code even easier (so there's more of a likelyhood that you'll use it again and again). He talks specifics about a library that he's been working on and the processes he's gone through to make things work with the testing versus his normal development cycle.
480439
The PHPClasses.org website has posted their review of a Packt Publishing book covering PDO - "Learning PHP Data Objects" (by Dennis Poppel).   In Learning PHP Data Objects, the author, Dennis Popel, examines this new system and explains how to begin using PDO in development as a replacement for typical database drivers. The book is an excellent introduction to the data abstraction layer. It also provides essential insight into the inner workings of database interaction with PHP.   The review talks about the contents of the book, what PDO is/how it's used and how well the book hits the mark for its target audience.
365169
Continuing their look at design patterns, DevShed has kicked off yet another series today spotlighting the Composite pattern as used in PHP5.   The composite pattern is one of the less commonly used patterns in PHP 5. Nevertheless, in certain situations, it is very helpful. This article, the first one in a two-part series, will introduce you to the basic concepts of the composite pattern.   The composite pattern allows you to define a single or multiple objects that will have identical behavior - basically behaving the same if there's just one or with the multiple instances. They start with the basics, reaching for one of their standard examples - a file information reader - to illustrate their point. They create the two helper classes it needs to work, one for the single file read and another for the multiple file read. The finish by combining them all together for a file-reading fiesta, showing how to get a one shot info dose as well adding files to the list and grabbing their info all together.
484390
Though it contains no code, this new article on PHPBuilder provides a good perspective for those looking to get into PHP and what to expect to find.   A couple of months ago, I knew almost nothing about PHP, only that is was a programming language that I needed to learn. Today, my whole site relies upon PHP and I have gained the confidence that almost anything is possible using PHP. I accomplished this achievement using methods that I will describe in this article.   The author talks about the methods followed to get into the language, including making smaller goals at first, just to get used to things. The manual is also suggested as a "best friend" for a developer and looking at other people's code can provide insight into your problems.
463548
On the PHPClasses.org website there's a new entry covering, among other things, one handy feature PHP includes to let developers read and write their data more flexibly - streams.   This article explains what are stream handlers and how they simplify PHP developers lives by allowing PHP applications to easily read and write data from containers, like remote Web pages or e-mail messages, as if they were files. [...] The article also presents more examples of cool stream handlers classes submitted to the PHPClasses site by several authors.   He describes the abstraction that the streams interface allows, how they can make your life easier, a real-life example of streams in action (working with POP3) and some of the classes that have been contributed to PHPClasses.org that use them.
451308
Over on the Zend Developer Zone today, Akash Mehta has written up  a review of a book from Packt Publishing, "PHP Web 2.0 Mashups" (by Shu-Wai Chow):    As it's title suggests, PHP Web 2.0 Mashup Projects is a demonstration of the various techniques available for developing mashups in PHP. Through a highly practical format, Shu-Wai takes the reader through a series of projects utilising different web services and APIs, while carefully exposing the reader to a wide variety of technologies and data formats.   With careful selection and shaping of language, the book is an extremely effective introduction to the world of mashup development with PHP.    Akash talks about the contents of the book (the different projects it covers) and how the book provides a version useful resource to those just getting into the mashup world - a reference guide to some of the popular data transfer methods/formats out there.
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.
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  \
343797
As a companion to the podcast version of his review, Matthew Turland has posted his comments in text form over on his blog today.   I received an e-mail recently from a very nice gentleman at Packt Publishing - their representative asked if I would be willing to review one of their books, namely PHP Web 2.0 Mashup Projects by Shu-Wai Chow. Reviewing books is not something I had done before, so I thought I would give it a good old-fashioned college try.   He mentions the size of the book (and how it's not an indication of the quality) and the basic structure of the book, including spotlights on some of the specific topics covered.
146149
An introduction to using refactoring, unit testing and ZenTest on existing code.
103599
Latest PHPClasses.org Releases:Factorial and Euler Constant calculationOnly DomainMulti-User Tag CloudGzOutputJetDirectPHP SerialCitizen C2202-PD Control ClassEnhanced QuickSortJSCaptchanDialogTab ClassmysqlFormHTML Graph makerEncoding Sessions
548706
The Zend Developer Zone has posted a review of Packt Publishing's "Learning PHP Data Objects" book writen up by Akash Mehta.   In Learning PHP Data Objects, the author Dennis Popel examines this new [database access] system and explains how to begin using PDO in development as a replacement for typical database drivers. The book is an excellent introduction to the data abstraction layer and also provides essential insight into the inner workings of database interaction with PHP.   Akash talks briefly about the history of PDO and what it can be used for first, then gets into the contents of the book (things like the intro chapters and the quality of the writing). The thing he thinks makes the bok stand out, though, is the examples and sample code that reflect both simple methods and more complex issues PDO developers might run into.
575210
Popular posts from PHPDeveloper.org for the past week:PHP-Coding-Practices.com: How I Turned A Slow Array Sort Into A Quick One Using Quicksort AlgorithmZend Developer Zone: PHP Abstract Podcast Episode 4: Planning ProgrammingWeb Development Blog: Save bandwidth with PHProxy and ip2nationJob Posting: Assembleron Ltd Seeks PHP 5/MySQL/Ajax Developers (Reading, UK)PÃ¡draic Brady's Blog: Complex Views with the Zend Framework - Part 6: Setting The TerminologyThe Bakery: Four New Articles - Load Balancing, Request Info, UUID Behavior & Upload ThumbnailsCommunity News: PEAR Installer version 1.6.0 releasedChristopher Kunz's Blog: Building PHP with cURL and libmysqlclient5DevShed: Working with Prepared Queries with PDO Objects in PHP 5Secunia.com: rPath update for gd, php, php-mysql, and php-pgsql