NEWS CATEGORIES:



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

Tips and Tricks


Configuration of core.php for CakePHP

Debug level, cookies, everything

By Adrian Placinta, Web News Editor

14th of September 2007, 14:04 GMT

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!

TAGS:

CakePHP | PHP framework
Read by 12,130 user(s) | Add comment | Link to this article TWEET THIS


Article rating:
Good (3.3/5) 13 vote(s)    

Subscribe to news | Print article | Send to friend

© Copyright 2001-2010 Softpedia
Contact:

 

 

SEARCH THE NEWS ARCHIVE :




Today's News
| Yesterday's News | News Archive


MORE RELATED ARTICLES:


CakePHP - PHP development framework

Installation and Database Configuration of CakePHP

User opinions:


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

very well explained !!! keep up the good work

Share your opinion:

Your Name:
Your Email Address:
(will not be used for commercial purposes)
Solve this to prove you're not a bot: =
Your review/opinion:

 




Windows tabGames tabDrivers tabMac tabLinux tabScripts tabMobile tabHandheld tabGadgets tabNews tab

SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   ENTER NEWS SITE   |   ENGLISH BOARD   |   ROMANIAN FORUM