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


PHP Debug::writeError方法代碼示例

本文整理匯總了PHP中Debug::writeError方法的典型用法代碼示例。如果您正苦於以下問題:PHP Debug::writeError方法的具體用法?PHP Debug::writeError怎麽用?PHP Debug::writeError使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Debug的用法示例。


在下文中一共展示了Debug::writeError方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: saveCache

  function saveCache()
  {
    $cache_file = $this->getCacheFile();

    $fp = fopen($cache_file, 'w+');
    if ($fp === false)
    {
      Debug :: writeError("Couldn't create cache file '{$cache_file}', perhaps wrong permissions",
      __FILE__ . ' : ' . __LINE__ . ' : ' . __FUNCTION__);
      return;
    }

    fwrite($fp, "<?php\n");

    fwrite($fp, '$cache_resolved_paths = ' . var_export($this->_resolved_paths, true) . ";\n");

    fwrite($fp, "\n?>");
    fclose($fp);
  }
開發者ID:BackupTheBerlios,項目名稱:limb-svn,代碼行數:19,代碼來源:CachingFileResolver.class.php

示例2: _browseToHomePage

 protected function _browseToHomePage()
 {
     $ch = curlInit();
     curlSetopt($ch, CURLOPT_URL, SHIPPING_FEDEX_HOME_SERVER);
     curlSetopt($ch, CURLOPT_USERAGENT, SHIPPING_FEDEX_SERVER_USERAGENT);
     curlSetopt($ch, CURLOPT_FAILONERROR, 1);
     curlSetopt($ch, CURLOPT_FOLLOWLOCATION, 1);
     curlSetopt($ch, CURLOPT_TIMEOUT, SHIPPING_FEDEX_SERVER_TIMEOUT);
     curlSetopt($ch, CURLOPT_COOKIEJAR, SHIPPING_FEDEX_SERVER_COOKIE_FILE);
     curlSetopt($ch, CURLOPT_RETURNTRANSFER, 1);
     curlExec($ch);
     if (curlErrno($ch) != 0) {
         Debug::writeError('curl error', __FILE__ . ' : ' . __LINE__ . ' : ' . __FUNCTION__, array('error' => curlError($ch)));
         curlClose($ch);
         return false;
     }
     curlClose($ch);
     return true;
 }
開發者ID:BackupTheBerlios,項目名稱:limb-svn,代碼行數:19,代碼來源:FedexShippingLocator.class.php

示例3: writeException

 function writeException($e)
 {
   if(is_a($e, 'LimbException'))
     Debug :: writeError($e->getMessage(), $e->getBacktrace(), $e->getAdditionalParams());
   else
     Debug :: writeError($e->getMessage(), $e->getBacktrace());
 }
開發者ID:BackupTheBerlios,項目名稱:limb-svn,代碼行數:7,代碼來源:Debug.class.php

示例4: _parseString

  function _parseString(&$contents)
  {
    $lines =& preg_split("#\r\n|\r|\n#", $contents);
    unset($contents);

    if ($lines === false)
    {
      Debug::writeError("'{$this->file_path}' is empty", __FILE__ . ' : ' . __LINE__ . ' : ' . __FUNCTION__);
      return false;
    }

    $current_group = 'default';

    if (count($lines) == 0)
      return false;

    // check for charset
    if (preg_match("/#charset[^=]*=(.+)/", $lines[0], $match))
    {
      $this->charset = trim($match[1]);
    }

    foreach ($lines as $line)
    {
      if (($line = trim($line)) == '')
        continue;
      // removing comments after #, not after # inside ""

      $line = preg_replace('/([^"#]+|"(.*?)")|(#[^#]*)/', "\\1", $line);
      // check for new group
      if (preg_match("#^\[(.+)\]\s*$#", $line, $new_group_name_array))
      {
        $new_group_name = trim($new_group_name_array[1]);
        $current_group = $this->_parseConstants($new_group_name);

        if(!isset($this->group_values[$current_group]))
          $this->group_values[$current_group] = array();
        continue;
      }
      // check for variable
      if (preg_match("#^([a-zA-Z0-9_-]+)(\[([a-zA-Z0-9_-]*)\]){0,1}(\s*)=(.*)$#", $line, $value_array))
      {
        $var_name = trim($value_array[1]);

        $var_value = trim($value_array[5]);

        if (preg_match('/^"(.*)"$/', $var_value, $m))
          $var_value = $m[1];

        $var_value = $this->_parseConstants($var_value);

        if ($value_array[2])//check for array []
        {
          if ($value_array[3]) //check for hashed array ['test']
          {
            $key_name = $value_array[3];

            if (isset($this->group_values[$current_group][$var_name]) &&
                is_array($this->group_values[$current_group][$var_name]))
              $this->group_values[$current_group][$var_name][$key_name] = $var_value;
            else
              $this->group_values[$current_group][$var_name] = array($key_name => $var_value);
          }
          else
          {
            if (isset($this->group_values[$current_group][$var_name]) &&
                is_array($this->group_values[$current_group][$var_name]))
              $this->group_values[$current_group][$var_name][] = $var_value;
            else
              $this->group_values[$current_group][$var_name] = array($var_value);
          }
        }
        else
        {
          $this->group_values[$current_group][$var_name] = $var_value;
        }
      }
    }
  }
開發者ID:BackupTheBerlios,項目名稱:limb-svn,代碼行數:79,代碼來源:Ini.class.php

示例5: writeException

 static public function writeException($e)
 {
   if($e instanceof LimbException)
     Debug :: writeError($e->getMessage(), $e->getFile() . ' : ' . $e->getLine(), $e->getAdditionalParams());
   else
     Debug :: writeError($e->getMessage(), $e->getFile() . ' : ' . $e->getLine());
 }
開發者ID:BackupTheBerlios,項目名稱:limb-svn,代碼行數:7,代碼來源:Debug.class.php


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