X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;ds=sidebyside;f=includes%2FSquidPurgeClient.php;h=824dd06b987a5a41085feb5f8a1177ae3f76c038;hb=d69ffc8d6e7008851a1ea9f1c7201efbb94ef6fe;hp=6cd7828dc7629d4574b4bd8968dcb0b31b57ce68;hpb=96764fbc9a67fa6040c6123d31ac3746fc6fd98f;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/SquidPurgeClient.php b/includes/SquidPurgeClient.php index 6cd7828dc7..824dd06b98 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 @@ -326,7 +343,6 @@ class SquidPurgeClient { /** * @param string $line - * @return */ protected function processStatusLine( $line ) { if ( !preg_match( '!^HTTP/(\d+)\.(\d+) (\d{3}) (.*)$!', $line, $m ) ) { @@ -380,12 +396,11 @@ class SquidPurgeClient { } class SquidPurgeClientPool { + /** @var array Array of SquidPurgeClient */ + protected $clients = array(); - /** - * @var array of SquidPurgeClient - */ - var $clients = array(); - var $timeout = 5; + /** @var int */ + protected $timeout = 5; /** * @param array $options