X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2FSquidPurgeClient.php;h=3de685781dfec471cad174a7c6539b25611a7b6a;hb=519d5427e28ced4b9b5d710a74b81fb79e89efb3;hp=664f59a04789a0b94ca8be2ef75f5baed572a46e;hpb=bc1c6d2a6b1ff26249ba2a77f504f281a60fbb8f;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/SquidPurgeClient.php b/includes/SquidPurgeClient.php index 664f59a047..3de685781d 100644 --- a/includes/SquidPurgeClient.php +++ b/includes/SquidPurgeClient.php @@ -33,6 +33,8 @@ class SquidPurgeClient { /** * Open a socket if there isn't one open already, return it. * Returns false on error. + * + * @return false|resource */ protected function getSocket() { if ( $this->socket !== null ) { @@ -64,6 +66,7 @@ class SquidPurgeClient { /** * Get read socket array for select() + * @return array */ public function getReadSocketsForSelect() { if ( $this->readState == 'idle' ) { @@ -78,6 +81,7 @@ class SquidPurgeClient { /** * Get write socket array for select() + * @return array */ public function getWriteSocketsForSelect() { if ( !strlen( $this->writeBuffer ) ) { @@ -225,6 +229,10 @@ class SquidPurgeClient { while ( $this->socket && $this->processReadBuffer() === 'continue' ); } + /** + * @throws MWException + * @return string + */ protected function processReadBuffer() { switch ( $this->readState ) { case 'idle': @@ -264,6 +272,10 @@ class SquidPurgeClient { } } + /** + * @param $line + * @return + */ protected function processStatusLine( $line ) { if ( !preg_match( '!^HTTP/(\d+)\.(\d+) (\d{3}) (.*)$!', $line, $m ) ) { $this->log( 'invalid status line' ); @@ -280,6 +292,9 @@ class SquidPurgeClient { $this->readState = 'header'; } + /** + * @param $line string + */ protected function processHeaderLine( $line ) { if ( preg_match( '/^Content-Length: (\d+)$/i', $line, $m ) ) { $this->bodyRemaining = intval( $m[1] );