1//lib/Cake/View/Elements/sql_dump.ctp
23<?php
4/**
5 * SQL Dump element. Dumps out SQL log information
6 *
7 * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
8 * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
9 *
10 * Licensed under The MIT License
11 * For full copyright and license information, please see the LICENSE.txt
12 * Redistributions of files must retain the above copyright notice.
13 *
14 * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
15 * @link http://cakephp.org CakePHP(tm) Project
16 * @package Cake.View.Elements
17 * @since CakePHP(tm) v 1.3
18 * @license http://www.opensource.org/licenses/mit-license.php MIT License
19 */
2021if (!class_exists('ConnectionManager') || Configure::read('debug') < 2) {
22 return false; ←ここでDebuglevelが2より小さいと表示を行わないことが分かる
23}
24$noLogs = !isset($sqlLogs);
25if ($noLogs):
26 $sources = ConnectionManager::sourceList();
2728 $sqlLogs = array();
29 foreach ($sources as $source):
30 $db = ConnectionManager::getDataSource($source);
31 if (!method_exists($db, 'getLog')):
32 continue;
33 endif;
34 $sqlLogs[$source] = $db->getLog();
35 endforeach;
36endif;
なので、商用稼働時はcore.phpの設定を変更してください
CakePHP
1//app/Config/core.php
2/**
3 * CakePHP Debug Level:
4 *
5 * Production Mode:
6 * 0: No error messages, errors, or warnings shown. Flash messages redirect.
7 *
8 * Development Mode:
9 * 1: Errors and warnings shown, model caches refreshed, flash messages halted.
10 * 2: As in 1, but also with full debug messages and SQL output.
11 *
12 * In production mode, flash messages redirect after a time interval.
13 * In development mode, you need to click the flash message to continue.
14 */
15 Configure::write('debug', 2);←この値を商用稼働時は0にする
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2016/08/31 11:30