本文整理汇总了PHP中Debug::debug方法的典型用法代码示例。如果您正苦于以下问题:PHP Debug::debug方法的具体用法?PHP Debug::debug怎么用?PHP Debug::debug使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Debug
的用法示例。
在下文中一共展示了Debug::debug方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: debug
/**
* Debug reporting
*
* @param bool $debug
* @return null
*/
public static function debug($debug = true)
{
if (is_bool($debug)) {
self::$debug = $debug;
}
return new self();
}
示例2: __destruct
public function __destruct()
{
Debug::debug('DefaultAdapter __destruct');
}
示例3: dirname
<?php
include dirname(dirname(__FILE__)) . '/src/Debug.php';
//Catch all
Debug::register();
Debug::debug(false);
//true = show erros; false hide errors
//generate error "Use of undefined constant a - assumed 'a'"
a;
//Count errors
if (Debug::count() > 0) {
echo "Sorry, this code have a error. ";
} else {
echo "This code is beautiful!";
}
示例4: rmBalancedFile
/**
*
* @param string $psFile
* @param string $psPath
*/
public static function rmBalancedFile($psFile, $psPath)
{
$lsFileDir = self::getBalancedDir($psFile, $psPath);
$lsFileDir = realpath(CLIENT_DIR . DS . $lsFileDir);
if (file_exists($lsFileDir . DS . $psFile)) {
Debug::debug('rm ' . $lsFileDir . DS . $psFile);
self::removeFile($lsFileDir . DS . $psFile);
} else {
Debug::debug($lsFileDir . $psFile . ' not found.');
}
}
示例5: stdin
public function stdin($buf)
{
Debug::debug(Debug::exportBytes($buf));
$this->buf .= $buf;
start:
if ($this->state === 0) {
while (($l = $this->gets()) !== FALSE) {
$e = explode(' ', rtrim($l, "\r\n"));
if ($e[0] == 'VALUE') {
$this->key = $e[1];
$this->valueFlags = $e[2];
$this->valueLength = $e[3];
$this->result = '';
$this->state = 1;
break;
} elseif ($e[0] == 'STAT') {
if ($this->result === NULL) {
$this->result = array();
}
$this->result[$e[1]] = $e[2];
} elseif ($e[0] === 'STORED' || $e[0] === 'END' || $e[0] === 'DELETED' || $e[0] === 'ERROR' || $e[0] === 'CLIENT_ERROR' || $e[0] === 'SERVER_ERROR') {
if ($e[0] !== 'END') {
$this->result = FALSE;
$this->error = isset($e[1]) ? $e[1] : NULL;
}
$cb = array_shift($this->callbacks);
if ($cb) {
call_user_func($cb, $this);
}
$this->valueSize = 0;
$this->result = NULL;
}
}
}
if ($this->state === 1) {
if ($this->valueSize < $this->valueLength) {
$n = $this->valueLength - $this->valueSize;
$buflen = strlen($this->buf);
if ($buflen > $n) {
$this->result .= binarySubstr($this->buf, 0, $n);
$this->buf = binarySubstr($this->buf, $n);
} else {
$this->result .= $this->buf;
$n = $buflen;
$this->buf = '';
}
$this->valueSize += $n;
if ($this->valueSize >= $this->valueLength) {
$this->state = 0;
goto start;
}
}
}
}