mirror of
https://github.com/Seldaek/monolog.git
synced 2025-08-08 06:06:40 +02:00
Specify port in the connection string instead of adding a protected property
This commit is contained in:
@@ -34,8 +34,7 @@ class PushoverHandler extends SocketHandler
|
||||
*/
|
||||
public function __construct($token, $user, $title = 'Monolog', $level = Logger::CRITICAL, $bubble = true)
|
||||
{
|
||||
parent::__construct('api.pushover.net', $level, $bubble);
|
||||
$this->connectionPort = 80;
|
||||
parent::__construct('api.pushover.net:80', $level, $bubble);
|
||||
|
||||
$this->token = $token;
|
||||
$this->user = $user;
|
||||
|
@@ -22,7 +22,6 @@ use Monolog\Logger;
|
||||
class SocketHandler extends AbstractProcessingHandler
|
||||
{
|
||||
private $connectionString;
|
||||
protected $connectionPort = -1;
|
||||
private $connectionTimeout;
|
||||
private $resource;
|
||||
private $timeout = 0;
|
||||
@@ -172,7 +171,7 @@ class SocketHandler extends AbstractProcessingHandler
|
||||
*/
|
||||
protected function pfsockopen()
|
||||
{
|
||||
return @pfsockopen($this->connectionString, $this->connectionPort, $this->errno, $this->errstr, $this->connectionTimeout);
|
||||
return @pfsockopen($this->connectionString, -1, $this->errno, $this->errstr, $this->connectionTimeout);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -180,7 +179,7 @@ class SocketHandler extends AbstractProcessingHandler
|
||||
*/
|
||||
protected function fsockopen()
|
||||
{
|
||||
return @fsockopen($this->connectionString, $this->connectionPort, $this->errno, $this->errstr, $this->connectionTimeout);
|
||||
return @fsockopen($this->connectionString, -1, $this->errno, $this->errstr, $this->connectionTimeout);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -259,7 +258,7 @@ class SocketHandler extends AbstractProcessingHandler
|
||||
}
|
||||
}
|
||||
|
||||
protected function writeToSocket($data)
|
||||
private function writeToSocket($data)
|
||||
{
|
||||
$length = strlen($data);
|
||||
$sent = 0;
|
||||
|
Reference in New Issue
Block a user