PageRenderTime 36ms CodeModel.GetById 11ms app.highlight 16ms RepoModel.GetById 1ms app.codeStats 1ms

/libs/Utility/Debugger.php

https://github.com/jplante815/meican
PHP | 726 lines | 437 code | 60 blank | 229 comment | 78 complexity | a4abf144536137a04e3a1fb1684efaef MD5 | raw file
  1<?php
  2/**
  3 * Framework debugging and PHP error-handling class
  4 *
  5 * Provides enhanced logging, stack traces, and rendering debug views
  6 *
  7 * PHP 5
  8 *
  9 * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
 10 * Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
 11 *
 12 * Licensed under The MIT License
 13 * Redistributions of files must retain the above copyright notice.
 14 *
 15 * @copyright     Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
 16 * @link          http://cakephp.org CakePHP(tm) Project
 17 * @package       Cake.Utility
 18 * @since         CakePHP(tm) v 1.2.4560
 19 * @license       MIT License (http://www.opensource.org/licenses/mit-license.php)
 20 */
 21
 22//App::uses('CakeLog', 'Log');
 23//App::uses('String', 'Utility');
 24include_once 'libs/Log/Log.php';
 25include_once 'libs/Utility/String.php';
 26
 27/**
 28 * Provide custom logging and error handling.
 29 *
 30 * Debugger overrides PHP's default error handling to provide stack traces and enhanced logging
 31 *
 32 * @package       Cake.Utility
 33 * @link          http://book.cakephp.org/2.0/en/development/debugging.html#debugger-class
 34 */
 35class Debugger {
 36
 37/**
 38 * A list of errors generated by the application.
 39 *
 40 * @var array
 41 */
 42	public $errors = array();
 43
 44/**
 45 * The current output format.
 46 *
 47 * @var string
 48 */
 49	protected $_outputFormat = 'js';
 50
 51/**
 52 * Templates used when generating trace or error strings.  Can be global or indexed by the format
 53 * value used in $_outputFormat.
 54 *
 55 * @var string
 56 */
 57	protected $_templates = array(
 58		'log' => array(
 59			'trace' => '{:reference} - {:path}, line {:line}',
 60			'error' => "{:error} ({:code}): {:description} in [{:file}, line {:line}]"
 61		),
 62		'js' => array(
 63			'error' => '',
 64			'info' => '',
 65			'trace' => '<pre class="stack-trace">{:trace}</pre>',
 66			'code' => '',
 67			'context' => '',
 68			'links' => array()
 69		),
 70		'html' => array(
 71			'trace' => '<pre class="cake-error trace"><b>Trace</b> <p>{:trace}</p></pre>',
 72			'context' => '<pre class="cake-error context"><b>Context</b> <p>{:context}</p></pre>'
 73		),
 74		'txt' => array(
 75			'error' => "{:error}: {:code} :: {:description} on line {:line} of {:path}\n{:info}",
 76			'code' => '',
 77			'info' => ''
 78		),
 79		'base' => array(
 80			'traceLine' => '{:reference} - {:path}, line {:line}',
 81			'trace' => "Trace:\n{:trace}\n",
 82			'context' => "Context:\n{:context}\n",
 83		),
 84		'log' => array(),
 85	);
 86
 87/**
 88 * Holds current output data when outputFormat is false.
 89 *
 90 * @var string
 91 */
 92	protected $_data = array();
 93
 94/**
 95 * Constructor.
 96 *
 97 */
 98	public function __construct() {
 99		$docRef = ini_get('docref_root');
100
101		if (empty($docRef) && function_exists('ini_set')) {
102			ini_set('docref_root', 'http://php.net/');
103		}
104		if (!defined('E_RECOVERABLE_ERROR')) {
105			define('E_RECOVERABLE_ERROR', 4096);
106		}
107
108		$e = '<pre class="cake-error">';
109		$e .= '<a href="javascript:void(0);" onclick="document.getElementById(\'{:id}-trace\')';
110		$e .= '.style.display = (document.getElementById(\'{:id}-trace\').style.display == ';
111		$e .= '\'none\' ? \'\' : \'none\');"><b>{:error}</b> ({:code})</a>: {:description} ';
112		$e .= '[<b>{:path}</b>, line <b>{:line}</b>]';
113
114		$e .= '<div id="{:id}-trace" class="cake-stack-trace" style="display: none;">';
115		$e .= '{:links}{:info}</div>';
116		$e .= '</pre>';
117		$this->_templates['js']['error'] = $e;
118
119		$t = '<div id="{:id}-trace" class="cake-stack-trace" style="display: none;">';
120		$t .= '{:context}{:code}{:trace}</div>';
121		$this->_templates['js']['info'] = $t;
122
123		$links = array();
124		$link = '<a href="javascript:void(0);" onclick="document.getElementById(\'{:id}-code\')';
125		$link .= '.style.display = (document.getElementById(\'{:id}-code\').style.display == ';
126		$link .= '\'none\' ? \'\' : \'none\')">Code</a>';
127		$links['code'] = $link;
128
129		$link = '<a href="javascript:void(0);" onclick="document.getElementById(\'{:id}-context\')';
130		$link .= '.style.display = (document.getElementById(\'{:id}-context\').style.display == ';
131		$link .= '\'none\' ? \'\' : \'none\')">Context</a>';
132		$links['context'] = $link;
133
134		$this->_templates['js']['links'] = $links;
135
136		$this->_templates['js']['context'] = '<pre id="{:id}-context" class="cake-context" ';
137		$this->_templates['js']['context'] .= 'style="display: none;">{:context}</pre>';
138
139		$this->_templates['js']['code'] = '<pre id="{:id}-code" class="cake-code-dump" ';
140		$this->_templates['js']['code'] .= 'style="display: none;">{:code}</pre>';
141
142		$e = '<pre class="cake-error"><b>{:error}</b> ({:code}) : {:description} ';
143		$e .= '[<b>{:path}</b>, line <b>{:line}]</b></pre>';
144		$this->_templates['html']['error'] = $e;
145
146		$this->_templates['html']['context'] = '<pre class="cake-context"><b>Context</b> ';
147		$this->_templates['html']['context'] .= '<p>{:context}</p></pre>';
148	}
149
150/**
151 * Returns a reference to the Debugger singleton object instance.
152 *
153 * @param string $class
154 * @return object
155 */
156	public static function &getInstance($class = null) {
157		static $instance = array();
158		if (!empty($class)) {
159			if (!$instance || strtolower($class) != strtolower(get_class($instance[0]))) {
160				$instance[0] = new $class();
161			}
162		}
163		if (!$instance) {
164			$instance[0] = new Debugger();
165		}
166		return $instance[0];
167	}
168
169/**
170 * Recursively formats and outputs the contents of the supplied variable.
171 *
172 *
173 * @param mixed $var the variable to dump
174 * @return void
175 * @see Debugger::exportVar()
176 * @link http://book.cakephp.org/2.0/en/development/debugging.html#Debugger::dump
177 */
178	public static function dump($var) {
179		pr(self::exportVar($var));
180	}
181
182/**
183 * Creates an entry in the log file.  The log entry will contain a stack trace from where it was called.
184 * as well as export the variable using exportVar. By default the log is written to the debug log.
185 *
186 * @param mixed $var Variable or content to log
187 * @param integer $level type of log to use. Defaults to LOG_DEBUG
188 * @return void
189 * @link http://book.cakephp.org/2.0/en/development/debugging.html#Debugger::log
190 */
191	public static function log($var, $level = LOG_DEBUG) {
192		$source = self::trace(array('start' => 1)) . "\n";
193		CakeLog::write($level, "\n" . $source . self::exportVar($var));
194	}
195
196/**
197 * Overrides PHP's default error handling.
198 *
199 * @param integer $code Code of error
200 * @param string $description Error description
201 * @param string $file File on which error occurred
202 * @param integer $line Line that triggered the error
203 * @param array $context Context
204 * @return boolean true if error was handled
205 * @deprecated This function is superseded by Debugger::outputError()
206 */
207	public static function showError($code, $description, $file = null, $line = null, $context = null) {
208		$_this = Debugger::getInstance();
209
210		if (empty($file)) {
211			$file = '[internal]';
212		}
213		if (empty($line)) {
214			$line = '??';
215		}
216		$path = self::trimPath($file);
217
218		$info = compact('code', 'description', 'file', 'line');
219		if (!in_array($info, $_this->errors)) {
220			$_this->errors[] = $info;
221		} else {
222			return;
223		}
224
225		switch ($code) {
226			case E_PARSE:
227			case E_ERROR:
228			case E_CORE_ERROR:
229			case E_COMPILE_ERROR:
230			case E_USER_ERROR:
231				$error = 'Fatal Error';
232				$level = LOG_ERROR;
233			break;
234			case E_WARNING:
235			case E_USER_WARNING:
236			case E_COMPILE_WARNING:
237			case E_RECOVERABLE_ERROR:
238				$error = 'Warning';
239				$level = LOG_WARNING;
240			break;
241			case E_NOTICE:
242			case E_USER_NOTICE:
243				$error = 'Notice';
244				$level = LOG_NOTICE;
245			break;
246			case E_DEPRECATED:
247			case E_USER_DEPRECATED:
248				$error = 'Deprecated';
249				$level = LOG_NOTICE;
250			break;
251			default:
252				return;
253			break;
254		}
255
256		$data = compact(
257			'level', 'error', 'code', 'description', 'file', 'path', 'line', 'context'
258		);
259		echo $_this->outputError($data);
260
261		if ($error == 'Fatal Error') {
262			exit();
263		}
264		return true;
265	}
266
267/**
268 * Outputs a stack trace based on the supplied options.
269 *
270 * ### Options
271 *
272 * - `depth` - The number of stack frames to return. Defaults to 999
273 * - `format` - The format you want the return.  Defaults to the currently selected format.  If
274 *    format is 'array' or 'points' the return will be an array.
275 * - `args` - Should arguments for functions be shown?  If true, the arguments for each method call
276 *   will be displayed.
277 * - `start` - The stack frame to start generating a trace from.  Defaults to 0
278 *
279 * @param array $options Format for outputting stack trace
280 * @return mixed Formatted stack trace
281 * @link http://book.cakephp.org/2.0/en/development/debugging.html#Debugger::trace
282 */
283	public static function trace($options = array()) {
284		$_this = Debugger::getInstance();
285		$defaults = array(
286			'depth'		=> 999,
287			'format'	=> $_this->_outputFormat,
288			'args'		=> false,
289			'start'		=> 0,
290			'scope'		=> null,
291			'exclude'	=> array('call_user_func_array', 'trigger_error')
292		);
293		$options = Set::merge($defaults, $options);
294
295		$backtrace = debug_backtrace();
296		$count = count($backtrace);
297		$back = array();
298
299		$_trace = array(
300			'line'     => '??',
301			'file'     => '[internal]',
302			'class'    => null,
303			'function' => '[main]'
304		);
305
306		for ($i = $options['start']; $i < $count && $i < $options['depth']; $i++) {
307			$trace = array_merge(array('file' => '[internal]', 'line' => '??'), $backtrace[$i]);
308			$signature = $reference = '[main]';
309
310			if (isset($backtrace[$i + 1])) {
311				$next = array_merge($_trace, $backtrace[$i + 1]);
312				$signature = $reference = $next['function'];
313
314				if (!empty($next['class'])) {
315					$signature = $next['class'] . '::' . $next['function'];
316					$reference = $signature . '(';
317					if ($options['args'] && isset($next['args'])) {
318						$args = array();
319						foreach ($next['args'] as $arg) {
320							$args[] = Debugger::exportVar($arg);
321						}
322						$reference .= join(', ', $args);
323					}
324					$reference .= ')';
325				}
326			}
327			if (in_array($signature, $options['exclude'])) {
328				continue;
329			}
330			if ($options['format'] == 'points' && $trace['file'] != '[internal]') {
331				$back[] = array('file' => $trace['file'], 'line' => $trace['line']);
332			} elseif ($options['format'] == 'array') {
333				$back[] = $trace;
334			} else {
335				if (isset($_this->_templates[$options['format']]['traceLine'])) {
336					$tpl = $_this->_templates[$options['format']]['traceLine'];
337				} else {
338					$tpl = $_this->_templates['base']['traceLine'];
339				}
340				$trace['path'] = self::trimPath($trace['file']);
341				$trace['reference'] = $reference;
342				unset($trace['object'], $trace['args']);
343				$back[] = String::insert($tpl, $trace, array('before' => '{:', 'after' => '}'));
344			}
345		}
346
347		if ($options['format'] == 'array' || $options['format'] == 'points') {
348			return $back;
349		}
350		return implode("\n", $back);
351	}
352
353/**
354 * Shortens file paths by replacing the application base path with 'APP', and the CakePHP core
355 * path with 'CORE'.
356 *
357 * @param string $path Path to shorten
358 * @return string Normalized path
359 */
360	public static function trimPath($path) {
361		if (!defined('CAKE_CORE_INCLUDE_PATH') || !defined('APP')) {
362			return $path;
363		}
364
365		if (strpos($path, APP) === 0) {
366			return str_replace(APP, 'APP' . DS, $path);
367		} elseif (strpos($path, CAKE_CORE_INCLUDE_PATH) === 0) {
368			return str_replace(CAKE_CORE_INCLUDE_PATH, 'CORE', $path);
369		} elseif (strpos($path, ROOT) === 0) {
370			return str_replace(ROOT, 'ROOT', $path);
371		}
372
373		if (strpos($path, CAKE) === 0) {
374			return str_replace($corePath, 'CORE' . DS, $path);
375		}
376		return $path;
377	}
378
379/**
380 * Grabs an excerpt from a file and highlights a given line of code.
381 *
382 * Usage:
383 *
384 * `Debugger::excerpt('/path/to/file', 100, 4);`
385 *
386 * The above would return an array of 8 items. The 4th item would be the provided line,
387 * and would be wrapped in `<span class="code-highlight"></span>`.  All of the lines
388 * are processed with highlight_string() as well, so they have basic PHP syntax highlighting
389 * applied.
390 *
391 * @param string $file Absolute path to a PHP file
392 * @param integer $line Line number to highlight
393 * @param integer $context Number of lines of context to extract above and below $line
394 * @return array Set of lines highlighted
395 * @see http://php.net/highlight_string
396 * @link http://book.cakephp.org/2.0/en/development/debugging.html#Debugger::excerpt
397 */
398	public static function excerpt($file, $line, $context = 2) {
399		$lines = array();
400		if (!file_exists($file)) {
401			return array();
402		}
403		$data = @explode("\n", file_get_contents($file));
404
405		if (empty($data) || !isset($data[$line])) {
406			return;
407		}
408		for ($i = $line - ($context + 1); $i < $line + $context; $i++) {
409			if (!isset($data[$i])) {
410				continue;
411			}
412			$string = str_replace(array("\r\n", "\n"), "", highlight_string($data[$i], true));
413			if ($i == $line) {
414				$lines[] = '<span class="code-highlight">' . $string . '</span>';
415			} else {
416				$lines[] = $string;
417			}
418		}
419		return $lines;
420	}
421
422/**
423 * Converts a variable to a string for debug output.
424 *
425 * *Note:* The following keys will have their contents replaced with
426 * `*****`:
427 *
428 *  - password
429 *  - login
430 *  - host
431 *  - database
432 *  - port
433 *  - prefix
434 *  - schema
435 *
436 * This is done to protect database credentials, which could be accidentally
437 * shown in an error message if CakePHP is deployed in development mode.
438 *
439 * @param string $var Variable to convert
440 * @param integer $recursion
441 * @return string Variable as a formatted string
442 * @link http://book.cakephp.org/2.0/en/development/debugging.html#Debugger::exportVar
443 */
444	public static function exportVar($var, $recursion = 0) {
445		switch (strtolower(gettype($var))) {
446			case 'boolean':
447				return ($var) ? 'true' : 'false';
448			break;
449			case 'integer':
450			case 'double':
451				return $var;
452			break;
453			case 'string':
454				if (trim($var) == "") {
455					return '""';
456				}
457				return '"' . h($var) . '"';
458			break;
459			case 'object':
460				return get_class($var) . "\n" . self::_object($var);
461			case 'array':
462				$var = array_merge($var,  array_intersect_key(array(
463					'password'	=> '*****',
464					'login'		=> '*****',
465					'host'		=> '*****',
466					'database'	=> '*****',
467					'port'		=> '*****',
468					'prefix'	=> '*****',
469					'schema'	=> '*****'
470				), $var));
471
472				$out = "array(";
473				$vars = array();
474				foreach ($var as $key => $val) {
475					if ($recursion >= 0) {
476						if (is_numeric($key)) {
477							$vars[] = "\n\t" . self::exportVar($val, $recursion - 1);
478						} else {
479							$vars[] = "\n\t" . self::exportVar($key, $recursion - 1)
480										. ' => ' . self::exportVar($val, $recursion - 1);
481						}
482					}
483				}
484				$n = null;
485				if (!empty($vars)) {
486					$n = "\n";
487				}
488				return $out . implode(",", $vars) . "{$n})";
489			break;
490			case 'resource':
491				return strtolower(gettype($var));
492			break;
493			case 'null':
494				return 'null';
495			break;
496		}
497	}
498
499/**
500 * Handles object to string conversion.
501 *
502 * @param string $var Object to convert
503 * @return string
504 * @see Debugger::exportVar()
505 */
506	protected static function _object($var) {
507		$out = array();
508
509		if (is_object($var)) {
510			$className = get_class($var);
511			$objectVars = get_object_vars($var);
512
513			foreach ($objectVars as $key => $value) {
514				if (is_object($value)) {
515					$value = get_class($value) . ' object';
516				} elseif (is_array($value)) {
517					$value = 'array';
518				} elseif ($value === null) {
519					$value = 'NULL';
520				} elseif (in_array(gettype($value), array('boolean', 'integer', 'double', 'string', 'array', 'resource'))) {
521					$value = Debugger::exportVar($value);
522				}
523				$out[] = "$className::$$key = " . $value;
524			}
525		}
526		return implode("\n", $out);
527	}
528
529/**
530 * Get/Set the output format for Debugger error rendering.
531 *
532 * @param string $format The format you want errors to be output as.
533 *   Leave null to get the current format.
534 * @return mixed Returns null when setting.  Returns the current format when getting.
535 * @throws CakeException when choosing a format that doesn't exist.
536 */
537	public static function outputAs($format = null) {
538		$self = Debugger::getInstance();
539		if ($format === null) {
540			return $self->_outputFormat;
541		}
542		if ($format !== false && !isset($self->_templates[$format])) {
543			throw new CakeException('Invalid Debugger output format.');
544		}
545		$self->_outputFormat = $format;
546	}
547
548/**
549 * Add an output format or update a format in Debugger.
550 *
551 * `Debugger::addFormat('custom', $data);`
552 *
553 * Where $data is an array of strings that use String::insert() variable
554 * replacement.  The template vars should be in a `{:id}` style.
555 * An error formatter can have the following keys:
556 *
557 * - 'error' - Used for the container for the error message. Gets the following template
558 *   variables: `id`, `error`, `code`, `description`, `path`, `line`, `links`, `info`
559 * - 'info' - A combination of `code`, `context` and `trace`. Will be set with
560 *   the contents of the other template keys.
561 * - 'trace' - The container for a stack trace. Gets the following template
562 *   variables: `trace`
563 * - 'context' - The container element for the context variables.
564 *   Gets the following templates: `id`, `context`
565 * - 'links' - An array of HTML links that are used for creating links to other resources.
566 *   Typically this is used to create javascript links to open other sections.
567 *   Link keys, are: `code`, `context`, `help`.  See the js output format for an
568 *   example.
569 * - 'traceLine' - Used for creating lines in the stacktrace. Gets the following
570 *   template variables: `reference`, `path`, `line`
571 *
572 * Alternatively if you want to use a custom callback to do all the formatting, you can use
573 * the callback key, and provide a callable:
574 *
575 * `Debugger::addFormat('custom', array('callback' => array($foo, 'outputError'));`
576 *
577 * The callback can expect two parameters.  The first is an array of all
578 * the error data. The second contains the formatted strings generated using
579 * the other template strings.  Keys like `info`, `links`, `code`, `context` and `trace`
580 * will be present depending on the other templates in the format type.
581 *
582 * @param string $format Format to use, including 'js' for JavaScript-enhanced HTML, 'html' for
583 *    straight HTML output, or 'txt' for unformatted text.
584 * @param array $strings Template strings, or a callback to be used for the output format.
585 * @return The resulting format string set.
586 */
587	public static function addFormat($format, array $strings) {
588		$self = Debugger::getInstance();
589		if (isset($self->_templates[$format])) {
590			if (isset($strings['links'])) {
591				$self->_templates[$format]['links'] = array_merge(
592					$self->_templates[$format]['links'],
593					$strings['links']
594				);
595				unset($strings['links']);
596			}
597			$self->_templates[$format] = array_merge($self->_templates[$format], $strings);
598		} else {
599			$self->_templates[$format] = $strings;
600		}
601		return $self->_templates[$format];
602	}
603
604/**
605 * Switches output format, updates format strings.
606 * Can be used to switch the active output format:
607 *
608 * @param string $format Format to use, including 'js' for JavaScript-enhanced HTML, 'html' for
609 *    straight HTML output, or 'txt' for unformatted text.
610 * @param array $strings Template strings to be used for the output format.
611 * @return string
612 * @deprecated Use Debugger::outputAs() and  Debugger::addFormat(). Will be removed
613 *   in 3.0
614 */
615	public function output($format = null, $strings = array()) {
616		$_this = Debugger::getInstance();
617		$data = null;
618
619		if (is_null($format)) {
620			return Debugger::outputAs();
621		}
622
623		if (!empty($strings)) {
624			return Debugger::addFormat($format, $strings);
625		}
626
627		if ($format === true && !empty($_this->_data)) {
628			$data = $_this->_data;
629			$_this->_data = array();
630			$format = false;
631		}
632		Debugger::outputAs($format);
633		return $data;
634	}
635
636/**
637 * Takes a processed array of data from an error and displays it in the chosen format.
638 *
639 * @param string $data
640 * @return void
641 */
642	public function outputError($data) {
643		$defaults = array(
644			'level' => 0,
645			'error' => 0,
646			'code' => 0,
647			'description' => '',
648			'file' => '',
649			'line' => 0,
650			'context' => array(),
651			'start' => 2,
652		);
653		$data += $defaults;
654
655		$files = $this->trace(array('start' => $data['start'], 'format' => 'points'));
656		$code = '';
657		if (isset($files[0]['file'])) {
658			$code = $this->excerpt($files[0]['file'], $files[0]['line'] - 1, 1);
659		}
660		$trace = $this->trace(array('start' => $data['start'], 'depth' => '20'));
661		$insertOpts = array('before' => '{:', 'after' => '}');
662		$context = array();
663		$links = array();
664		$info = '';
665
666		foreach ((array)$data['context'] as $var => $value) {
667			$context[] = "\${$var}\t=\t" . $this->exportVar($value, 1);
668		}
669
670		switch ($this->_outputFormat) {
671			case false:
672				$this->_data[] = compact('context', 'trace') + $data;
673				return;
674			case 'log':
675				$this->log(compact('context', 'trace') + $data);
676				return;
677		}
678
679		$data['trace'] = $trace;
680		$data['id'] = 'cakeErr' . uniqid();
681		$tpl = array_merge($this->_templates['base'], $this->_templates[$this->_outputFormat]);
682		$insert = array('context' => join("\n", $context)) + $data;
683
684		$detect = array('context');
685
686		if (isset($tpl['links'])) {
687			foreach ($tpl['links'] as $key => $val) {
688				if (in_array($key, $detect) && empty($insert[$key])) {
689					continue;
690				}
691				$links[$key] = String::insert($val, $insert, $insertOpts);
692			}
693		}
694
695		foreach (array('code', 'context', 'trace') as $key) {
696			if (empty($$key) || !isset($tpl[$key])) {
697				continue;
698			}
699			if (is_array($$key)) {
700				$$key = join("\n", $$key);
701			}
702			$info .= String::insert($tpl[$key], compact($key) + $insert, $insertOpts);
703		}
704		$links = join(' ', $links);
705		unset($data['context']);
706		if (isset($tpl['callback']) && is_callable($tpl['callback'])) {
707			return call_user_func($tpl['callback'], $data, compact('links', 'info'));
708		}
709		echo String::insert($tpl['error'], compact('links', 'info') + $data, $insertOpts);
710	}
711
712/**
713 * Verifies that the application's salt and cipher seed value has been changed from the default value.
714 *
715 * @return void
716 */
717	public static function checkSecurityKeys() {
718		if (Configure::read('Security.salt') == 'DYhG93b0qyJfIxfs2guVoUubWwvniR2G0FgaC9mi') {
719			trigger_error('Please change the value of \'Security.salt\' in app/Config/core.php to a salt value specific to your application', E_USER_NOTICE);
720		}
721
722		if (Configure::read('Security.cipherSeed') === '76859309657453542496749683645') {
723			trigger_error('Please change the value of \'Security.cipherSeed\' in app/Config/core.php to a numeric (digits only) seed value specific to your application', E_USER_NOTICE);
724		}
725	}
726}