コード例 #1
0
ファイル: Stream.php プロジェクト: erebot/plop
 /**
  * Create a new instance of this handler.
  *
  * \param resource $stream
  *      (optional) The stream where log messages
  *      will be written. Defaults to \a STDERR.
  */
 public function __construct($stream = null)
 {
     if ($stream === null) {
         if (self::$stderr === null) {
             self::$stderr = fopen('php://stderr', 'w');
         }
         $stream = self::$stderr;
     }
     parent::__construct();
     $this->stream = $stream;
 }
コード例 #2
0
ファイル: Socket.php プロジェクト: erebot/plop
 /**
  * Construct a new instance of this handler.
  *
  * \param string $host
  *      The remote host where the logs will be sent.
  *      This may be a (fully qualified) host name or an
  *      IP address (v4 or v6).
  *
  * \param int $port
  *      Destination port where the logs will be sent.
  */
 public function __construct($host, $port)
 {
     parent::__construct();
     if (strpos($host, ':') !== false) {
         // IPv6 addresses must be enclosed in brackets.
         $host = "[{$host}]";
     }
     $this->host = $host;
     $this->port = $port;
     $this->socket = false;
     $this->closeOnError = false;
     $this->retryTime = null;
     $this->retryStart = 1.0;
     $this->retryMax = 30.0;
     $this->retryFactor = 2.0;
     $this->retryPeriod = 0;
 }