How to change frequency on CakePHP’s describe query
Posted on November 15th, 2008 in CakePHP, Php, Programming | 2 Comments »
By default if you set the debug to 0 in your core.php the frequency of executing a describe query is 999 days, but if your developing your application the duration is 10 sections, meaning every 10 sections it would ask your database to describe the tables that you need in your controller. To change the 10 sections to a higher value you could do this.
open configure.php in cake/libs/
locate the function __loadBootstrap
inside this function locate the following
if (Configure::read() >= 1) {
$duration = '+10 seconds';
} else {
$duration = '+999 days';
}
Change the ‘+10 seconds’ according to your requirement, say you want to describe a query every 1 minute, you would change it to
if (Configure::read() >= 1) {
$duration = '+1 minute';
} else {
$duration = '+999 days';
}
2 Responses
Thank you. SO. MUCH. FOR. THIS.
Describe queries are by far the longest part of cakePHP runtime.
Thanks a lot buddy.. I’ve been looking so long for this solution but there is nothing related to this in the cake book.