Recent Posts
- (09/10) Fixing Warning: the ECDSA host key for 'github.com' differs from the key for the IP addressTAGS:Web Server Admin
- (12/26) CakePHP 3 - Getting List of Column Definitions from a Table (like schema())TAGS:CakephpCake3
- (09/14) Change Order of Loaded Behaviors in CakePHP 3TAGS:Cake3CakephpWeb ProgrammingPhp
- (05/29) CakePHP 3 - Accept JSON Header Only Working When Debug FalseTAGS:Web ProgrammingCakephpCake3
- (05/23) Remove All Events from Google Calendar (Reset Calendar)TAGS:Web ProgrammingPhp
- (11/08) Google Tag Manager (GTM) Not Firing Default PageView EventTAGS:Web ProgrammingJavascriptGoogle Tag Manager
- (10/13) In PHP, how do you get __toString() Magic Method Result without calling echo?TAGS:CakephpCake3Cakephp 13PhpWeb Programming
- (11/14) Getting output from shell_exec() at all timesTAGS:Web ProgrammingWeb Server Admin
Subscribe to my feed
MainelyDesign.com Blog
Upgrading CakePHP Application to 1.3 (from 1.2)
Posted on 09/27/2010 at 09:33 pm by Kevin Wentworth
Viewed 14,353 times | 2 comments
I've been waiting to publish a completed article until after I was done with my upgrade to CakePHP 1.3. Well, it's taking a while. I'm not blaming the CakePHP upgrade from 1.2 to 1.3 for taking so long. I'm actually doing several large-scale changes to my code base, my server and my repository structure. Until that time, I'm going to publish some notes I've been making for this article.
CakePHP $form->create() ID Renames
Huge Gotcha! We depend on the ID of the form to perform CSS transformations and several jquery functions depend on the form ID. What's changed? Two things I've noticed:
- There is no default form ID of ModelNameEditForm. Instead, it WILL ALWAYS BE ModelNameActionForm
- Additionally, on prefix routes (i.e. admin-side), forms take on the ID of ModelNamePrefixActionForm (this one messed up some jquery)
Cache Config and Prefix
Cache::config needed a prefix set to '' otherwise it would only delete files beginning with 'cake_'. This is new behavior in that before, with no prefix set/specified it would delete all files. This left my scratching my head for a while.
Session Flash
If you have $session->flash();, you need to echo $session->flash();.
Router::Connect() alias now needs TWO routes
Huge change to controller aliasing via routes! After much thought and some discussion (I finally got on IRC...) I came to the realization that two routes are needed to have /controller/ route to /alias/ with ALL actions (including default/index).
Themed is now Theme! Yay!
Changing /theme/ to /theme/ for static assets (LINK TO this post). I only had to update every reference in my database to /theme/
Function Renames
Changing $model->del() to $model->delete. Same with $session->del(), $folder->ls().
$text->truncate() is now an array of options:
Instead of this: $summary = $text->truncate($clean_summary, 350, '...', false, true);
It will be this: $summary = $text->truncate($clean_summary, 350, array('exact'=>false, 'html'=>true));
Modifying a page title in the view?
I used to use $this->set('title', 'New Page Title');. Now you need to use $this->set('title_for_layout', 'New Page Title');
There will be more,
-Kevin Wentworth
Tags for Upgrading CakePHP Application to 1.3 (from 1.2)
Comments for this Posting
Posted by Kevin Wentworth
on 17/11/10
I sure did. No hard statistics, but performance definitely improved.
Sorry, comments are closed for this posting.
Please Email Kevin if you have any questions. Thanks!
Posted by Ian
on 10/11/10
Did you find any performance improvement with switching to 1.3?