FilChi Weblog

Posts Tagged ‘PHP frameworks


Two days before this is posted on this blog, I encountered an issue with the sessions in cakephp on my personal cakephp project. I felt frustrated when I realized that the sessions do not load when logging in.

Read the rest of this entry »


Yes, cakephp lovers may now download an 1.2 RC1 versionĀ  at http://cakephp.org/downloads.

I can’t wait to try it out its newest features and learn which are removed from previous versions and which areĀ  newly added.


If it happens to you that when you add a new record when scaffolding in cakephp 1.2 beta version, check if your mysql version is 5.1 or later, and check in my.ini of your mysql server and remove that “STRICT_TRANS_TABLES” setting, and then your cake scaffold will work just fine.

(source: http://groups.google.fr/group/cake-php/browse_thread/thread/a0b1a35c1909d5db )

Note: I think this is just a temporary fix. I was informed in irc that this bug is already fixed. It is advisable to get the latest code thru svn.


If you want to call a controller/action in crontab, you simply must:

1. create a copy of index.php in your app’s webroot directory,
and rename it to cron_dispatcher.php or to any filename.

2. after this, somewhere in line 78 of index.php of your app’s webroot directory,

require CORE_PATH . ‘cake’ . DS . ‘bootstrap.php’;

put code:

if($argc == 2) {
$Dispatcher= new Dispatcher();
$Dispatcher->dispatch($argv[1]);
}

this code will get argument from php commandline having index = 1.

so, in your crontab,

* * * * php -q /var/www/html/cake/webroot/cron_dispatcher.php Controller/action


In CakePHP 1.2 beta version, when you attempt to use/set Sessions in app/config/core.php, you might encounter this problem:

Fatal error: Class ‘ConnectionManager’ not found in CORE/cake/libs/session.php on line 704.

When I tried changing these settings:

Configure::write(‘Session.save’, ‘database’);
Configure::write(‘Session.table’, ‘cake_sessions’);
Configure::write(‘Session.database’, ‘default’);
Configure::write(‘Session.start’, false);

The error appears.


Flickr Photos