Joel Moss' Blog: Screencast: How to use CakePHP Database Migrations
121357
Joel Moss submitted a link today about a screencast he's developed showing how to use database migrations with the CakePHP framework.   At 20 minutes, it is a little longer than I wanted, but hopefully future casts will shorten with experience. This is planned to be the first of a series of screencasts, not just about Migrations, but about life with Cake. So without further ado, I proudly present Screencast Episode 1: How to use CakePHP Database Migrations.   The screencast is a Quicktime movie download coming in at 32mb, but is worth checking out if you're interested in working with the migration functionality in CakePHP.
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
388232
Chris Hartjes has followed up on a previous post about user authentication in CakePHP with a few more comments in part two.   I got a question in the comments about my previous post on simple user registration about how to do some of the necessary validation for registration in the model. I thought I'd show some code I did to do exactly that.   He includes the code for his example with the key, he explains, being the use of a second field (the confirm password field) to do the validation.
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.
444001
Those in the New York area might want to check out a new post Daniel Krook has concerning his talk he'll be giving on native XML databases at next week's New York PHP User Group meeting.   The presentation follows a mailing list thread and resulting blog post that generated a lot of interest and discussion on the topic. It should be a great talk for database administrators, application developers and content producers alike.   According to the summary of the talk, he'll be discussing what XML databases are good for and why you might choose them over a normal database. For more information on attending, check out the NYPHP User Group website.
319638
In this new tutorial on PHPBuilder.com, Ken Lin demonstrates how to import some data from an MS Access database into the most recent version of MySQL (version 5).   In this article, I will discuss whether or not to migrate your MS Access data to MySQL. Then, I will cover about the considerations, planning, and preparations which should made before migrating your data.   He follows the (good) practice of plan first, shoot later when approaching the subject. He talks about the differences between the two systems, when to and not to make the import jump, and some steps to do to prepare things for the leap.   He choses the Navicat tool to make the transition, stepping through the process the import wizard will follow to make the push much easier than a manual import/export.
280771
Chris Hartjes has shared his experiences in dealing with the combination of Postgres and CakePHP and convincing it to work with sequences in your tables.    I had been struggling with some weirdness that CakePHP has been displaying while trying to add some new features to the baseball league website, where Cake + PHP 4.4 + Postgres were deciding to just be sulky and not work together well.   Lucky for me, it turns out that the solution (for now) to the problem was to simply add the name of the sequence for that table as a variable to the model definition.    He includes the code for the Model that creates the connections between hos tables (belongsTo) and creates a sequence global to the class - note the naming convention.
739630
In his his latest blog entry, Felix Geisend&ouml;rfer makes a recommendation for anyone working with the CakePHP framework. He suggests doing something that most might avoid - diving into the source to find out how things work.   When hanging out in #cakephp I usally try to answer questions people have as good as I can. A lot of the times I have no idea what the answer is and in most cases the fastest way to find out is by looking at the core code. Ok, the manual is pretty decent these days and I would recommend most people to look for an answer in there first. But if you take the time to study the core code, you'll be able to answer almost any question by yourself, no matter if it has been answered somewhere before.   He talks about other advantages like finding those hidden, undocumented features already supported by the framework. Since this is the first part of the series, he just looks at how to get into the source. He starts off with the basic index.php file that comes installed with the distribution and a chunk of code that helps run the index file and is at the heart of how CakePHP works - the Dispatcher.
178429
On reading a message on the CakePHP mailing list about the web services built into the framework, Chris Hartjes decided to embark on his own look at what functionality the framework offers and how easy it is to use.   Might I add that until I tried this, I had never built a web service with CakePHP before. I found that by turning on the debug mode and actually following the instructions that were in the error messages (best undocumented feature of CakePHP if you ask me) I was able to build.   His code, while it worked, was one-upped by another's submitted to the mailing list (Samuel DeVore) so he's included that code in his example rather than the original. His example makes a TestController, an XmlComponent, and an XmlHelper to vary the output from a normal HTML to an XML format based on if "xml" is included in the path of the location.
241556
Cody Caughlan has created a project that brings one of the popular features of Ruby on Rails to the world of PHP5 - database migrations.   One of the cool things I like about Ruby on Rails is the use of "migrations" for maintaining your DB. Migrations have proven to be pretty handy in keeping a local database in sync with the work of other developers. [...] Because migrations are incremental and they are done in a structured manner, it is a great way of pushing out new DB changes to the production database servers.   His framework, Ruckusing Migrations, is a modular framework that makes use of some of the more advanced features of PHP5. It's portable (via an adapter interface) and uses a generic task interface (task files) to load functionality into the framework. There's also plenty of API hooks to allow for a developer to easily create their own custom operations.   Check out the project homepage for more information.
273337
Here's what was popular in the PHP community one year ago today:Job Posting: National Auto Warranty Seeks MySQL DBAJob Posting: National Auto Warranty Seeks PHP Web App Developer (Wentzville, MO)DevShed: Creating a Login Script for a PHP Invoicing SystemZak Greant's Blog: The eZ partner program (response to Seth Gottlieb's Commercial O/S business post)php|architect: Application-level Logging with the Zend FrameworkPaul Reinheimer's Blog: Object-Oriented PHP, Concepts, Techniques, and CodeRyan Malesevich's Blog: Fight Spam Comments with Bad Behavior and AkismetZend Developer Zone: SQLite: Lean, Mean DB MachineBuilderau.com.au: Cache PHP scripts with APC modulePro-PHP Podcast: Interview With Cal EvansSitePoint PHP Blog: PHP extension for Cairo graphics libraryTechnobabbler.com: making a radar loop with PHPDevShed: Working with MySQL Result Sets and the Decorator Pattern in PHPJob Posting: exhibit-E Seeks Interactive Developer (New York, NY)Jacob Santos' Blog: Patterns for PHP: Page Controller Draft
553589
Zend has a new tutorial posted in their PHP 101 series - PHP 101 (part 9): SQLite My Fire!
766105
Felix Geisendorfer has posted a quick code snippet for the CakePHP framework that returns an array of the controller names in your application.   It's something I've heard people asking for in IRC quite some times by now and since I just needed it again I thought I might as well publish it here. I hope somebody out there finds it useful.   The code uses a Folder instance to grab all of the controller paths and push them into a $controllers array.
458071
In his latest blog post, Chris Shiflett talks about CakePHP "visiting" New York at this month's NYPHP meeting as well of some of his impressions on the framework.    Last night at the monthly NYPHP meeting, Nate Abele presented an introduction to CakePHP, a web application framework. The New York subway wasn't cooperating with my schedule, and due to a problem affecting all uptown 4/5 trains, I was 30 minutes late to the talk.   Here are some of my notes from the talk as well as the conversation we had over dinner and drinks later.    He wonders about if the fact that Cake supports PHP4 hinders it, the scaffolding available, Ajax functionality, and, of course, some of the security features of the framework. He notes that "as long as you stick to the Cake way of generating output, it handles the escaping for you" - definitely a plus.
150071
On his blog today, Mike Lively has posted about the work h's done to create a database extension for the popular unit testing software for PHP, PHPUnit.   For those that may not have read any of my previous postings on the subject the goal of this software is to extend the functionality of PHPUnit to allow using seed data to put a given database into a known state prior to executing each test. It also provides an easy mechanism to compare database contents with an expected dataset.   Mike has just completed the initial feature set for his project - more or less a port of DBUnit over to PHP. The post includes not only details about this initial release but also code that demonstrates its use. In his example, it's used to validate that a bank account has been created properly by comparng database information before and after the insert.
45094
The Bakery has a new CakePHP tip posted today showing how to improve the unbindModel handling on the model side of things (versus in the controller as mentioned previously).   The problem with that solution is that it requires you to change the way you define your model relations. [...] Rather try to change your code to suit your needs, and let CakePHP do what it does best: act as a framework.   The technique approaches the associations differently - loaded and called when you make the call to expects() versus just automatically. They include the code to make it all work for an extension to the Model (AppModel), and extension to the AppModel (Title), and finally the TitlesController that shows the deliberate calls to expects to pull in the models.
257791
Felix GeisendÃ¶rfer has officially released the latest version of his Containable Behavior for the CakePHP framework:   Sorry I've taken so long to get a new version of my Containable Behavior released, but believe me I've not been slacking this time. [...] In fact I'm releasing the new version as a BETA right now since I'm still not 100% satisfied with the result and not all features have made it in yet, but I felt the need for iterating. However, the new version should be a big step up from this initial one and I hopefully bug free.   The post includes both the code for the new version of the behavior but also several examples on its use. Improvements in this new version include better performance, new function (containments), support for dynamic field containments and different field containments.