本文整理汇总了PHP中DBG::fileskiplength方法的典型用法代码示例。如果您正苦于以下问题:PHP DBG::fileskiplength方法的具体用法?PHP DBG::fileskiplength怎么用?PHP DBG::fileskiplength使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DBG
的用法示例。
在下文中一共展示了DBG::fileskiplength方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: activate
/**
* Activates debugging according to the bits given in $mode
*
* See the constants defined early in this file.
* An empty $mode defaults to
* DBG_ALL & ~DBG_LOG_FILE & ~DBG_LOG_FIREPHP
* @param integer $mode The optional debugging mode bits
*/
public static function activate($mode = null)
{
if (!self::$fileskiplength) {
self::$fileskiplength = strlen(dirname(dirname(dirname(dirname(__FILE__))))) + 1;
}
$oldMode = self::$mode;
if (self::$mode === DBG_NONE) {
// activate DBG_LOG by default
self::$mode = DBG_LOG;
}
if ($mode === DBG_NONE) {
self::$mode = DBG_NONE;
} elseif ($mode === null) {
self::$mode = self::$mode | DBG_ALL & ~DBG_LOG_FILE & ~DBG_LOG_FIREPHP;
} else {
self::$mode = self::$mode | $mode;
}
self::__internal__setup();
if ($mode !== DBG_NONE) {
if ($oldMode === DBG_NONE) {
self::log('DBG enabled (' . self::getActivatedFlagsAsString() . ')');
self::stack();
} else {
self::log('DBG mode changed (' . self::getActivatedFlagsAsString() . ')');
}
}
}
示例2: activate
/**
* Activates debugging according to the bits given in $mode
*
* See the constants defined early in this file.
* An empty $mode defaults to
* DBG_ALL & ~DBG_LOG_FILE & ~DBG_LOG_FIREPHP
* @param integer $mode The optional debugging mode bits
*/
public static function activate($mode = null)
{
if (!self::$fileskiplength) {
self::$fileskiplength = strlen(dirname(dirname(dirname(dirname(__FILE__))))) + 1;
}
if ($mode === DBG_NONE) {
self::$mode = DBG_NONE;
} elseif ($mode === null) {
self::$mode = DBG_ALL & ~DBG_LOG_FILE & ~DBG_LOG_FIREPHP | DBG_LOG;
} else {
self::$mode = self::$mode | $mode | DBG_LOG;
}
self::__internal__setup();
}