* 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;
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
/**
* @param string $line
- * @return
*/
protected function processStatusLine( $line ) {
if ( !preg_match( '!^HTTP/(\d+)\.(\d+) (\d{3}) (.*)$!', $line, $m ) ) {
}
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