Merge "[FileBackend] Added getScopedLocksForOps() function."
[lhc/web/wiklou.git] / includes / SquidPurgeClient.php
index 3de6857..7cd2b03 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 
@@ -34,7 +55,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 ) {
@@ -147,7 +168,7 @@ class SquidPurgeClient {
         * @param $url string
         */
        public function queuePurge( $url ) {
-               $url = str_replace( "\n", '', $url );
+               $url = SquidUpdate::expand( str_replace( "\n", '', $url ) );
                $this->requests[] = "PURGE $url HTTP/1.0\r\n" .
                        "Connection: Keep-Alive\r\n" .
                        "Proxy-Connection: Keep-Alive\r\n" .