phpcs: More require/include is not a function
[lhc/web/wiklou.git] / maintenance / storage / trackBlobs.php
index 15aeec3..7857dd9 100644 (file)
@@ -1,6 +1,28 @@
 <?php
-
-require( dirname( __FILE__ ) . '/../commandLine.inc' );
+/**
+ * Adds blobs from a given external storage cluster to the blob_tracking table.
+ *
+ * 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
+ * @ingroup Maintenance
+ * @see wfWaitForSlaves()
+ */
+
+require __DIR__ . '/../commandLine.inc';
 
 
 if ( count( $args ) < 1 ) {
@@ -15,12 +37,12 @@ $tracker->run();
 echo "All done.\n";
 
 class TrackBlobs {
-       var $clusters, $textClause;
-       var $doBlobOrphans;
-       var $trackedBlobs = array();
+       public $clusters, $textClause;
+       public $doBlobOrphans;
+       public $trackedBlobs = array();
 
-       var $batchSize = 1000;
-       var $reportingInterval = 10;
+       public $batchSize = 1000;
+       public $reportingInterval = 10;
 
        function __construct( $clusters ) {
                $this->clusters = $clusters;
@@ -91,7 +113,7 @@ class TrackBlobs {
                        $dbw->query( 'DROP TABLE ' . $dbw->tableName( 'blob_tracking' ) );
                        $dbw->query( 'DROP TABLE ' . $dbw->tableName( 'blob_orphans' ) );
                }
-               $dbw->sourceFile( dirname( __FILE__ ) . '/blob_tracking.sql' );
+               $dbw->sourceFile( __DIR__ . '/blob_tracking.sql' );
        }
 
        function getTextClause() {
@@ -184,7 +206,7 @@ class TrackBlobs {
                        if ( $batchesDone >= $this->reportingInterval ) {
                                $batchesDone = 0;
                                echo "$startId / $endId\n";
-                               wfWaitForSlaves( 5 );
+                               wfWaitForSlaves();
                        }
                }
                echo "Found $rowsInserted revisions\n";
@@ -268,7 +290,7 @@ class TrackBlobs {
                        if ( $batchesDone >= $this->reportingInterval ) {
                                $batchesDone = 0;
                                echo "$startId / $endId\n";
-                               wfWaitForSlaves( 5 );
+                               wfWaitForSlaves();
                        }
                }
                echo "Found $rowsInserted orphan text rows\n";