當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Debug::warningHandler方法代碼示例

本文整理匯總了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();
 }
開發者ID:firebrandhq,項目名稱:silverstripe-hail,代碼行數:22,代碼來源:HailTag.php

示例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;
    }
}
開發者ID:ramziammar,項目名稱:websites,代碼行數:15,代碼來源:Debug.php

示例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();
     }
 }
開發者ID:firebrandhq,項目名稱:silverstripe-hail,代碼行數:32,代碼來源:HailArticle.php

示例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;
 }
開發者ID:firebrandhq,項目名稱:silverstripe-hail,代碼行數:19,代碼來源:HailApiObject.php

示例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());
    }
}
開發者ID:jareddreyer,項目名稱:catalogue,代碼行數:30,代碼來源:Debug.php

示例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;
    }
}
開發者ID:nomidi,項目名稱:sapphire,代碼行數:33,代碼來源:Debug.php

示例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;
     }
 }
開發者ID:spark-green,項目名稱:silverstripe-staticpublishqueue,代碼行數:32,代碼來源:BuildStaticCacheFromQueue.php


注:本文中的Debug::warningHandler方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。