当前位置: 首页>>代码示例>>PHP>>正文


PHP static::debug方法代码示例

本文整理汇总了PHP中static::debug方法的典型用法代码示例。如果您正苦于以下问题:PHP static::debug方法的具体用法?PHP static::debug怎么用?PHP static::debug使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在static的用法示例。


在下文中一共展示了static::debug方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: instance

 public static function instance()
 {
     if (!self::$instance) {
         self::$instance = static::load();
         if (!defined('GANTRY5_DEBUG')) {
             define('GANTRY5_DEBUG', self::$instance->debug());
         }
     }
     return self::$instance;
 }
开发者ID:legutierr,项目名称:gantry5,代码行数:10,代码来源:Gantry.php

示例2: setup

 /**
  * Setup a map of environments to their patterns and optionally debug environments
  *
  * @param array $map
  * @param array $debug	[= []]
  * @access public
  * @return void
  * @static
  */
 public static function setup(array $map, array $debug = [])
 {
     array_change_key_case($map, CASE_LOWER);
     static::$map = $map;
     if (!empty($debug)) {
         static::$debug = $debug;
     }
 }
开发者ID:datingvip,项目名称:utils,代码行数:17,代码来源:Env.php

示例3: isTestsDebug

 public static function isTestsDebug()
 {
     if (null === static::$debug) {
         $debug = getenv('SYMFONY_TESTS_DEBUG');
         if (false === $debug) {
             static::$debug = true;
         } else {
             static::$debug = filter_var($debug, FILTER_VALIDATE_BOOLEAN);
         }
     }
     return static::$debug;
 }
开发者ID:intaro,项目名称:symfony-testing-tools,代码行数:12,代码来源:WebTestCase.php

示例4: connect

 public static function connect()
 {
     // config
     $params = Config::get('database');
     // set debug mode
     static::$debug = Config::get('debug', false);
     // build dns string
     $dsn = 'mysql:dbname=' . $params['name'] . ';host=' . $params['host'];
     // try connection
     static::$dbh = new PDO($dsn, $params['username'], $params['password']);
     // set error handling to exceptions
     static::$dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
     return true;
 }
开发者ID:reqshark,项目名称:anchor-cms,代码行数:14,代码来源:db.php

示例5: createApplication

 /**
  * 初始化:创建Application
  * @access public
  * @param array $config设置
  */
 public static function createApplication($config = NULL)
 {
     if ($config === NULL) {
         throw new SYException('Configuration is required', '10001');
     } elseif (is_string($config)) {
         if (is_file($config)) {
             $config = (require $config);
         } else {
             throw new SYException('Config file ' . $config . ' not exists', '10002');
         }
     } elseif (!is_array($config)) {
         throw new SYException('Config can not be recognised', '10003');
     }
     //框架所在的绝对路径
     static::$frameworkDir = SY_ROOT;
     static::$rootDir = rtrim(str_replace('\\', '/', realpath(SY_ROOT . '../')), '/') . '/';
     //程序相对网站根目录所在
     $now = $_SERVER['PHP_SELF'];
     $dir = str_replace('\\', '/', dirname($now));
     $dir !== '/' && ($dir = rtrim($dir, '/') . '/');
     static::$siteDir = $dir;
     //网站根目录
     static::$webrootDir = substr(static::$rootDir, 0, strlen(static::$rootDir) - strlen(static::$siteDir)) . '/';
     //基本信息
     $config['cookie']['path'] = str_replace('@app/', $dir, $config['cookie']['path']);
     static::$app = $config;
     //应用的绝对路径
     static::$appDir = rtrim(str_replace('\\', '/', realpath(SY_ROOT . $config['dir'])), '/') . '/';
     if (isset($config['debug'])) {
         static::$debug = $config['debug'];
     }
     mb_internal_encoding($config['charset']);
     //是否启用CSRF验证
     if ($config['csrf']) {
         \sy\lib\YSecurity::csrfSetCookie();
     }
     //加载App的基本函数
     if (is_file(static::$appDir . 'common.php')) {
         require static::$appDir . 'common.php';
     }
     //开始路由分发
     static::router();
 }
开发者ID:sm115,项目名称:SYFramework,代码行数:48,代码来源:BaseSY.php

示例6: init

 public static function init()
 {
     static::$debug = ini_get('display_errors') ? true : false;
     // stop if there's already an error
     if ($error = error_get_last()) {
         terror::error($error['message'], $error['type'], $error['file'], $error['line']);
     }
     /*
     // switch off conventional error reporting…
     error_reporting(0);
     
     // …to run our own
     ini_set('display_errors', 0);
     */
     // set a global error handler
     set_error_handler(array('Terror', 'errorHandler'));
     // track fatal errors
     register_shutdown_function(array('Terror', 'shutdownHandler'));
     // catch all uncaugth exceptions
     set_exception_handler(array('Terror', 'exceptionHandler'));
 }
开发者ID:chrishiam,项目名称:LVSL,代码行数:21,代码来源:terror.php

示例7: _init

 /**
  * Method: _init
  * Sets the Errorlevel based on the Configfile
  */
 public static function _init()
 {
     if (Config::getVal('error', 'debug') != 1) {
         static::$debug = true;
     }
     switch (Config::getVal('error', 'level')) {
         case 'notice':
             static::$error_level = E_NOTICE;
             break;
         case 'warning':
             static::$error_level = E_WARNING & ~E_NOTICE;
             break;
         case 'error':
             static::$error_level = E_ERROR;
             break;
         case 'all':
             static::$error_level = E_ALL & ~E_DEPRECATED & ~E_NOTICE & ~E_WARNING;
             break;
         default:
             static::$error_level = E_ALL & ~E_DEPRECATED & ~E_NOTICE & ~E_WARNING;
             break;
     }
 }
开发者ID:Necrotex,项目名称:dioxid,代码行数:27,代码来源:ErrorHandler.php

示例8: connect

 public static function connect()
 {
     // config
     $params = Config::get('database');
     // set default mysql port number
     if (empty($params['port'])) {
         $params['port'] = 3306;
     }
     // set default collation
     if (empty($params['collation'])) {
         $params['collation'] = 'utf8_bin';
     }
     // set debug mode
     static::$debug = Config::get('debug', false);
     // build dns string
     $dsn = 'mysql:dbname=' . $params['name'] . ';host=' . $params['host'] . ';port=' . $params['port'];
     // mysql driver options
     $options = array(PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES \'UTF8\' COLLATE ' . $params['collation']);
     // try connection
     static::$dbh = new PDO($dsn, $params['username'], $params['password'], $options);
     // set error handling to exceptions
     static::$dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
     return true;
 }
开发者ID:nathggns,项目名称:anchor-cms,代码行数:24,代码来源:db.php

示例9: setDebug

 /**
  * Controls whether Annotations are efficiently cached on the file system or not.
  *
  * @param $debug
  */
 public static function setDebug($debug)
 {
     // Need to recreate the instace.
     static::$instance = null;
     static::$debug = $debug;
 }
开发者ID:TippingCanoe,项目名称:mocking-jay,代码行数:11,代码来源:MockingJay.php

示例10: debug

 /**
  * @param null|bool $bool
  * @return bool
  */
 public static function debug($bool = null)
 {
     return is_bool($bool) ? static::$debug = $bool : static::$debug;
 }
开发者ID:mightydes,项目名称:enjoin,代码行数:8,代码来源:Enjoin.php

示例11: __construct

 public function __construct()
 {
     $this->model = $this->getModel();
     if (InputHelper::handleInput("debug", false) !== false) {
         static::$debug = true;
     }
 }
开发者ID:LyntServices,项目名称:php-opencart-xml-feed-generator,代码行数:7,代码来源:XmlGenerator.php

示例12: init

 public static function init($db, $userID = "", $debug = false)
 {
     static::$db = $db;
     static::$userID = $userID;
     static::$debug = $debug;
 }
开发者ID:torokp,项目名称:uorm,代码行数:6,代码来源:uorm.lib.php

示例13: setDebug

 /**
  * Sets the debug flag
  *
  * @static
  * @param bool $value
  */
 public static function setDebug($value)
 {
     static::$debug = (bool) $value;
 }
开发者ID:chrismcmacken,项目名称:phptools,代码行数:10,代码来源:Logger.php

示例14: debug

 /**
  * Debug mode switch
  */
 public function debug($switch = true)
 {
     static::$debug = (bool) $switch;
     return $this->trace();
 }
开发者ID:acidline,项目名称:rocket,代码行数:8,代码来源:Kernel.php

示例15: parse

 /**
  * Parse a MPQ file
  *
  * @param  string  $filename
  * @param  boolean $autoparse
  * @param  integer $debug
  * @return void
  */
 public static function parse($filename, $autoparse = true, $debug = 0)
 {
     $obj = new static();
     $obj->filename = $filename;
     $obj->debug = $debug;
     if (!$obj::$cryptTable) {
         $obj::initCryptTable();
     }
     if (file_exists($obj->filename)) {
         $fp = fopen($obj->filename, 'rb');
         $contents = fread($fp, filesize($obj->filename));
         if ($obj->debug && $contents === false) {
             $obj->debug("Error opening file {$filename} for reading");
         }
         if ($contents !== false) {
             $obj->fileData = $contents;
         }
         fclose($fp);
     }
     if ($autoparse) {
         $obj->parseHeader();
     }
     return $obj;
 }
开发者ID:braseidon,项目名称:Heroes.Replayer,代码行数:32,代码来源:MPQFile.php


注:本文中的static::debug方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。