Softpedia
 

NEWS CATEGORIES:



NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
Home > News > Webmaster > Tips and Tricks

September 14th, 2007, 14:04 GMT · By Adrian Placinta

Configuration of core.php for CakePHP

SHARE:

Adjust text size:



Enlarge picture
In my latest article you learned how to configure the database for CakePHP. Now I will show you how to configure global CakePHP. Global configuration file of CakePHP can be found in cakeappconfigcore.php. From here, you can change debug level, cache checking, session cookie, session timeout, level of security and a lot more other
settings.

If you have mod_rewrite enabled and you still want CakePHP urls, delete .htaccess files, but if you don't have mod_rewrite enabled and you want to use CakePHP urls, uncomment the lines:
release/.htaccess
release/app/.htaccess
release/app/webroot/.htaccess

There are 4 levels of debug: 0-production, 1- development, 2- full debug with sql and 3- full debug with sql and dump of the current object. Specifying this setting to a non-zero value will force Cake to print out the results of pr( ) and debug( ) function calls, and stop flash messages from forwarding automatically. In production, the "flash messages" redirect after a time interval. With the other debug levels you get to click the "flash message" to continue. For example, if you want to set the debug level to "full debug with sql", the line should look like this: define('DEBUG', 2);

To change the cookie level of security, change the following line: define('CAKE_SECURITY', 'high'); "High" level means that sessions time out after 10 minutes of inactivity, and session IDs are regenerated on each request, in "medium" sessions time out after 20 minutes of inactivity and in "low" sessions time out after 30 minutes of inactivity. I recommend setting the level to high. To set cookie session timeout, change the value from this line: define('CAKE_SESSION_TIMEOUT', '120');. Session timeout depends on the security level of the cookie. If CAKE_SECURITY define is set high: multiplied by 10, medium: is multiplied by 100, low is: multiplied by 300.

These are the important parameters from the configuration file. Enjoy!
FILED UNDER:
CakePHP
PHP framework

TELL US WHAT YOU THINK:

23,455 hits · 1 comment · Link to this article · Print article · Send to friend · Subscribe to news

MUST-READ RELATED ARTICLES:


CakePHP - PHP development framework

Installation and Database Configuration of CakePHP

READER COMMENTS:


Comment #1 by: sagar on 17 Jul 2009, 08:28 UTC reply to this comment

very well explained !!! keep up the good work

Copyright © 2001-2012 Softpedia. Contact/Tip us at

WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM