mirror of
https://github.com/Seldaek/monolog.git
synced 2025-10-23 17:46:09 +02:00
mb_* functions with BC
This commit is contained in:
@@ -11,6 +11,8 @@
|
||||
|
||||
namespace Monolog\Handler\SyslogUdp;
|
||||
|
||||
use Monolog\Utils;
|
||||
|
||||
class UdpSocket
|
||||
{
|
||||
protected const DATAGRAM_MAX_LENGTH = 65023;
|
||||
@@ -47,13 +49,13 @@ class UdpSocket
|
||||
if (!is_resource($this->socket)) {
|
||||
throw new \RuntimeException('The UdpSocket to '.$this->ip.':'.$this->port.' has been closed and can not be written to anymore');
|
||||
}
|
||||
socket_sendto($this->socket, $chunk, strlen($chunk), $flags = 0, $this->ip, $this->port);
|
||||
socket_sendto($this->socket, $chunk, Utils::strlen($chunk), $flags = 0, $this->ip, $this->port);
|
||||
}
|
||||
|
||||
protected function assembleMessage(string $line, string $header): string
|
||||
{
|
||||
$chunkSize = static::DATAGRAM_MAX_LENGTH - strlen($header);
|
||||
$chunkSize = static::DATAGRAM_MAX_LENGTH - Utils::strlen($header);
|
||||
|
||||
return $header . substr($line, 0, $chunkSize);
|
||||
return $header . Utils::substr($line, 0, $chunkSize);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user