public static function enableProfiler($status = true) { self::$_profilerEnabled = $status; if (!$status) { return; } require_once MagentoDebugger::getProjectDir() . '/lib/Varien/Profiler.php'; //require_once(self::getDebuggerDir() . '/libs/Varien/Profiler.php'); Varien_Profiler::enable(); $serverKey = MagentoDebugger::getKeyFromString(isset($_SERVER['SERVER_NAME']) ? $_SERVER['SERVER_NAME'] : 'console'); $time = time(); self::$_uniqId = $time . '_' . uniqid(); self::$_jsonLog = MagentoDebugger::getDebuggerVarDir() . '/profiler/' . $serverKey . '.' . self::$_uniqId; $url = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : 'Not specified'; $profilerHeader = array('time' => $time, 'url' => $url, 'key' => self::$_uniqId); file_put_contents(self::$_jsonLog . '.jshe', json_encode($profilerHeader)); }
if ($_GET['magento_debug'] == 'message' && isset($_POST['message'])) { $file = MagentoDebugger::getDebuggerVarDir() . '/ajax-console.log'; file_put_contents($file, $_POST['message'] . "\n", FILE_APPEND); return; } if ($_GET['magento_debug'] == 'model' && isset($_GET['magento_debug_model_method'])) { $modelMethodName = $_GET['magento_debug_model_method']; header('Content-Type: text/plain'); require_once MagentoDebugger::getDebuggerDir() . '/libs/Debugger/model.php'; } if ($_GET['magento_debug'] == 'maillist' && isset($_GET['magento_debug_action'])) { require_once MagentoDebugger::getDebuggerDir() . '/libs/Debugger/mails.php'; } if ($_GET['magento_debug'] == 'profiler' && isset($_GET['magento_debug_action'])) { require_once MagentoDebugger::getDebuggerDir() . '/libs/Debugger/profiler.php'; } if ($_GET['magento_debug'] == 'mysql' && isset($_GET['magento_debug_action'])) { require_once MagentoDebugger::getDebuggerDir() . '/libs/Debugger/mysql.php'; } return; } // Profiler if (isset($_COOKIE['magento_debug_profiler']) && $_COOKIE['magento_debug_profiler'] == 'yes') { MagentoDebugger::enableProfiler(); } //$_SERVER['MAGE_IS_DEVELOPER_MODE'] = true; //ini_set('display_errors', 1); chdir(MagentoDebugger::getProjectDir()); require_once 'index.php'; MagentoDebugger::saveConfiguration(); MagentoDebugger::saveProfiler();