escape tags and entity in doxygen comments
[lhc/web/wiklou.git] / includes / SquidPurgeClient.php
index 6f45f20..8eb0f6b 100644 (file)
@@ -1,4 +1,25 @@
 <?php
+/**
+ * Squid and Varnish cache purging.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ * @file
+ */
+
 /**
  * An HTTP 1.0 client built for the purposes of purging Squid and Varnish. 
  * Uses asynchronous I/O, allowing purges to be done in a highly parallel 
@@ -23,7 +44,15 @@ class SquidPurgeClient {
         * The socket resource, or null for unconnected, or false for disabled due to error
         */
        var $socket;
-       
+
+       var $readBuffer;
+
+       var $bodyRemaining;
+
+       /**
+        * @param $server string
+        * @param $options array
+        */
        public function __construct( $server, $options = array() ) {
                $parts = explode( ':', $server, 2 );
                $this->host = $parts[0];
@@ -34,7 +63,7 @@ class SquidPurgeClient {
         * Open a socket if there isn't one open already, return it.
         * Returns false on error.
         *
-        * @return false|resource
+        * @return bool|resource
         */
        protected function getSocket() {
                if ( $this->socket !== null ) {
@@ -319,6 +348,9 @@ class SquidPurgeClient {
                $this->bodyRemaining = null;
        }
 
+       /**
+        * @param $msg string
+        */
        protected function log( $msg ) {
                wfDebugLog( 'squid', __CLASS__." ($this->host): $msg\n" );
        }
@@ -332,6 +364,9 @@ class SquidPurgeClientPool {
        var $clients = array();
        var $timeout = 5;
 
+       /**
+        * @param $options array
+        */
        function __construct( $options = array() ) {
                if ( isset( $options['timeout'] ) ) {
                        $this->timeout = $options['timeout'];
@@ -340,6 +375,7 @@ class SquidPurgeClientPool {
 
        /**
         * @param $client SquidPurgeClient
+        * @return void
         */
        public function addClient( $client ) {
                $this->clients[] = $client;
@@ -350,6 +386,9 @@ class SquidPurgeClientPool {
                $startTime = microtime( true );
                while ( !$done ) {
                        $readSockets = $writeSockets = array();
+                       /**
+                        * @var $client SquidPurgeClient
+                        */
                        foreach ( $this->clients as $clientIndex => $client ) {
                                $sockets = $client->getReadSocketsForSelect();
                                foreach ( $sockets as $i => $socket ) {