當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Debugger::start方法代碼示例

本文整理匯總了PHP中Debugger::start方法的典型用法代碼示例。如果您正苦於以下問題:PHP Debugger::start方法的具體用法?PHP Debugger::start怎麽用?PHP Debugger::start使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Debugger的用法示例。


在下文中一共展示了Debugger::start方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: run

	/**
	 * The front controller only has one static method, `run()`, which
	 * 
	 */
	public static function run ($argv, $argc) {
		/**
		 * For compatibility with PHP 5.4's built-in web server, we bypass
		 * the front controller for requests with file extensions and
		 * return false.
		 */
		if (php_sapi_name () === 'cli-server' && isset ($_SERVER['REQUEST_URI']) && preg_match ('/\.[a-zA-Z0-9]+$/', parse_url ($_SERVER['REQUEST_URI'], PHP_URL_PATH))) {
			return false;
		}

		/**
		 * Normalize slashes for servers that are still poorly
		 * configured...
		 */
		if (get_magic_quotes_gpc ()) {
			function stripslashes_gpc (&$value) {
				$value = stripslashes ($value);
			}
			array_walk_recursive ($_GET, 'stripslashes_gpc');
			array_walk_recursive ($_POST, 'stripslashes_gpc');
			array_walk_recursive ($_COOKIE, 'stripslashes_gpc');
			array_walk_recursive ($_REQUEST, 'stripslashes_gpc');
		}

		/**
		 * Check ELEFANT_ENV environment variable to determine which
		 * configuration to load. Also include the Elefant version,
		 * autoloader, and core functions, and set the default
		 * timezone to avoid warnings in date functions.
		 */
		define ('ELEFANT_ENV', getenv ('ELEFANT_ENV') ? getenv ('ELEFANT_ENV') : 'config');
		require ('conf/version.php');
		require ('lib/Autoloader.php');
		require ('lib/Functions.php');
		date_default_timezone_set(conf ('General', 'timezone'));
		ini_set ('session.cookie_httponly', 1);
		ini_set ('session.use_only_cookies', 1);

		/**
		 * Set the default error reporting level to All except Notices,
		 * and turn off displaying errors. Error handling/debugging can
		 * be done by setting conf[General][debug] to true, causing full
		 * debug traces to be displayed with highlighted code in the
		 * browser (*for development purposes only*), or by checking
		 * the error log for errors.
		 */
		error_reporting (E_ALL & ~E_NOTICE);
		if (conf ('General', 'display_errors')) {
			ini_set ('display_errors', 'On');
		} else {
			ini_set ('display_errors', 'Off');
		}

		/**
		 * Enable the debugger if conf[General][debug] is true.
		 */
		require ('lib/Debugger.php');
		Debugger::start (conf ('General', 'debug'));

		/**
		 * Include the core libraries used by the front controller
		 * to dispatch and respond to requests.
		 */
		require ('lib/DB.php');
		require ('lib/Page.php');
		require ('lib/I18n.php');
		require ('lib/Controller.php');
		require ('lib/Template.php');
		require ('lib/View.php');

		/**
		 * If we're on the command line, set the request to use
		 * the first argument passed to the script.
		 */
		if (defined ('STDIN')) {
			$_SERVER['REQUEST_URI'] = '/' . $argv[1];
		}

		/**
		 * Initialize some core objects. These function as singletons
		 * because only one instance of them per request is desired
		 * (no duplicate execution for things like loading translation
		 * files).
		 */
		$i18n = new I18n ('lang', conf ('I18n'));
		$page = new Page;
		$controller = new Controller (conf ('Hooks'));
		$tpl = new Template (conf ('General', 'charset'), $controller);
		$controller->page ($page);
		$controller->i18n ($i18n);
		$controller->template ($tpl);
		View::init ($tpl);

		/**
		 * Check for a bootstrap.php file in the root of the site
		 * and if found, use it for additional app-level configurations
//.........這裏部分代碼省略.........
開發者ID:R-J,項目名稱:elefant,代碼行數:101,代碼來源:FrontController.php

示例2: define

 * Check ELEFANT_ENV environment variable to determine which
 * configuration to load. Also include the Elefant version,
 * autoloader, and core functions, and set the default
 * timezone to avoid warnings in date functions.
 */
define('ELEFANT_ENV', getenv('ELEFANT_ENV') ? getenv('ELEFANT_ENV') : 'config');
require 'conf/version.php';
require 'lib/Autoloader.php';
require 'lib/Functions.php';
date_default_timezone_set(conf('General', 'timezone'));
/**
 * Enable the debugger if conf[General][debug] is true.
 */
if (conf('General', 'debug')) {
    require 'lib/Debugger.php';
    Debugger::start();
}
/**
 * Include the core libraries used by the front controller
 * to dispatch and respond to requests.
 */
require 'lib/DB.php';
require 'lib/Page.php';
require 'lib/I18n.php';
require 'lib/Controller.php';
require 'lib/Template.php';
require 'lib/View.php';
/**
 * If we're on the command line, set the request to use
 * the first argument passed to the script.
 */
開發者ID:nathanieltite,項目名稱:elefant,代碼行數:31,代碼來源:index.php


注:本文中的Debugger::start方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。