本文整理汇总了PHP中Debug::warningHandler方法的典型用法代码示例。如果您正苦于以下问题:PHP Debug::warningHandler方法的具体用法?PHP Debug::warningHandler怎么用?PHP Debug::warningHandler使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Debug
的用法示例。
在下文中一共展示了Debug::warningHandler方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: fetchArticles
public function fetchArticles()
{
try {
$list = HailApi::getArticlesByTag($this->HailID);
} catch (HailApiException $ex) {
Debug::warningHandler(E_WARNING, $ex->getMessage(), $ex->getFile(), $ex->getLine(), $ex->getTrace());
return;
}
$hailIdList = array();
foreach ($list as $hailData) {
// Build up Hail ID list
$hailIdList[] = $hailData->id;
// Check if we can find an existing item.
$hailObj = HailArticle::get()->filter(array('HailID' => $hailData->id))->First();
if (!$hailObj) {
$hailObj = new HailArticle();
}
$hailObj->importHailData($hailData);
$this->Articles()->add($hailObj);
}
$this->Articles()->exclude('HailID', $hailIdList)->removeAll();
}
示例2: errorHandler
function errorHandler($errno, $errstr, $errfile, $errline, $errcontext)
{
switch ($errno) {
case E_ERROR:
case E_CORE_ERROR:
case E_USER_ERROR:
Debug::fatalHandler($errno, $errstr, $errfile, $errline, $errcontext);
break;
case E_WARNING:
case E_CORE_WARNING:
case E_USER_WARNING:
Debug::warningHandler($errno, $errstr, $errfile, $errline, $errcontext);
break;
}
}
示例3: fetchVideos
/**
* Fetch the video gallery of this article from the Hail API
*
* @return void
*/
public function fetchVideos()
{
try {
$list = HailApi::getVideosByArticles($this->HailID);
} catch (HailApiException $ex) {
Debug::warningHandler(E_WARNING, $ex->getMessage(), $ex->getFile(), $ex->getLine(), $ex->getTrace());
return;
}
$hailIdList = array();
foreach ($list as $hailData) {
// Build up Hail ID list
$hailIdList[] = $hailData->id;
// Check if we can find an existing item.
$hailObj = HailVideo::get()->filter(array('HailID' => $hailData->id))->First();
if (!$hailObj) {
$hailObj = new HailVideo();
}
$hailObj->importHailData($hailData);
$this->VideoGallery()->add($hailObj);
}
// Remove images that are no longer assign to this article
if ($hailIdList) {
$this->VideoGallery()->exclude('HailID', $hailIdList)->removeAll();
} else {
$this->VideoGallery()->removeAll();
}
}
示例4: refresh
/**
* Retrieves the latest version of this object whatever it's outdated or not.
*
* @return HailApiObject
*/
public function refresh()
{
if ($this->ID && $this->HailID) {
try {
$data = HailApi::getOne(static::getObjectType(), $this->HailID);
} catch (HailApiException $ex) {
Debug::warningHandler(E_WARNING, $ex->getMessage(), $ex->getFile(), $ex->getLine(), $ex->getTrace());
return $this;
}
$this->importHailData($data);
$this->refreshing();
}
return $this;
}
示例5: errorHandler
/**
* Generic callback to catch standard PHP runtime errors thrown by the interpreter
* or manually triggered with the user_error function.
* Caution: The error levels default to E_ALL is the site is in dev-mode (set in main.php).
*
* @ignore
* @param int $errno
* @param string $errstr
* @param string $errfile
* @param int $errline
*/
function errorHandler($errno, $errstr, $errfile, $errline)
{
switch ($errno) {
case E_ERROR:
case E_CORE_ERROR:
case E_USER_ERROR:
return Debug::fatalHandler($errno, $errstr, $errfile, $errline, debug_backtrace());
case E_WARNING:
case E_CORE_WARNING:
case E_USER_WARNING:
return Debug::warningHandler($errno, $errstr, $errfile, $errline, debug_backtrace());
case E_NOTICE:
case E_USER_NOTICE:
case E_DEPRECATED:
case E_USER_DEPRECATED:
case E_STRICT:
return Debug::noticeHandler($errno, $errstr, $errfile, $errline, debug_backtrace());
}
}
示例6: errorHandler
/**
* Generic callback to catch standard PHP runtime errors thrown by the interpreter
* or manually triggered with the user_error function.
* Caution: The error levels default to E_ALL is the site is in dev-mode (set in main.php).
*
* @ignore
* @param int $errno
* @param string $errstr
* @param string $errfile
* @param int $errline
*/
function errorHandler($errno, $errstr, $errfile, $errline)
{
switch ($errno) {
case E_ERROR:
case E_CORE_ERROR:
case E_USER_ERROR:
Debug::fatalHandler($errno, $errstr, $errfile, $errline, null);
break;
case E_WARNING:
case E_CORE_WARNING:
case E_USER_WARNING:
Debug::warningHandler($errno, $errstr, $errfile, $errline, null);
break;
case E_NOTICE:
case E_USER_NOTICE:
case E_DEPRECATED:
case E_USER_DEPRECATED:
case E_STRICT:
Debug::noticeHandler($errno, $errstr, $errfile, $errline, null);
break;
}
}
示例7: error_handler
/**
* Generic callback to catch standard PHP runtime errors thrown by the interpreter
* or manually triggered with the user_error function.
* Caution: The error levels default to E_ALL is the site is in dev-mode (set in main.php).
*
* @ignore
* @param int $errno
* @param string $errstr
* @param string $errfile
* @param int $errline
*/
public static function error_handler($errno, $errstr, $errfile, $errline)
{
switch ($errno) {
case E_ERROR:
case E_CORE_ERROR:
case E_USER_ERROR:
StaticPagesQueue::has_error(self::$current_url, $errstr);
Debug::fatalHandler($errno, $errstr, $errfile, $errline, null);
break;
case E_WARNING:
case E_CORE_WARNING:
case E_USER_WARNING:
StaticPagesQueue::has_error(self::$current_url, $errstr);
Debug::warningHandler($errno, $errstr, $errfile, $errline, null);
break;
case E_NOTICE:
case E_USER_NOTICE:
Debug::noticeHandler($errno, $errstr, $errfile, $errline, null);
break;
}
}