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


PHP SocketHandler::__construct方法代碼示例

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


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

示例1: __construct

 /**
  * @param string  $token  Pushover api token
  * @param string  $user   Pushover user id the message will be sent to
  * @param string  $title  Title sent to Pushover API
  * @param integer $level  The minimum logging level at which this handler will be triggered
  * @param Boolean $bubble Whether the messages that are handled can bubble up the stack or not
  */
 public function __construct($token, $user, $title = null, $level = Logger::CRITICAL, $bubble = true)
 {
     parent::__construct('api.pushover.net:80', $level, $bubble);
     $this->token = $token;
     $this->user = $user;
     $this->title = $title ?: gethostname();
 }
開發者ID:wushian,項目名稱:MDD,代碼行數:14,代碼來源:PushoverHandler.php

示例2: __construct

 /**
  * @param string  $token  Pushover api token
  * @param string  $user   Pushover user id the message will be sent to
  * @param string  $title  Title sent to Pushover API
  * @param integer $level  The minimum logging level at which this handler will be triggered
  * @param Boolean $bubble Whether the messages that are handled can bubble up the stack or not
  * @param Boolean $useSSL Whether to connect via SSL. Required when pushing messages to users that are not
  *                        the pushover.net app owner. OpenSSL is required for this option.
  */
 public function __construct($token, $user, $title = null, $level = Logger::CRITICAL, $bubble = true, $useSSL = true)
 {
     $connectionString = $useSSL ? 'ssl://api.pushover.net:443' : 'api.pushover.net:80';
     parent::__construct($connectionString, $level, $bubble);
     $this->token = $token;
     $this->user = $user;
     $this->title = $title ?: gethostname();
 }
開發者ID:kalaspuffar,項目名稱:php-orm-benchmark,代碼行數:17,代碼來源:PushoverHandler.php

示例3: __construct

 /**
  * @param string   $apiToken
  * @param bool|int $level    The minimum logging level at which this handler will be triggered
  * @param bool     $bubble   Whether the messages that are handled can bubble up the stack or not
  *
  * @throws MissingExtensionException if OpenSSL is missing
  */
 public function __construct($apiToken, $level = Logger::DEBUG, $bubble = true)
 {
     if (!extension_loaded('openssl')) {
         throw new MissingExtensionException('The OpenSSL PHP extension is required to use the FlowdockHandler');
     }
     parent::__construct('ssl://api.flowdock.com:443', $level, $bubble);
     $this->apiToken = $apiToken;
 }
開發者ID:Ceciceciceci,項目名稱:MySJSU-Class-Registration,代碼行數:15,代碼來源:FlowdockHandler.php

示例4: __construct

 /**
  * Construct a new Fleep.io Handler.
  *
  * For instructions on how to create a new web hook in your conversations
  * see https://fleep.io/integrations/webhooks/
  *
  * @param  string $token Webhook token
  * @param  bool|int $level The minimum logging level at which this handler will be triggered
  * @param  bool $bubble Whether the messages that are handled can bubble up the stack or not
  * @throws MissingExtensionException
  */
 public function __construct($token, $level = Logger::DEBUG, $bubble = true)
 {
     if (!extension_loaded('openssl')) {
         throw new MissingExtensionException('The OpenSSL PHP extension is required to use the FleepHookHandler');
     }
     $this->token = $token;
     $connectionString = 'ssl://' . self::FLEEP_HOST . ':443';
     parent::__construct($connectionString, $level, $bubble);
 }
開發者ID:scrobot,項目名稱:Lumen,代碼行數:20,代碼來源:FleepHookHandler.php

示例5: __construct

 /**
  * @param string $token Log token supplied by LogEntries
  * @param boolean $useSSL Whether or not SSL encryption should be used.
  * @param int $level The minimum logging level to trigger this handler
  * @param boolean $bubble Whether or not messages that are handled should bubble up the stack.
  *
  * @throws MissingExtensionException If SSL encryption is set to true and OpenSSL is missing
  */
 public function __construct($token, $useSSL = true, $level = Logger::DEBUG, $bubble = true)
 {
     if ($useSSL && !extension_loaded('openssl')) {
         throw new MissingExtensionException('The OpenSSL PHP plugin is required to use SSL encrypted connection for LogEntriesHandler');
     }
     $endpoint = $useSSL ? 'ssl://data.logentries.com:443' : 'data.logentries.com:80';
     parent::__construct($endpoint, $level, $bubble);
     $this->logToken = $token;
 }
開發者ID:saj696,項目名稱:pipe,代碼行數:17,代碼來源:LogEntriesHandler.php

示例6: __construct

 /**
  * @param string  $token  HipChat API Token
  * @param string  $room   The room that should be alerted of the message (Id or Name)
  * @param string  $name   Name used in the "from" field
  * @param bool    $notify Trigger a notification in clients or not
  * @param int     $level  The minimum logging level at which this handler will be triggered
  * @param Boolean $bubble Whether the messages that are handled can bubble up the stack or not
  * @param Boolean $useSSL Whether to connect via SSL.
  */
 public function __construct($token, $room, $name = 'Monolog', $notify = false, $level = Logger::CRITICAL, $bubble = true, $useSSL = true)
 {
     $connectionString = $useSSL ? 'ssl://api.hipchat.com:443' : 'api.hipchat.com:80';
     parent::__construct($connectionString, $level, $bubble);
     $this->token = $token;
     $this->name = $name;
     $this->notify = $notify;
     $this->room = $room;
 }
開發者ID:Thomvh,項目名稱:turbine,代碼行數:18,代碼來源:HipChatHandler.php

示例7: __construct

 /**
  * @param  string                    $token                  Slack API token
  * @param  string                    $channel                Slack channel (encoded ID or name)
  * @param  string                    $username               Name of a bot
  * @param  bool                      $useAttachment          Whether the message should be added to Slack as attachment (plain text otherwise)
  * @param  string|null               $iconEmoji              The emoji name to use (or null)
  * @param  int                       $level                  The minimum logging level at which this handler will be triggered
  * @param  bool                      $bubble                 Whether the messages that are handled can bubble up the stack or not
  * @param  bool                      $useShortAttachment     Whether the the context/extra messages added to Slack as attachments are in a short style
  * @param  bool                      $includeContextAndExtra Whether the attachment should include context and extra data
  * @throws MissingExtensionException If no OpenSSL PHP extension configured
  */
 public function __construct($token, $channel, $username = 'Monolog', $useAttachment = true, $iconEmoji = null, $level = Logger::CRITICAL, $bubble = true, $useShortAttachment = false, $includeContextAndExtra = false)
 {
     if (!extension_loaded('openssl')) {
         throw new MissingExtensionException('The OpenSSL PHP extension is required to use the SlackHandler');
     }
     parent::__construct('ssl://slack.com:443', $level, $bubble);
     $this->slackRecord = new SlackRecord($channel, $username, $useAttachment, $iconEmoji, $useShortAttachment, $includeContextAndExtra, $this->formatter);
     $this->token = $token;
 }
開發者ID:naldz,項目名稱:cyberden,代碼行數:21,代碼來源:SlackHandler.php

示例8: __construct

 /**
  * LogstashHandler constructor.
  *
  * @param RequestStack $requestStack
  * @param bool|int $connectionString
  * @param bool $level
  * @param $bubble
  */
 public function __construct(RequestStack $requestStack, $connectionString, $level, $bubble, $customAttributes = array())
 {
     parent::__construct($connectionString, $level, $bubble);
     if ($requestStack) {
         $this->setRequest($requestStack->getCurrentRequest());
     }
     if (0 < count($customAttributes)) {
         $this->setCustomAttributes($customAttributes);
     }
 }
開發者ID:pilebones,項目名稱:logstashMonologHandlerBundle,代碼行數:18,代碼來源:LogstashHandler.php

示例9: __construct

 /**
  * @param string       $token  Pushover api token
  * @param string|array $users  Pushover user id or array of ids the message will be sent to
  * @param string       $title  Title sent to the Pushover API
  * @param integer      $level  The minimum logging level at which this handler will be triggered
  * @param Boolean      $bubble Whether the messages that are handled can bubble up the stack or not
  * @param Boolean      $useSSL Whether to connect via SSL. Required when pushing messages to users that are not
  *                        the pushover.net app owner. OpenSSL is required for this option.
  * @param integer $highPriorityLevel The minimum logging level at which this handler will start
  *                                   sending "high priority" requests to the Pushover API
  * @param integer $emergencyLevel The minimum logging level at which this handler will start
  *                                sending "emergency" requests to the Pushover API
  */
 public function __construct($token, $users, $title = null, $level = Logger::CRITICAL, $bubble = true, $useSSL = true, $highPriorityLevel = Logger::CRITICAL, $emergencyLevel = Logger::EMERGENCY)
 {
     $connectionString = $useSSL ? 'ssl://api.pushover.net:443' : 'api.pushover.net:80';
     parent::__construct($connectionString, $level, $bubble);
     $this->token = $token;
     $this->users = (array) $users;
     $this->title = $title ?: gethostname();
     $this->highPriorityLevel = $highPriorityLevel;
     $this->emergencyLevel = $emergencyLevel;
 }
開發者ID:reTHINK-project,項目名稱:dev-IdPServer-phpOIDC,代碼行數:23,代碼來源:PushoverHandler.php

示例10: __construct

 /**
  * @param string $token         Slack API token
  * @param string $channel       Slack channel (encoded ID or name)
  * @param string $username      Name of a bot
  * @param bool   $useAttachment Whether the message should be added to Slack as attachment (plain text otherwise)
  * @param int    $level         The minimum logging level at which this handler will be triggered
  * @param bool   $bubble        Whether the messages that are handled can bubble up the stack or not
  */
 public function __construct($token, $channel, $username = 'Monolog', $useAttachment = true, $level = Logger::CRITICAL, $bubble = true)
 {
     if (!extension_loaded('openssl')) {
         throw new MissingExtensionException('The OpenSSL PHP extension is required to use the SlackHandler');
     }
     parent::__construct('ssl://slack.com:443', $level, $bubble);
     $this->token = $token;
     $this->channel = $channel;
     $this->username = $username;
     $this->useAttachment = $useAttachment;
 }
開發者ID:CynthiaAlwenge,項目名稱:Todo-App,代碼行數:19,代碼來源:SlackHandler.php

示例11: __construct

 /**
  * @param string $token  HipChat API Token
  * @param string $room   The room that should be alerted of the message (Id or Name)
  * @param string $name   Name used in the "from" field.
  * @param bool   $notify Trigger a notification in clients or not
  * @param int    $level  The minimum logging level at which this handler will be triggered
  * @param bool   $bubble Whether the messages that are handled can bubble up the stack or not
  * @param bool   $useSSL Whether to connect via SSL.
  * @param string $format The format of the messages (default to text, can be set to html if you have html in the messages)
  * @param string $host   The HipChat server hostname.
  */
 public function __construct($token, $room, $name = 'Monolog', $notify = false, $level = Logger::CRITICAL, $bubble = true, $useSSL = true, $format = 'text', $host = 'api.hipchat.com')
 {
     $connectionString = $useSSL ? 'ssl://' . $host . ':443' : $host . ':80';
     parent::__construct($connectionString, $level, $bubble);
     $this->token = $token;
     $this->name = $name;
     $this->notify = $notify;
     $this->room = $room;
     $this->format = $format;
     $this->host = $host;
 }
開發者ID:earncef,項目名稱:monolog,代碼行數:22,代碼來源:HipChatHandler.php

示例12: __construct

 /**
  * @param string     $token    Log token supplied by Logmatic.
  * @param string     $hostname Host name supplied by Logmatic.
  * @param string     $appname  Application name supplied by Logmatic.
  * @param bool       $useSSL   Whether or not SSL encryption should be used.
  * @param int|string $level    The minimum logging level to trigger this handler.
  * @param bool       $bubble   Whether or not messages that are handled should bubble up the stack.
  *
  * @throws MissingExtensionException If SSL encryption is set to true and OpenSSL is missing
  */
 public function __construct(string $token, string $hostname = '', string $appname = '', bool $useSSL = true, $level = Logger::DEBUG, bool $bubble = true)
 {
     if ($useSSL && !extension_loaded('openssl')) {
         throw new MissingExtensionException('The OpenSSL PHP extension is required to use SSL encrypted connection for LogmaticHandler');
     }
     $endpoint = $useSSL ? 'ssl://api.logmatic.io:10515' : 'api.logmatic.io:10514';
     $endpoint .= '/v1/';
     parent::__construct($endpoint, $level, $bubble);
     $this->logToken = $token;
     $this->hostname = $hostname;
     $this->appname = $appname;
 }
開發者ID:earncef,項目名稱:monolog,代碼行數:22,代碼來源:LogmaticHandler.php

示例13: __construct

 /**
  * @param string  $token  HipChat API Token
  * @param string  $room   The room that should be alerted of the message (Id or Name)
  * @param string  $name   Name used in the "from" field
  * @param bool    $notify Trigger a notification in clients or not
  * @param int     $level  The minimum logging level at which this handler will be triggered
  * @param Boolean $bubble Whether the messages that are handled can bubble up the stack or not
  * @param Boolean $useSSL Whether to connect via SSL.
  */
 public function __construct($token, $room, $name = 'Monolog', $notify = false, $level = Logger::CRITICAL, $bubble = true, $useSSL = true)
 {
     if (!$this->validateName($name)) {
         throw new \InvalidArgumentException('The supplied name is too long. HipChat\'s v1 API supports names up to 15 UTF-8 characters.');
     }
     $connectionString = $useSSL ? 'ssl://api.hipchat.com:443' : 'api.hipchat.com:80';
     parent::__construct($connectionString, $level, $bubble);
     $this->token = $token;
     $this->name = $name;
     $this->notify = $notify;
     $this->room = $room;
 }
開發者ID:bobans1985,項目名稱:IBSService,代碼行數:21,代碼來源:HipChatHandler.php

示例14: __construct

 /**
  * @param string  $token  HipChat API Token
  * @param string  $room   The room that should be alerted of the message (Id or Name)
  * @param string  $name   Name used in the "from" field
  * @param bool    $notify Trigger a notification in clients or not
  * @param int     $level  The minimum logging level at which this handler will be triggered
  * @param Boolean $bubble Whether the messages that are handled can bubble up the stack or not
  * @param Boolean $useSSL Whether to connect via SSL.
  * @param string  $format The format of the messages (default to text, can be set to html if you have html in the messages)
  * @param string  $host   The HipChat server hostname.
  */
 public function __construct($token, $room, $name = 'Monolog', $notify = false, $level = Logger::CRITICAL, $bubble = true, $useSSL = true, $format = 'text', $host = 'api.hipchat.com')
 {
     if (!$this->validateStringLength($name, static::MAXIMUM_NAME_LENGTH)) {
         throw new \InvalidArgumentException('The supplied name is too long. HipChat\'s v1 API supports names up to 15 UTF-8 characters.');
     }
     $connectionString = $useSSL ? 'ssl://' . $host . ':443' : $host . ':80';
     parent::__construct($connectionString, $level, $bubble);
     $this->token = $token;
     $this->name = $name;
     $this->notify = $notify;
     $this->room = $room;
     $this->format = $format;
 }
開發者ID:pancke,項目名稱:yyaf,代碼行數:24,代碼來源:HipChatHandler.php

示例15: __construct

 /**
  * @param string $authToken  Plivo API Auth Token
  * @param string $authId     Plivo API Auth ID
  * @param string $fromNumber The phone number that will be shown as the sender ID
  * @param string $toNumber   The phone number to which the message will be sent
  * @param int    $level      The minimum logging level at which this handler will be triggered
  * @param bool   $bubble     Whether the messages that are handled can bubble up the stack or not
  * @param bool   $useSSL     Whether to connect via SSL.
  * @param string $host       The Plivo server hostname.
  * @param string $version    The Plivo API version (default PlivoHandler::API_V1)
  * @param string $limit      The character limit
  */
 public function __construct($authToken, $authId, $fromNumber, $toNumber, $level = Logger::CRITICAL, $bubble = true, $useSSL = true, $host = 'api.plivo.com', $version = null, $limit = 160)
 {
     if (empty($version)) {
         throw new Exception('API Version is empty');
     }
     $connectionString = $useSSL ? 'ssl://' . $host . ':443' : $host . ':80';
     parent::__construct($connectionString, $level, $bubble);
     $this->authToken = $authToken;
     $this->authId = $authId;
     $this->fromNumber = $fromNumber;
     $this->toNumber = $toNumber;
     $this->host = $host;
     $this->version = $version;
     $this->limit = $limit;
 }
開發者ID:tylercd100,項目名稱:monolog-sms,代碼行數:27,代碼來源:SMSHandler.php


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