Felix Geisendorfer has posted a new more helpful hints to the Debuggable blog for the CakePHP developers out there. Here's the most recent:
Check out their PHP and CakePHP category on the blog for more great articles and tips.
![]() |
|||||
|
|||||
Sections
![]()
Recent Jobs
News Archive
|
Debuggable Blog: More CakePHP Tips/Behaviors September 02, 2008 @ 12:04:03
Felix Geisendorfer has posted a new more helpful hints to the Debuggable blog for the CakePHP developers out there. Here's the most recent: Check out their PHP and CakePHP category on the blog for more great articles and tips.
Jonathan Snook's Blog: Multiple Validation as Behavior in CakePHP 1.2 July 31, 2008 @ 08:44:30
Jonathan Snook has posted an update to a previous post about validating multiple input fields at the same time in a CakePHP application. This update changes the way the validation is handled and moves it over into a Behavior. Using the new behavior is much like using the script as it was before. You can name the validation properties to include the action name and it'll automatically set that validation set as the default. His behavior lets you define validation rules, both included in a default set and as callbacks. He includes an example of its use and the full code (all thirty lines of it) for the behavior itself.
Blog.szajbe.pl: Not so obvious behavior of $uses in CakePHP July 09, 2008 @ 12:02:41
In this new post to the blog.szajbe.pl site a dilemma is presented - CakePHP models are not working they way one would think they should. In CakePHP you declare what models you're going to use in a controller by defining $uses variable. You can also define it in AppController to have a certain set of models available in every controller. However be careful when doing it because you may put yourself in an unexpected situation as I did recently. As soon as he made his script include a 'User' model in every quest, his logins stopped working. His script errored with a "Database table sessions for model Session was not found" message and refused to work. Digging deeper, he found that CakePHP merges an AppController's $uses value with the SessionControler's values. One overrides the other and your 'User' gets lost in the shuffle. Do you have a rational explanation for such behavior? I have none. It's very unintuitive for me.
Padraic Brady's Blog: PHPMutagen Mutation Testing for PHP5 December 05, 2007 @ 09:32:00
In another behavior-driven development related post on his blog, Padraic Brady talks about mutation testing and a library he's put together to support it in PHP - PHPMutagen. As I said in my previous entry I was thinking about how to write a Mutation Testing engine. The "braindump" was to use PHP's built in Tokenizer to break down a class file into digestible pieces which could be mutated, and then reconstructed into a mutated file. Once you allow for a working copy of the original source (let's not mutate the original!) it turned out to be a reasonable approach. He's not releasing it just yet ("don't get too excited until I find some time to scan through it again") but he does share some sample output from his test run - one instance where all is well and the other where one mutant "escapes" and causes an exception.
Sanisoft.com: Attach & detach behaviors at run-time in CakePHP Models June 26, 2007 @ 12:38:00
The guys over on Sanisoft.com dropped us a line today to let us know about a new entry on their blog showing how to implement attach and detach behaviors in CakePHP models. Behaviors are one of the best things that have been added to CakePHP 1.2, they allow you to add functionality to your models in a very elegant and modular fashion. They also promote a lot of code reuse. Perhaps a real life example would illustrate it better. They show how to create behaviors that can perform a save() call on an image with the backend code doing all the hard work. They create the two methods - dontActAs and nowActsAs - to make attaching and detaching simple.
Felix Geisendörfer's Blog: Containable 2.0 BETA June 14, 2007 @ 10:39:00
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.
Felix Geisendorfer's Blog: Bringing the cold war to CakePHP 1.2 - The Containable Behavior May 14, 2007 @ 10:56:00
Felix Geisendorfer is sharing a bit of his CakePHP knowledge with us today with this new post to his blog. It shines a spotlight on a feature of the framework - a behavior called "Containable". For those of you who can't await this, here comes a little teaser in form of a behavior for Cake 1.2 called 'Containable'. Essentially it is yet another way to unbind associations from a model recursively on the fly. However, I think it's more powerful then all the ones released so far. He lists his reasons (it's smart, it's for the lazy, etc) for using it before getting into a code example showing how, with the help of a bit of extra code) to make an object that can make making associations simple.
Paul Jones' Blog: New PDO Behavior In PHP 5.2.1 February 28, 2007 @ 08:29:00
http://www.phpdeveloper.org/form/view/type/addnews PHPDeveloper.org: PHP News, Views, and Community In a new post Paul Jones points out some of the new behaviors that the extension is showing in the latest of the PHP 5 seres (version 5.2). He starts with a code example that would work with a previous version of PHP/PDO that would allow for the binding of a single value to multiple places in the SQL statement. But: Sadly, this is no longer the case in PHP 5.2.1. For valid reasons of security and stability in memory handling, as noted to me by Wez Furlong, the above behavior is no longer supported. That is, you cannot bind a single parameter or value to multiple identical placeholders in a statement. If you try it, PDO will throw an exception or raise an error, and will not execute the query. In short, you now need to match exactly the number of bound parameters or values with the number of placeholders. Unfortunately, this is used quite often in Paul's Solar framework, so an update to the Solar_Sql_Adapter::query() method has had to been made to allow for the binding of multiple items automatically. It works by incrementing the bind location (like ":foo") with numbers at the end - simple and effective - and you can still pass an array to it and have it automagically work.
SitePoint PHP Blog: The next hot PHP app you install might be IBM's November 01, 2006 @ 11:48:00
Harry Fuecks talks, in this new post on the SitePoint PHP Blog, about some of the advancements being made with the Zend Framework and the QEDWiki setup. The idea of application wikis and situational applications has a lot of potential IMO. If you consider Dokuwiki (tends to get mentioned round here) for example, its interesting that a number of users have employed it as an alternative to a CMS-it gives you more structure than most wiki's thanks to things like namespaces but is far more flexible than your average CMS. Harry also mentions some of the plugins included (behavior syntax and Ajax chat) and recommends developers keep an eye on these new introductions by IBM to the world of PHP.
Ryan Malesevich's Blog: Fight Spam Comments with Bad Behavior and Akismet September 07, 2006 @ 07:16:58
Ryan points out a handy tool to help keep even more spammers from making their way to your blogs and posting comments - Bad Behavior.
Luckily, it's also made for Wordpress, so you can download and install directly with no fuss. He comments that he's already seeing results with even more caught than Akismet was before. |
Community Events
Don't see your event here? Let us know! |
|||
|
conference PEAR releases example developer release cakephp application database security mysql package book code job ajax zendframework framework PHP5 zend |
|||||
| All content copyright, 2008 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework | |||||