1
0
Fork 0
mirror of synced 2024-06-02 10:54:44 +12:00
appwrite/src/ClamAV/Pipe.php
2019-05-09 09:54:42 +03:00

30 lines
599 B
PHP

<?php
namespace ClamAV;
class Pipe extends ClamAV
{
const CLAMAV_HOST = '/var/run/clamav/clamd.ctl';
private $pip;
/**
* Pipe constructor.
*
* This class can be used to connect to local socket.
* You need to pass the path to the socket pipe.
*
* @param string $pip
*/
public function __construct(string $pip = self::CLAMAV_HOST)
{
$this->pip = $pip;
}
protected function getSocket()
{
$socket = socket_create(AF_UNIX, SOCK_STREAM, 0);
socket_connect($socket, $this->pip);
return $socket;
}
}