X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2FSquidPurgeClient.php;h=c790bb7f907b2d6d0b110fbbbb7b03fa4979c91f;hb=b42d01059ee0d52d40b2faa00437dbc10991ea1b;hp=0997a7a7a34b6a8216139823df4b952a9af63002;hpb=622f2ddb6309021f7f8b891e635070809832e5ce;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/SquidPurgeClient.php b/includes/SquidPurgeClient.php index 0997a7a7a3..c790bb7f90 100644 --- a/includes/SquidPurgeClient.php +++ b/includes/SquidPurgeClient.php @@ -28,12 +28,26 @@ * Could be replaced by curl_multi_exec() or some such. */ class SquidPurgeClient { - var $host, $port, $ip; + /** @var string */ + protected $host; - var $readState = 'idle'; - var $writeBuffer = ''; - var $requests = array(); - var $currentRequestIndex; + /** @var int */ + protected $port; + + /** @var string|bool */ + protected $ip; + + /** @var string */ + protected $readState = 'idle'; + + /** @var string */ + protected $writeBuffer = ''; + + /** @var array */ + protected $requests = array(); + + /** @var mixed */ + protected $currentRequestIndex; const EINTR = 4; const EAGAIN = 11; @@ -41,13 +55,16 @@ class SquidPurgeClient { const BUFFER_SIZE = 8192; /** - * The socket resource, or null for unconnected, or false for disabled due to error + * @var resource|null The socket resource, or null for unconnected, or false + * for disabled due to error. */ - var $socket; + protected $socket; - var $readBuffer; + /** @var string */ + protected $readBuffer; - var $bodyRemaining; + /** @var int */ + protected $bodyRemaining; /** * @param string $server @@ -126,6 +143,7 @@ class SquidPurgeClient { /** * Get the host's IP address. * Does not support IPv6 at present due to the lack of a convenient interface in PHP. + * @throws MWException * @return string */ protected function getIP() { @@ -379,12 +397,11 @@ class SquidPurgeClient { } class SquidPurgeClientPool { + /** @var array of SquidPurgeClient */ + protected $clients = array(); - /** - * @var array of SquidPurgeClient - */ - var $clients = array(); - var $timeout = 5; + /** @var int */ + protected $timeout = 5; /** * @param array $options