Created
February 15, 2018 08:04
-
-
Save kamiazya/3864a6ef218f9cf4f914bc1288a8a610 to your computer and use it in GitHub Desktop.
CakePHP 2.x系でデバッグレベルを環境変数で操作する
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* CakePHP Debug Level: | |
* | |
* Production Mode: | |
* 0: No error messages, errors, or warnings shown. Flash messages redirect. | |
* | |
* Development Mode: | |
* 1: Errors and warnings shown, model caches refreshed, flash messages halted. | |
* 2: As in 1, but also with full debug messages and SQL output. | |
* | |
* In production mode, flash messages redirect after a time interval. | |
* In development mode, you need to click the flash message to continue. | |
*/ | |
if (env('PROD') === '1') { | |
Configure::write('debug', 1); | |
} else { | |
Configure::write('debug', 2); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment