public static function run() { session(C("SESSION_OPTIONS")); self::loadEventClass(); event("APP_START"); DEBUG and Debug::start("APP_START"); self::start(); DEBUG and Debug::show("APP_START", "APP_END"); Log::save(); event("APP_END"); }
public static function run() { self::loadEventClass(); event("APP_START"); DEBUG and Debug::start("APP_START"); self::init(); self::start(); DEBUG and Debug::show("APP_START", "APP_END"); Log::save(); event("APP_END"); }
/** * 运行应用 * @access public * @reutrn mixed */ public static function run() { //session处理 session(C("SESSION_OPTIONS")); //加载应用与事件处理类 self::loadEventClass(); //执行应用开始事件 event("APP_START"); //Debug Start DEBUG and Debug::start("APP_START"); self::start(); //Debug End DEBUG and Debug::show("APP_START", "APP_END"); //日志记录 Log::save(); event("APP_END"); }
/** * 运行应用 * @access public * @reutrn mixed */ public static function run() { event("APP_START"); //Debug Start DEBUG and Debug::start("APP_START"); self::init(); self::start(); //Debug End if (DEBUG) { if (!C("DEBUG_AJAX") && IS_AJAX || !C("DEBUG_SHOW")) { } else { Debug::show("APP_START", "APP_END"); } } //日志记录 Log::save(); event("APP_END"); }
/** * 运行应用 * @access public * @reutrn mixed */ public static function run() { //session处理 session(C("SESSION_OPTIONS")); //执行应用开始钓子 Hook::listen("APP_INIT"); //执行应用开始钓子 Hook::listen("APP_BEGIN"); //Debug Start DEBUG and Debug::start("APP_BEGIN"); self::start(); //Debug End DEBUG and Debug::show("APP_BEGIN", "APP_END"); //日志记录 !DEBUG and C('LOG_RECORD') and Log::save(); //应用结束钓子 Hook::listen("APP_END"); }
<?php if (!defined('__ROOT__')) { exit('Sorry,Please from entry!'); } /** * init 入口引入文件 * 项目自动初始化文件 * 创建时间:2014-08-08 14:56 PGF */ Loader::core('Debug'); //加载DEBUG类 Debug::start(); //程序开始 Loader::func('Base'); //加载基础全局函数 Loader::core('Cache'); //加载缓存处理类 Cache::init(); //初始化缓存类 //向日志中添加已经加载的Loader Debug::add(__ROOT__ . Config::config('core_dir') . '/bases/' . 'Loader.class.php', 1); Loader::core('Router'); //加载Router Router::run(); //Router运行 Debug::stop(); //程序结束 //==================== END Initialize.php ========================//
public static function start() { self::$start = microtime(); }
/** * 应用执行入口 * * @return void */ public static function run($controller = '', $action = '', $debug_info = true) { if ($debug_info) { Debug::start(); } //初始化实例参数 self::init(); if (!empty($controller)) { self::$controller_name = ucfirst($controller); } else { self::$controller_name = ucfirst(!self::in('c') ? self::$config['cotroller_default'] : strtolower(self::in('c'))); } if (!empty($action)) { self::$action_name = $action; } else { self::$action_name = !self::in('a') ? self::$config['action_default'] : self::in('a'); } /** 运行逻辑模型 **/ try { self::$output->setControllerName(self::$controller_name); self::$output->setActionName(self::$action_name); $controller = self::getInstance(self::$controller_name . 'Controller'); $before_result = true; if (method_exists($controller, '_beforeAction')) { $before_result = $controller->_beforeAction(self::$controller_name, self::$action_name); } if ($before_result) { $controller->{self::$action_name}(); } if (method_exists($controller, '_afterAction')) { $controller->_afterAction(self::$controller_name, self::$action_name); } } catch (AppException $e) { //throw $e ; header('HTTP/1.1 404 Not found'); exit('Path not exists. ' . self::$controller_name . '/' . self::$action_name); } /** 进行输出处理 **/ //self::finish(); if ($debug_info) { Debug::over(); } }
exit; } require_once "dbconnect.php"; require_once "WFO.php"; require_once "User.php"; require_once "Facture.php"; require_once "Client.php"; require_once "File.php"; require_once "FileTransaction.php"; require_once "TabStrip.php"; require_once "gettext.php"; require_once "Debug.php"; $_SESSION['debug'] = WF_DEBUG; if (WF_DEBUG_ALL) { $debug = new Debug($_SERVER['DOCUMENT_ROOT'] . '/../logs/debug.log'); $debug->start(); } if (WF_DEBUG) { $mt_start = getMicroTime(); } function GetCompanyInfo() { // Get my company info (address...) $result = mysql_query('SELECT value ' . 'FROM webfinance_pref ' . "WHERE type_pref='societe' AND owner=-1"); if (mysql_num_rows($result) != 1) { die(_("You didn't setup your company address and name. " . "<a href='../admin/societe'>Go to 'Admin' and " . "'My company'</a>")); } list($value) = mysql_fetch_array($result); mysql_free_result($result); return unserialize(base64_decode($value)); }
} function debugingPos() { //$tmp = debug_backtrace(2, 2)[1]; $tmp = debug_backtrace(); $pos = $tmp[1]; if (isset($pos['class'])) { echo "{$pos['class']}->{$pos['function']} <br>\n"; } else { echo "{$pos['function']}(): {$pos['file']} . (line:{$pos['line']})<br>\n"; } } /** * DEBUG */ isset($_GET['DEBUG']) && Debug::start(); class Debug { static $start_time = null; static function start() { self::$start_time = microtime(true); if (function_exists('xhprof_enable')) { xhprof_enable(XHPROF_FLAGS_CPU + XHPROF_FLAGS_MEMORY); } ob_start(function ($buf) { return self::getMsg() . $buf; }); } static function getMsg() {