#6136: Shell bootstrap (cake.php) overwrites existing debug setting
-------------------------------------------+--------------------------------
Reporter: andyfowler | Type: RFC
Status: new | Priority: Medium
Milestone: 1.2.x.x | Component: Shells
Version: 1.2 Final | Severity: Normal
Keywords: console, shell, cli, debug | Php_version: n/a
Cake_version: 1.2.1.8004 |
-------------------------------------------+--------------------------------
Cake will ignore any existing values for debug (
`Configure::write('debug', 2)` ) when running any shell script. This may
make sense for an interactive shell, but for debugging queries, it's very
awkward to generate a query log.
Because DboSource checks debug value in construct(), enabling query
logging in a shell requires more than just resetting debug's value:
{{{
$db =& ConnectionManager::getDataSource('default');
$db->fullDebug = true;
}}}
This is caused by cake.php:262, where _bootstrap() overwrites the existing
debug setting.
= Possible solutions: =
* Generate a warning when overwriting an existing debug setting. (maybe
only if debug == 2)
* Find a better way to spit out query logs from a shell, so we don't even
need this override.
* Move this override from cake.php to core Shell::initialize so that it
can be overridden by custom shells. (I think this is my favored solution).
* Take a few deep breaths after hunting this down for an hour. The
frustrating part is that debug can be changed silently, and it took me 30
minutes with Xdebug to find it. :)
--
Ticket URL: <https://trac.cakephp.org/ticket/6136>
CakePHP : The Rapid Development Framework for PHP <https://trac.cakephp.org/>
Cake is a rapid development framework for PHP which uses commonly known design
patterns like ActiveRecord, Association Data Mapping, Front Controller and MVC.
Our primary goal is to provide a structured framework that enables PHP users at
all levels to rapidly develop robust web applications, without any loss to
flexibility.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"tickets cakephp" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/tickets-cakephp?hl=en
-~----------~----~----~----~------~----~------~--~---