loadsys / CakePHP-ConfigReadShell

A CakePHP plugin that provides a Shell to read an app's Configure vars from the command line.
MIT License
3 stars 0 forks source link

Config Read Shell Doesn't Seem to Properly Get the Debug Setting From the Config file #2

Closed justinyost closed 9 years ago

justinyost commented 9 years ago

Using this command ./bin/cake config_read.config_read debug And running this grep -i "Configure::write('debug'" ./Config/* produces two different results

Screenshot included of the issue. screen shot 2015-01-16 at 3 47 48 pm

beporter commented 9 years ago

This one is probably because I set debug=0 in the shell's main() to prevent spurious terminal output that would interfere with var capture. Might need to figure out a special case for this.

On Jan 16, 2015, at 5:49 PM, Justin Yost notifications@github.com wrote:

Using this command ./bin/cake config_read.config_read debug And running this grep -i "Configure::write('debug'" ./Config/* produces two different results

Screenshot included of the issue.

— Reply to this email directly or view it on GitHub.

beporter commented 9 years ago

We have two choices the way I see it:

  1. Cache the real value of debug to a class property in a new ::initialize() method, then force debug off. We'll have to add a check specifically for if the key is debug and return the cached value instead.
  2. Just remove the Config::write(debug, 0) altogether and let the chips fall as they may.

I'm leaning towards 2.