当前位置: 首页>>代码示例>>PHP>>正文


PHP Logs::debug方法代码示例

本文整理汇总了PHP中Logs::debug方法的典型用法代码示例。如果您正苦于以下问题:PHP Logs::debug方法的具体用法?PHP Logs::debug怎么用?PHP Logs::debug使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Logs的用法示例。


在下文中一共展示了Logs::debug方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: appException

 /**
  * 自定义异常处理
  * @access public
  * @param mixed $e 异常对象
  */
 public static function appException($e)
 {
     $error = array();
     $error['message'] = $e->getMessage();
     $trace = $e->getTrace();
     if ('E' == $trace[0]['function']) {
         $error['file'] = $trace[0]['file'];
         $error['line'] = $trace[0]['line'];
     } else {
         $error['file'] = $e->getFile();
         $error['line'] = $e->getLine();
     }
     $error['trace'] = $e->getTraceAsString();
     Logs::debug("appException", $error);
 }
开发者ID:hamily,项目名称:sblack,代码行数:20,代码来源:lib.yueai.php

示例2: errorlog

 private function errorlog($msg = '')
 {
     $error = date('Y-m-d H:i:s') . ":\n" . $this->errorno() . ":\nmsg:" . $this->error() . $msg . ";\n";
     Logs::debug('mysql.txt', $error);
     /*
     $file = APP_LOG_PATH . 'sql/mysql.txt';
             file_put_contents($file, "{$error}\n", @filesize($file)<1024*1024 ? FILE_APPEND : null);
     */
     die('DB Invalid!!!');
 }
开发者ID:hamily,项目名称:sblack,代码行数:10,代码来源:lib.mysql.php

示例3: getConversionRules

 public static function getConversionRules($className)
 {
     $className = strtolower($className);
     if (!array_key_exists($className, self::$conversions)) {
         Logs::debug('Registered models:', array_keys(self::$conversions));
         throw new Exception('Unregistered model:' . $className);
     }
     return self::$conversions[$className];
 }
开发者ID:kelvinmbwilo,项目名称:cervical,代码行数:9,代码来源:object.php

示例4: executeRequest

 private function executeRequest($httpMethod, $url, $queryParams = null, $requestHeaders = null, $contentType = "application/x-www-form-urlencoded", $specialAuth = null)
 {
     if ($queryParams == null) {
         $queryParams = array();
     }
     if ($requestHeaders == null) {
         $requestHeaders = array();
     }
     // Check if the charset is specified in the content-type:
     if (strpos($contentType, 'charset') === false) {
         $charset = OneApiConfigurator::getCharset();
         if (!$charset) {
             $charset = 'utf-8';
         }
         $contentType .= '; charset=' . $charset;
     }
     $sendHeaders = array('Content-Type: ' . $contentType);
     foreach ($requestHeaders as $key => $value) {
         $sendHeaders[] = $key . ': ' . $value;
     }
     if ($httpMethod === 'GET') {
         if (sizeof($queryParams) > 0) {
             $url .= '?' . $this->buildQuery($queryParams);
         }
     }
     $opts = array(CURLOPT_FRESH_CONNECT => 1, CURLOPT_CONNECTTIMEOUT => 60, CURLOPT_TIMEOUT => 120, CURLOPT_RETURNTRANSFER => true, CURLOPT_FOLLOWLOCATION => true, CURLOPT_MAXREDIRS => 3, CURLOPT_USERAGENT => 'OneApi-php-' . self::VERSION, CURLOPT_CUSTOMREQUEST => $httpMethod, CURLOPT_URL => $url, CURLOPT_HTTPHEADER => $sendHeaders);
     if ($specialAuth) {
         $opts[CURLOPT_HTTPHEADER][] = 'Authorization: App ' . $specialAuth;
     } else {
         if ($this->oneApiAuthentication && $this->oneApiAuthentication->ibssoToken) {
             // Token based authentication (one request per login request):
             $opts[CURLOPT_HTTPHEADER][] = 'Authorization: IBSSO ' . $this->oneApiAuthentication->ibssoToken;
         } else {
             // Basic authorization:
             $opts[CURLOPT_USERPWD] = $this->username . ':' . $this->password;
         }
     }
     Logs::debug('Executing ', $httpMethod, ' to ', $url);
     if (sizeof($queryParams) > 0 && ($httpMethod == 'POST' || $httpMethod == 'PUT')) {
         $httpBody = null;
         if (strpos($contentType, 'x-www-form-urlencoded')) {
             $httpBody = $this->buildQuery($queryParams);
         } else {
             if (strpos($contentType, 'json')) {
                 $httpBody = json_encode($queryParams);
             }
         }
         Logs::debug('Http body:', $httpBody);
         $opts[CURLOPT_POSTFIELDS] = $httpBody;
     }
     $ch = curl_init();
     curl_setopt_array($ch, $opts);
     $result = curl_exec($ch);
     $code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
     if (curl_errno($ch) != 0) {
         throw new Exception(curl_error($ch));
     }
     $isSuccess = 200 <= $code && $code < 300;
     curl_close($ch);
     Logs::debug('Response code ', $code);
     Logs::debug('isSuccess:', $isSuccess);
     Logs::debug('Result:', $result);
     return array($isSuccess, $result);
 }
开发者ID:kelvinmbwilo,项目名称:cervical,代码行数:64,代码来源:client.php


注:本文中的Logs::debug方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。