本文整理汇总了PHP中debug::init方法的典型用法代码示例。如果您正苦于以下问题:PHP debug::init方法的具体用法?PHP debug::init怎么用?PHP debug::init使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类debug
的用法示例。
在下文中一共展示了debug::init方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
public static function init()
{
/*
* Zuordnung der Prozessart
* -> Unterscheidung zwischen CLI-
* und Browser-Aufruf
*/
self::$proc = "browser";
if (defined('STDIN')) {
self::$proc = "cli";
}
self::$config_file = ROOT_DIR . "etc/config.php";
if (!file_exists(self::$config_file)) {
throw new Exception("Konfigurations-Datei " . self::$config_file . " nicht gefunden!");
} else {
require_once self::$config_file;
}
/*
* Zuordnung der Konfigurations-Werte
*/
self::$debug = $debug;
self::$debug_file = $debug_file;
self::$web_root = $web_root;
self::$db_host = $db_host;
self::$db_name = $db_name;
self::$db_user = $db_user;
self::$db_pass = $db_pass;
debug::init();
// debug::add_info("(" . __FILE__ . ")<b>" . __CLASS__ . "</b>::" . __FUNCTION__ . "(): Konfigurations-Datei eingelesen.");
}
示例2: init
/**
* Configure the system and display the theme
*
* @param string $config_file Custom path to the config file
* @return void
*/
public static function init($config_file = '')
{
if (empty($config_file)) {
self::$config_file = __DIR__ . '/../config.php';
}
self::$error = new error();
self::$config = self::_get_config($config_file);
self::_check_config(self::$config);
self::set_vars(self::$config);
debug::init();
self::update_check();
theme::init();
theme::display();
}
示例3: run
/**
* Run application
*
* @param array $options
* string application_name
* string application_path
* string ini_folder
* boolean __run_only_bootstrap
* @throws Exception
*/
public static function run($options = [])
{
// fixing location paths
$application_path = isset($options['application_path']) ? rtrim($options['application_path'], '/') . '/' : '../application/';
$application_name = isset($options['application_name']) ? $options['application_name'] : 'default';
$ini_folder = isset($options['ini_folder']) ? rtrim($options['ini_folder'], '/') . '/' : $application_path . 'config/';
// working directory is location of the application
chdir($application_path);
$application_path_full = getcwd();
// setting include_path
$paths = [];
$paths[] = $application_path_full;
$paths[] = __DIR__;
$paths[] = str_replace('/numbers/framework', '', __DIR__);
set_include_path(implode(PATH_SEPARATOR, $paths));
// support functions
require "functions.php";
// load ini settings
self::$settings = system_config::load($ini_folder);
// special handling of media files for development, so there's no need to redeploy application
if (self::$settings['environment'] == 'development' && isset($_SERVER['REQUEST_URI'])) {
system_media::serve_media_if_exists($_SERVER['REQUEST_URI'], $application_path);
}
// we need to solve chicken and egg problem so we load cache first and then run application
//cache::create('php', array('type'=>'php', 'dir'=>'../application/cache'));
// setting variables
if (!isset(self::$settings['application']) || !is_array(self::$settings['application'])) {
self::$settings['application'] = [];
}
self::$settings['application']['name'] = $application_name;
self::$settings['application']['path'] = $application_path;
self::$settings['application']['path_full'] = $application_path_full . '/';
self::$settings['application']['loaded_classes'] = [];
// class paths
self::$settings['layout'] = [];
// layout settings
// flags
self::$settings['flag'] = isset(self::$settings['flag']) && is_array(self::$settings['flag']) ? self::$settings['flag'] : [];
self::$settings['flag']['global']['__run_only_bootstrap'] = !empty($options['__run_only_bootstrap']);
// magic variables processed here
self::$settings['flag']['global']['__content_type'] = 'text/html';
self::process_magic_variables();
// processing php settings
if (isset(self::$settings['php'])) {
foreach (self::$settings['php'] as $k => $v) {
if (is_array($v)) {
foreach ($v as $k2 => $v2) {
if (is_numeric($v2)) {
$v2 = $v2 * 1;
}
ini_set($k . '.' . $k2, $v2);
}
} else {
if (is_numeric($v)) {
$v = $v * 1;
}
ini_set($k, $v);
}
}
}
// Destructor
register_shutdown_function(array('bootstrap', 'destroy'));
// error handler first
error_base::init();
// debug after error handler
debug::init(self::get('debug'));
// Bootstrap Class
$bootstrap = new bootstrap();
$bootstrap_methods = get_class_methods($bootstrap);
foreach ($bootstrap_methods as $method) {
if (strpos($method, 'init') === 0) {
call_user_func(array($bootstrap, $method), $options);
}
}
// if we are calling application from the command line
if (!empty($options['__run_only_bootstrap'])) {
// dispatch before, in case if we open database connections in there
if (!empty(self::$settings['application']['dispatch']['before_controller'])) {
call_user_func(self::$settings['application']['dispatch']['before_controller']);
}
return;
}
// processing mvc settings
self::set_mvc();
// check if controller exists
if (!file_exists(self::$settings['mvc']['controller_file'])) {
throw new Exception('Resource not found!', -1);
}
// initialize the controller
$controller_class = self::$settings['mvc']['controller_class'];
//.........这里部分代码省略.........