DevShed: Tracking Parsing Errors with the Tidy Library in PHP 5
526550
DevShed wraps up their series on using the Tidy extension with this last tutorial showing methods of tracking parse errors with the help of the library.   So, the question that comes up is the following: what is the next step? Well, from a PHP developer's point of view, tracking all the errors that occurred when parsing a concrete (X)HTML string might be quite useful. Therefore, in this final tutorial of the series I'm going to cover some new functions bundled with the Tidy extension which are designed to show you the potential errors raised when interpreting (X)HTML data.   The tutorial shows how to use the tidy_get_error_buffer, tidy_access_count, tidy_error_count and tidy_warning_count functions to search through your code and handle whatever errors (and error data) that might come up.
275619
Travis Swicegood is teasing us with some output from a script in his latest blog post:   So my free time of late (what there is of it) has been spent on a project that's getting really close to v0.1 release. In other words, its first functional release. If you've ever run a test using the PEAR installer or know what a .phpt file looks like, you might be able to guess what I've been up.   Keep an eye on his blog for more information on his "secret project".
649335
Michael Kimsal has posted some more thoughts on what he calls the "sad state of PHP development" pointing out some of the practices of the PHP group surrounding the development of the language.   Every few months there's a release, whether large or small, which introduces new features and bug fixes. However, with every release also comes fears of tiny, sometimes undocumented, changes that break existing code, and often for no solid reason other than someone with commit access decided they liked the 'new' way better than the old way.   He points out a specific example, get_object_vars and how its return values were changed in an earlier release as well as the update to glob made recently to change its return types.    In his opinion:   No changes should be made to the PHP core without an issue being opened, either in the 'bug' tracker or some other issues tracker.   Be sure to check out the comments for other great opinions on the topic.
740094
In his travels as a PHP developer, Jamie Wong has gathered some helpful debugging tips that are shared in this latest post to his blog.   Here are some bugfixing rules and tips Iâve learned working all these years with PHP. I emphasize mostly on fixing bugs than preventing them, which is another subject worth of its own article. Iâve moved to Rails, but I wanted to finish this post as a farewell and thanks to every article and documentation that was useful to me. Hope this is useful to you too.   Topics covered include:  Assume nothing Turn Error Reporting to show all errors Read the error message Understand the bug "Scooby-Bug, where are you?" Get as much information as possible  Each has some explanation below it and, in some places, a bit of code to clarify the point.
766229
There are some PHP developers out there that see PHP as a sort of constant "work in progress" with issues all around - confusing function names, non-intuitive features, and more. So, a group has been formed to help clean things up a bit - the ogoproject.   The ogo project aims to clean up PHP, starting with fixing the inconsistent (and difficult to remember) function names. PHP needs clear naming conventions, and it needs to stick to them. We will offer a temporary fork until function name changes are agreed on, and sensible backwards and forwards compatibility is in place. Then we can get our changes merged into the main branch.   They've already posted some suggestions for a few things, including conventions they're looking to follow and a list of new function names changed according to these new conventions. There's also a downloads and forum section that will soon have content.   If you're interested in getting involved, stop by the #ogoproject channel on the Freenode IRC network and see what's going on.
403472
Reinhold Weber has put together a list of signs (40 in all on his "programming list of shame") that you're a lousy PHP programmer. Here's a sampling:   don't see the need and/or benefits of a good programming IDE like Zend Studio or Eclipse PDT have never used some form of version control like Subclipse don't use a consistent methodology don't use test-driven development don't return content but echo or print it from your functions or classes return HTML, not data, strings, or objects. don't allow intelligent error handling you think reusable software equals/requires your code to be OOP   Now granted, some of them are a bit more high level than others, but if you're not headed towards a lot of these, you might change paths, hop out of that comfort zone and branch out into the community and the language a little bit more.
573906
In a new blog entry today, Matthew O'Phinney talks about updates (and refactoring) that he's done to a PEAR package he's developed, File_Fortune.   Over the past few evenings, I've refactored File_Fortune to have it implement Iterator, Countable, and ArrayAccess -- basically allowing it to act like an array for most intents and purposes. As a result, I've eliminated the need for the File_Fortune_Writer package, and greatly simplified the usage.   The package is designed to make an interface between the casual PHP user and the fortune files common on most *nix machines. To illustrate he update, he includes some code that grabs the fortune file, parses it to grab a random one and echoes them out. Also included is the save() method so you can add your own to the list easily.
124078
I think I've mentioned this before but on Saturday Feb 12th I'll be talking  about the Jakarta FeedParser at CodeCon  in San Francisco.  I published an outline  of the talk on the FeedParser wiki.  I'm hoping to have a 0.5 release done before then and havepotentially another suprise in the works.
277304
The results from the latest poll conducted by the International PHP Magazine have been released. This time, they asked developers what they thought was the best way to do QA for their PHP applications.   Among the options were things like "Do API documentation", "Use code analyzers that check CS violations, XSS or SQL injection attacks" and the number one choice - "Do unit tests using PHPUnit or phpt". Three other options followed behind (using debugging tools, code analyzers and having a commit mailing list) with the API documentation falling down in last place.   They already started up this week's poll too. This time, they ask developers to vote on which of the options make for good PHP code. There's four options - structured, consistent, portable and secure. Get your vote in today!
654370
Pierre-Alain Joye has a little reminder posted to his blog today about two posts from planet-debian and Apache that refer to clones/references in PHP4 and PHP5 and some of the misconceptions presented there.   Reading planet-debian and Apache (from Sven and David), I catched two posts about clones and references in php4 and php5. I do not think it is worth to explain again everything here as Sara wrote a very good post already, check it out here.   He mentions his annoyance with articles/posts like these and the impact that it has on PHP as well as the person posting.   I wonder when the OS community in general will be mature enough to stop bitching at each other. And that's valid for PHP developers, gnome-kde and other well established wars.
725571
DevShed has a new article posted today covering some of the new features in PHP5.
494433
Latest PEAR Releases:PHP_FunctionCallTracer 1.0.0RC1XML_Query2XML 1.4.0Validate_LV 1.0.0Validate_LV 1.0.0RC2PEAR 1.6.2
692839
On his "Yet andother PHP blog" today, William Candillon shares a script he's written up to create a visualization of the parse tree of a bit of PHP source code.   I wrote this xslt stylesheet to visualize the parse tree of a PHP source code. The stylesheet can actually convert any XML tree to graph in the dot format interpreted by Graphviz.   His code is a simple seven line script that outputs a nice, clean tree structure image of how the process flows. He includes links to all of the source and files he used to create the tree image.
221371
When finding he was in need of a parser and lexer, Wez Furlong decided to work up one that was PHP-based and a take off of the popular lemon parser and JLex lexer.   From time to time, I find that I need to put a parser together. Most of the time I find that I need to do this in C for performance, but other times I just want something convenient, like PHP, and have been out of luck.   His result is two new packages - lemon-php and JLexPHP (under a BSDish license) you can download and compile on your own system.   Also, if you'll remember a while back, Greg Beaver had wanted something similar (as mentioned in the comments) and created his own lexer/generator as well.
79987
DevShed continues their looks at autoloading classes in PHP5 today with this new tutorial focusing on catching and handling any errors that might be thrown in the process.   This is the third article in the series on how to auto load classes in PHP 5. This article will demonstrate how to trigger exceptions in a way that can be caught by the corresponding "catch()" block.  [...] Nonetheless, this issue can be fixed with relative ease. That will be the goal of this third article of the series. So if you're interested in learning how this solution will be implemented, don't waste any more time and start reading now!   They start by looking at throwing an exception with the __autoload so that the script can catch it. The go back to mention the method they'd talked about before - using just eval() - and then show the "new and improved" method of handling the result with a try/catch block instead of a direct output.
632254
Harry Fuecks has gotten busy and posted the third part of his "Joy of Regular Expressions" series over on the SitePoint PHP Blog today.   Following on from the last part, this one is more of an intermission-a round up of regex syntax seen so far and a couple of links following feedback.   He looks at two different topics:  A "must reads" section of resources for getting the most out of regular expressions A comprehensive "cheat sheet" with tips on expression delimiters, literals, pattern modifiers, character classes, quantifiers, assertions, sub-patterns, and working with the blackslash.
139275
Popular posts from PHPDeveloper.org for the past week:PHP-Coding-Practices.com: Try-Catch Syntax WeirdnessPHPBuilder.com: Cross-Platform Database PHP DevelopmentIBM developerWorks: Java and PHP technology on AIX - Integrate the Java business application w/ DB2OpenSourceCommunity.org: What do you think makes a good CMS?Jonathan Snook's Blog: Elemental: Conditional Content with CakePHPDevShed: The Basics of Using the Factory Pattern in PHP 5Builder.com.au: PHP exploit code plants itself in GIFJohn Cox's Blog:  Linux.com Now PHP PoweredNick Halstead's Blog: Solving Programming ProblemsPHP-Tools Blog: Testing FIT