| 12345 |
anikendra |
1 |
<?php
|
|
|
2 |
/**
|
|
|
3 |
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
|
|
4 |
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
|
|
5 |
*
|
|
|
6 |
* Licensed under The MIT License
|
|
|
7 |
* Redistributions of files must retain the above copyright notice.
|
|
|
8 |
*
|
|
|
9 |
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
|
|
10 |
* @link http://cakephp.org CakePHP(tm) Project
|
|
|
11 |
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
|
|
12 |
*
|
|
|
13 |
*/
|
|
|
14 |
|
|
|
15 |
App::uses('DebugPanel', 'DebugKit.Lib');
|
|
|
16 |
|
|
|
17 |
/**
|
|
|
18 |
* Provides information about your PHP and CakePHP environment to assist with debugging.
|
|
|
19 |
*
|
|
|
20 |
*/
|
|
|
21 |
class EnvironmentPanel extends DebugPanel {
|
|
|
22 |
|
|
|
23 |
/**
|
|
|
24 |
* beforeRender - Get necessary data about environment to pass back to controller
|
|
|
25 |
*
|
|
|
26 |
* @param Controller $controller
|
|
|
27 |
* @return array
|
|
|
28 |
*/
|
|
|
29 |
public function beforeRender(Controller $controller) {
|
|
|
30 |
parent::beforeRender($controller);
|
|
|
31 |
|
|
|
32 |
$return = array();
|
|
|
33 |
|
|
|
34 |
// PHP Data
|
|
|
35 |
$phpVer = phpversion();
|
|
|
36 |
$return['php'] = array_merge(array('PHP_VERSION' => $phpVer), $_SERVER);
|
|
|
37 |
unset($return['php']['argv']);
|
|
|
38 |
|
|
|
39 |
// CakePHP Data
|
|
|
40 |
$return['cake'] = array(
|
|
|
41 |
'APP' => APP,
|
|
|
42 |
'APP_DIR' => APP_DIR,
|
|
|
43 |
'APPLIBS' => APPLIBS,
|
|
|
44 |
'CACHE' => CACHE,
|
|
|
45 |
'CAKE' => CAKE,
|
|
|
46 |
'CAKE_CORE_INCLUDE_PATH' => CAKE_CORE_INCLUDE_PATH,
|
|
|
47 |
'CORE_PATH' => CORE_PATH,
|
|
|
48 |
'CAKE_VERSION' => Configure::version(),
|
|
|
49 |
'CSS' => CSS,
|
|
|
50 |
'CSS_URL' => CSS_URL,
|
|
|
51 |
'DS' => DS,
|
|
|
52 |
'FULL_BASE_URL' => FULL_BASE_URL,
|
|
|
53 |
'IMAGES' => IMAGES,
|
|
|
54 |
'IMAGES_URL' => IMAGES_URL,
|
|
|
55 |
'JS' => JS,
|
|
|
56 |
'JS_URL' => JS_URL,
|
|
|
57 |
'LOGS' => LOGS,
|
|
|
58 |
'ROOT' => ROOT,
|
|
|
59 |
'TESTS' => TESTS,
|
|
|
60 |
'TMP' => TMP,
|
|
|
61 |
'VENDORS' => VENDORS,
|
|
|
62 |
'WEBROOT_DIR' => WEBROOT_DIR,
|
|
|
63 |
'WWW_ROOT' => WWW_ROOT
|
|
|
64 |
);
|
|
|
65 |
|
|
|
66 |
$cakeConstants = array_fill_keys(
|
|
|
67 |
array(
|
|
|
68 |
'DS', 'ROOT', 'FULL_BASE_URL', 'TIME_START', 'SECOND', 'MINUTE', 'HOUR', 'DAY', 'WEEK', 'MONTH', 'YEAR',
|
|
|
69 |
'LOG_ERROR', 'FULL_BASE_URL'
|
|
|
70 |
), ''
|
|
|
71 |
);
|
|
|
72 |
$var = get_defined_constants(true);
|
|
|
73 |
$return['app'] = array_diff_key($var['user'], $return['cake'], $cakeConstants);
|
|
|
74 |
|
|
|
75 |
if (isset($var['hidef'])) {
|
|
|
76 |
$return['hidef'] = $var['hidef'];
|
|
|
77 |
}
|
|
|
78 |
|
|
|
79 |
return $return;
|
|
|
80 |
}
|
|
|
81 |
}
|