Knut Urdalen's Blog: ORM the manual way
553076
Knut Urdalen, on seeing some of the recent discussion on why the ActiveRecord pattern sucks and talks about why, when presented with a the need for a database layer, he usually goes back to his own familiar Singleton-based style.   I normally use a simple solution using the Singleton pattern for managing the database connection, the Value Object pattern for all business objects and the Data Mapper pattern to manage the mapping between business objects and the database schema. It's as simple as that Ã¢Â" handcrafted and no magic going on.   The post also includes his code for an example of a database connection - the creation of the Singleton interface class, making the Value Objects and customizing one for the type of "Product".
751529
Michael Kimsal has come up with the start of a series to introduce PHP developers to the world of Grails (the Java framework).   The comparisons I plan to make will be mostly to PHP, cause that's what I'm most familiar with, though there may be some other comparisons from time to time.  This is a work in progress, but I'd be very interested in feedback from anyone out there interested in this aea - Grails, Groovy, PHP, why another language/platform/framework, etc.   The first two installments have been posted - part one and part two - with an introduction to what Grails is and a brief dip into some "Hello world" sort of code to give you an idea of the structure.
676141
While attending Gunter Kniesel's "Aspect-Oriented Software Development" lecture yesterday it occured to me that it might be possible to (ab)use PHP 5's __autoload(), __call(), __get(), and __set() interceptors to facilitate Aspect-Oriented Programming with PHP.
81155
From the PHP in Action blog today, there's a new post that (briefly) shows how to run your tests directly from a popular unix text editor - vim.   I created my own test runner to run tests inside Vim, I can't remember how long ago. Must be a year or two. I never shared it with the world. It was too primitive for anyone else to use. Then, recently, I decided to try re-implementing it in a more serious way.   The "more serious way" meant using Vim script to its full potential, including the ability to work with objects and already has its own testing framework. He includes a screenshot but no download just yet. It looks promising and makes running tests as simple as hitting F11 and watching it go.
546713
In an effort to somewhat unify the authors of the wide range of PHP database abstraction layers out there in the community, Lukas Smith has proposed a "doctrine miling list" for the discussion of things "like best practices, new discoveries, challenges, etc".    Now I am hoping that all of you are reading this. I know quite a few of you pretty well already (John, Hans, Manuel etc.). [...] So please everybody come out of the woodwork, send me a mail or post a comment.   While I think its fine for end users to also join the list, the goal is not to create a list for end users to ask questions, but more for people who actively develop database abstraction layers. End users should better go to the respective mailing lists.    Ian P. Christian has already stepped up to the plate and is offering a mailing list that you, the database abstraction developer can subscribe to - mailto:phpdbabstraction+subscribe@lists.pengus.net. Be sure to check out the comments for more great discussion.
485840
P&aacute;draic Brady continues his series on working with Complex Views in the Zend Framework with this new article - part seven focusing on the Zend_View Enhanced method.   It's been a long, and hopefully interesting, road to Part 7. In this concluding entry to the long running, and oft delayed, "Complex Views with the Zend Framework" series I introduce the Zend_View Enhanced Proposal for the Zend Framework, elaborate on its operation, and provide some opinions on the ongoing debate over its implementation.    In this final entry of the series, he recaps previous concepts (like Partials/Layouts/Controllers/Placeholders) and how far reaching the Zend_View Enhanced component is. He also includes some of the helpers and interfaces he's proposed for the module including:   Zend_View_Helper_Partial Zend_View_Helper_Controller Zend_View_Helper_HeadScript Zend_View_Helper_Doctype Zend_View_Helper_HeadStyle   He takes each of the concepts mentioned above and applies these different helpers/interfaces inside them, illustrating with some sample code as needed.
42444
PÃ¡draic Brady has a quick update today pertaining to the PHPSecInfo project - a new manual (currently in development).   I'll keep adding to it over the days, weeks and months ahead. The current form is going to be mainly a draft. When it's done, I'll go through it and do some serious editing. Next priority is getting in the material on actually using and implementing PHPSpec...   You can find the manual at http://dev.phpspec.org/manual/ with quite a bit of content already filled out. Topics currently covered include installation guides, your "first steps", testing the code and some examples of it in use.
754197
Last week, Mauricio Fernandez announced a new Ruby to OCaml bridge that he&#8217;s working on, called rocaml.  With the growing interest in functional languages in the Ruby world, this seemed like the sort of thing I needed to talk to him about, so I sent off a quick set of questions, and this is what I heard back1.
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.
448776
Sara Golemon describes the path she took in a search for an OpenID library to work with in PHP. The trip took her through both PEAR and PECL with no promising results. Heading off to a Yahoo! search she comes up with one good result - Auth_OpenID.   Now, granted, this is the first OpenID system I've looked at, and I haven't really dug into it in depth, but I've got to say, this is some clean, well written code and the author clearly understands the maths involved (or at least fakes it shockingly good).   Knowing this, she asks "why isn't this in PEAR" if it's so well-structured and useful? It works with any version of PHP from 4 up and is smart enough to adapt itself to whatever the structure of your application might be.   There's also some great comments on the post where it's explained why the library isn't in PEAR, another OpenID package for PHP and suggestions for alternate distribution methods (PEAR channel).
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.
94499
Nefarious Designs continues their object-oriented PHP series with part four posted today, a look at some of the new features that PHP5 brings to the table.    After a welcome break, over the late summer public holiday here in England, here's the final part in my object-oriented PHP series. Sorry about the rather extended pause since "Part 3: Taking Relationships Further".   Having already looked at definition, relationships and taking those relationships further, I'm going to look at how PHP5's new Object Model introduces more advanced functionality.    In this latest part they look at clas constants, abstract classes, object interfaces, and magic methods (including overloading).
124693
Jared White has posted another Willowgarden highlight to his blog today, this time with a focus on the processing of form input.   In the bad old days of processing forms and saving each field to a column in a database row, you'd have to do a lot of manual gruntwork: accessing each field from the $_POST superglobal, checking the values, constructing the SQL query, connecting to the database and executing the query, and so forth. Wouldn't it be great if you could just import the form right into an object, and let it do the validation and the database saving based on just a few simple rules? Let's take a quick look at how that might work.   He shows how to make an instance of the WFFormCreator class in a simple script and add actions to it to handle the successful submission and the errors that might come up.
434224
Back with his own look at the php/db|works conference is Cal Evans wrapping up Day Two:   Day Two at php|works started off with a bang. Rasums presented his "Getting Rich with PHP" as the opening keynote. If you've never seen this presentation, the OSCON version is described here with links to a video of it as well as the slides. It's an interesting presentation. I missed the first section of it at OSCON where he slaps around both IE and FLASH pointing out some serious security holes. Again, it's a great presentation and worth the time to listen to.   Cal talks about...well...the talks and about the interviews he started (like with Chris Hartjes, Ilia Alshanetsky, Chris Shiflett, and Sebastian Bergmann).
496780
Lorenzo Alberton has posted some updates about the PEAR packages that he maintains to his blog today including MDB_QueryTool, Mail_Queue2, MDB2, and Translation2.   Even if lately I've been coding way more in C/C++ than in PHP, I still keep an eye on PEAR developement: I reckon in the last month I've closed a bug a day, on average. And after my last call for help about my PEAR packages, I'm also pleased to announce that someone did indeed offer a hand. I'm happy to welcome not one, but two new developers!   Each of the items has links to their PEAR homepage and a few quick words on where the package stands (including developers involved or wanting to get involved). He also reminds developers out there that they can help out too if they want to jump in and get into PEAR.
242013
Popular posts from PHPDeveloper.org for the past week:ProDevTips.com: Writing a CMS/Community with Smarty and the Zend Framework: Part 6Nessa's Blog: Using an .htaccess with PHP Compiled as CGIArnold Daniels' Blog: How I PHP: The Output Handler - ContinuedMartynas Jusevicius' Blog: PHP 5 features: Class autoloadingSean Coates' Blog: Actually Solving a Problem (believe it or not)The Northclick Blog: Message Queue Project: First working versionStefan Mischook's Blog: A Question about object properties in PHP ClassesJob Posting: G2 Technology Seeks PHP Developer (Memphis, TN)Rob Allen's Blog: Zend_View: Access the view from a view helperDavid Walsh's Blog: Using PHP Generic Objects To Organize Your Code
360849
On the Zend Developer Zone today, there's this new tutorial that looks at making the move from PHP4's object-oriented programming up to the "more complete obejct model of PHP5" - specifically with the Decorator design pattern.   While working on a project I realized one particular solution was a pretty good way to demonstrate the decorator design pattern together with some of PHP5's features, including abstract classes, interfaces, type hinting, the final keyword and the visibility of properties and methods. This article is intended for those of you who, like myself, are moving from object-oriented programming, including some use of design patterns, in PHP4, to the more complete object model of PHP5.   He sets up a scenario about the development of an online pizza ordering system to show how to "decorate" a pizza with each of the toppings on a list (instead of having to list out every pizza in every possible topping combination). Of course, all of the code is included and explained so you understand exactly what's happening. Finally, there's a demonstration of its usage - a simple call that grabs the stock level/name/cost of each of the items in stock (pizza combinations).