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


PHP Writer::warning方法代码示例

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


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

示例1: subscribe

 /**
  * @param string $listId
  * @param string $emailAddress
  * @param array $mergeFields
  * @param bool|false $confirm
  * @return bool
  */
 public function subscribe(string $listId, string $emailAddress, array $mergeFields = [], bool $confirm = false)
 {
     // Check the list exists
     if (!$this->checkListExists($listId)) {
         if ($this->error) {
             return false;
             // callApi() error
         }
         return $this->errorResponse('Subscribe called on list that does not exist: ' . $listId);
     }
     // Check address is valid for subscription
     $status = $this->checkStatus($listId, $emailAddress);
     if (in_array($status, ['subscribed', 'pending', 'cleaned'])) {
         $this->logger->warning("Attempt to subscribe {$emailAddress} to list#{$listId}, already on the list and marked {$status} - no action taken");
         return true;
     }
     // Add/update the subscriber - PUT does both
     $id = md5(strtolower($emailAddress));
     $endpoint = "lists/{$listId}/members/{$id}";
     $status = $confirm ? 'pending' : 'subscribed';
     $data = ['email_address' => $emailAddress, 'status' => $status];
     if (!empty($mergeFields)) {
         $data['merge_fields'] = $mergeFields;
     }
     $response = $this->callApi('put', $endpoint, $data);
     if (!$response) {
         return false;
     }
     if (empty($response['status']) || !in_array($response['status'], ['subscribed', 'pending'])) {
         return $this->errorResponse('Subscribe received unexpected response:' . json_encode($response));
     }
     return true;
 }
开发者ID:nztim,项目名称:mailchimp,代码行数:40,代码来源:Mailchimp.php

示例2: loger

 function loger($level, $file, $line, $string, $ar = NULL)
 {
     // если системный level ниже notice, то при включеном KINT_DUMP, ставим уровень notice
     if ($GLOBALS['KINT_DUMP'] && $this->agiconfig['verbosity_level'] < 2) {
         $this->agiconfig['verbosity_level'] = 2;
     }
     if ($this->agiconfig['verbosity_level'] < $level) {
         return;
     }
     if ($GLOBALS['KINT_DUMP']) {
         ~d("{$level} | {$file} | {$line}");
         if (!is_null($string)) {
             d($string);
         }
         if (!is_null($ar)) {
             d($ar);
         }
         return;
     }
     if (!is_null($string)) {
         $this->agi->verbose($string);
     }
     if (!is_null($ar)) {
         $this->agi->verbose($ar);
     }
     if ((int) $this->agiconfig['logging_write_file'] === 1) {
         $logger = new Writer(new Logger('local'));
         $logger->useFiles($this->config['logs_patch']);
         if (!is_null($ar)) {
             $string .= "\n";
             $string .= var_export($string, true);
         }
         switch ($level) {
             case 'error':
                 $logger->error("[" . $this->uniqueid . "] [{$file}] [{$line}]: -- {$string}");
                 break;
             case 'warning':
                 $logger->warning("[" . $this->uniqueid . "] [{$file}] [{$line}]: -- {$string}");
                 break;
             case 'notice':
                 $logger->notice("[" . $this->uniqueid . "] [{$file}] [{$line}]: -- {$string}");
                 break;
             case 'info':
                 $logger->info("[" . $this->uniqueid . "] [{$file}] [{$line}]:  {$string}");
                 break;
             default:
                 $logger->debug("[" . $this->uniqueid . "] [{$file}] [{$line}]: {$string}");
                 break;
         }
     }
 }
开发者ID:regroute,项目名称:rr20-backend,代码行数:51,代码来源:Rr.php


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