PHP-Coding-Practices.com: How Table Migrations In CakePHP 1.2 Can Save Your Life
618701
On PHP-Coding-Practices.com, Tim Koschuetzki has posted a new tutorial that just might save your life - well, at least the life of your CakePHP application - using table migrations.   Migrations are a wonderful technique to keep your database in sync with your code. When working on a project as a team, migrations can save your life. Please join me and get a quick introduction to migrations in CakePHP and become a happier coder.   He starts by explaining what migrations are (yml files that contain database construction/destruction information), how to execute them in your application, and how to construct your own.
698334
Popular posts from PHPDeveloper.org for the past week:The Bakery: Six New Articles/Tutorials PostedEvert Pot's Blog: PHP: Arrays vs. ObjectsDevArticles: Learning AJAXInternet Super Hero: PHP: mysqli_fetch_all()David Coallier's Blog: PHP Namespaces (Part 1: Basic usage & gotchas)I/O Reader: 15 Cool Things & 12 Things to Dislike About PHPProPHP Podcast: Newscast - August 16, 2007PHPBuilder.com: Dynamic XML with PHPSite News: Popular Posts for the Week of 08.17.2007PRADO Watch Blog: PRADO Watch: Interview With Timani Tunduwani - Why I Moved From CakePHP to PRADO
193310
Here's what was popular in the PHP community one year ago today:onPHP5.com: Clickable, Obfuscated Email AddressesJacob Santos' Blog: PHP BlackjackThe Bakery: RESTful Web Services With CakePHPDeveloper.com: Developing a Ajax-driven Shopping Cart with PHP and PrototypeGreg Beaver's Blog: Mac OS X ships with security hole-laden PEAR - how to upgrade immediatelyNexen.net: English Articles and a Single Distribution ResourceJob Posting: Red Ventures Seeks Several LAMP Developers (Charlotte, NC)The Bakery: Checking for duplicate records (unique record)DevShed: The Basics of Abstract Factory Classes in PHP 5NewsForge.com: A DIY calendar control in PHPDevGuide.net: Dynamic Bitmap Graphics with PHP and GDRichard Heyes' Blog: Browser DetectionInternational PHP Magazine: Poll Question: Which is the Most Important Feature of PHP 5?Builder.au: Dynamic XML document construction with the PHP DOMCommunity News: PEAR Version 1.5.0 Released
567879
On DevShed today there's a new tutorial showing a method for preventing SQL injection attacks on your site - a MySQL table prefix changer.   Changing these [table] prefixes can be a tedious job if you had to do it manually. Even tools like phpMyAdmin don't provide a clean, quick method of doing this. But with a little help from PHP, we are able to create our own tool very quickly.   The tutorial follows the construction of the tool, making the modifications to the current database tables and pushing all of the changes back into the database.
385236
Scott Mattocks is back with the latest installment of the PHP-GTK news, issue number 22.   It's been a while, but I finally have some time to get back to summing up the world of PHP-GTK. Things have slowed down a little in the past few months on the development side but that doesn't mean that the world of PHP-GTK 2 has stood still.   In this edition, there's a call for help for anyone that would want to join the other (4!) developers in working on the PHP-GTK 2 project as well as some general information about the project and its involvement in the community - from talks at php/db|works, International PHP Conference, and the Zend/PHP Conference to the many PHP-GTK-related articles being printed to a new online resource for PHP-GTK tutorials.
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.
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.
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.
732440
The International PHP Magazine has posted results from their latest PHP community poll as voted on by visitors to their site. The question for this poll asked developers what they thought, of the choices on the list, was the most common mistake that PHP developers make.   Coming in at number one by an overwhelming lead was "Not escaping entities and SQL input" (a definite problem indeed) with the next highest option, "Not using a Framework" a full twenty percent lower. The next two options were closer (descending) - "Using old PHP versions" and "No or little use of Object Orientation".   There's a new poll this week for your consideration - this time asking which stage, of the five options, should come first in the development cycle of a typical content management system. Head on over and cast your vote today!
108040
Felix Geisendorfer has a new post today showing off an example of his screencasting abilities. Specifically, the video looks at using vendor branching to keep your CakePHP installation up to date.   So here I go with my very first screencast to be published. The topic is how to use vendor branching with CakePHP which is one of many ways to keep your CakePHP version up to date.   The video is 15(ish) minutes long and covers, from start to finish, the process of grabbing the latest CakePHP build from the subversion repository and install it automatically to your system.   As a plus, Felix also includes links to the software he used to make the screencast for those that are curious.
67063
Chris Hartjes has posted about a new resource that he "cannot stop recommending people to use [it] when searching for answers to their CakePHP problems" - the CakePHP Cookbook.   With a ton of help from Andy Dawson (AD7Six) the documentation for CakePHP 1.2 has moved forward immensely with the unveiling of the CakePHP Cookbook. It's a combination of manual and wiki, where people can flesh out the manual and make comments on the methods in there.   With the wiki in place, anyone can add to the communal CakePHP wisdom (or correct where others might have strayed) to make it a bigger and better resource for the whole range of CakePHP developers.
622401
The International PHP Magazine has posted results from their latest poll conducted over this past week asking which, of their given options, is the best helpful hint for creating a web application in PHP.   Two of the options ranked higher than the rest with one (Page/object caching) coming out on top of the other (Don't save performance testing for the end of the project). The remainder of the votes were divided pretty evenly between the last three options: "Use multi result set queries to your database", "gzip compression", and "Tune your web server".   While you're in the polling mood, you should check out this week's new poll that wonders which of their options might be the biggest hindrance to PHP5's adoption in the community.
715490
On the Sanisoft blog today, there's a quick tutorial demonstrating how to create a multilingual application with the CakePHP framework:   There are basic two ways to creating a multilingual app in traditional PHP [...] CakePHP V1.2 is the framework which allows you to take the quantum leap of using gettext like functionality with minimum of hassles and at the same time address the common problems which a PHP programmer faces while creating multilingual apps.   They give an example of a simple translation of a sentence (including working with .po files). They show how to integrate the example string, create the .po file with the translation and configure the language to pull the correct phrasing to display to the page.
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
676788
Andreas Gohr has posted about a script he's created to act as a simple replacement for the PHP/MySQL database tool phpMyAdmin - what he calls MySimple.php.   Kaddi needed to fix something in her employer's database today. Unfortunately she had FTP access only. So the database change had to be made through a PHP script. [...] I looked for a basic MySQL PHP interface but couldn't find one. So I quickly wrote it my self.   He has a screenshot of the app in action included and you can grab the code from his wiki.
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.
267028
In the new blog entry, Jonathan Snook shows how to implement "conditional content" on your CakePHP application.   I finally got around to implementing conditional content here on Snook.ca. I've wanted to do this since I moved to the new design just over a month and a half ago. [...] With a little bit of late night development and some quick help from Larry (aka PhpNut, the lead developer of CakePHP), I've developed what I have dubbed "Elemental".   In his example he shows the two parts making up the functionality - the controller with new methods (in app_controller.php) and a new helper called "Elemental". Using the methods enableElement and disableElement you can turn off and on different chunks of code that are stored in an element array.