Merge "Allow Status::hasMessage to work with Message objects."
[lhc/web/wiklou.git] / maintenance / storage / recompressTracked.php
index 2a6d017..b19a0b3 100644 (file)
  */
 
 $optionsWithArgs = RecompressTracked::getOptionsWithArgs();
-require( __DIR__ . '/../commandLine.inc' );
+require __DIR__ . '/../commandLine.inc';
 
 if ( count( $args ) < 1 ) {
        echo "Usage: php recompressTracked.php [options] <cluster> [... <cluster>...]
-Moves blobs indexed by trackBlobs.php to a specified list of destination clusters, and recompresses them in the process. Restartable.
+Moves blobs indexed by trackBlobs.php to a specified list of destination clusters,
+and recompresses them in the process. Restartable.
 
 Options:
-       --procs <procs>         Set the number of child processes (default 1)
-       --copy-only             Copy only, do not update the text table. Restart without this option to complete.
-       --debug-log <file>      Log debugging data to the specified file
-       --info-log <file>       Log progress messages to the specified file
-       --critical-log <file>   Log error messages to the specified file
+       --procs <procs>       Set the number of child processes (default 1)
+       --copy-only           Copy only, do not update the text table. Restart
+                             without this option to complete.
+       --debug-log <file>    Log debugging data to the specified file
+       --info-log <file>     Log progress messages to the specified file
+       --critical-log <file> Log error messages to the specified file
 ";
        exit( 1 );
 }
@@ -63,8 +65,15 @@ class RecompressTracked {
        public $debugLog, $infoLog, $criticalLog;
        public $store;
 
-       static $optionsWithArgs = array( 'procs', 'slave-id', 'debug-log', 'info-log', 'critical-log' );
-       static $cmdLineOptionMap = array(
+       private static $optionsWithArgs = array(
+               'procs',
+               'slave-id',
+               'debug-log',
+               'info-log',
+               'critical-log'
+       );
+
+       private static $cmdLineOptionMap = array(
                'no-count' => 'noCount',
                'procs' => 'numProcs',
                'copy-only' => 'copyOnly',
@@ -449,6 +458,8 @@ class RecompressTracked {
 
        /**
         * Move tracked text in a given page
+        *
+        * @param int $pageId
         */
        function doPage( $pageId ) {
                $title = Title::newFromId( $pageId );
@@ -527,6 +538,9 @@ class RecompressTracked {
         * without data loss.
         *
         * The transaction is kept short to reduce locking.
+        *
+        * @param int $textId
+        * @param string $url
         */
        function moveTextRow( $textId, $url ) {
                if ( $this->copyOnly ) {
@@ -560,6 +574,8 @@ class RecompressTracked {
         *
         * This function completes any moves that only have done bt_new_url. This
         * can happen when the script is interrupted, or when --copy-only is used.
+        *
+        * @param array $conds
         */
        function finishIncompleteMoves( $conds ) {
                $dbr = wfGetDB( DB_SLAVE );
@@ -607,7 +623,7 @@ class RecompressTracked {
 
        /**
         * Gets a DB master connection for the given external cluster name
-        * @param $cluster string
+        * @param string $cluster
         * @return DatabaseBase
         */
        function getExtDB( $cluster ) {
@@ -617,6 +633,8 @@ class RecompressTracked {
 
        /**
         * Move an orphan text_id to the new cluster
+        *
+        * @param array $textIds
         */
        function doOrphanList( $textIds ) {
                // Finish incomplete moves
@@ -694,8 +712,8 @@ class CgzCopyTransaction {
        /**
         * Add text.
         * Returns false if it's ready to commit.
-        * @param $text string
-        * @param $textId
+        * @param string $text
+        * @param int $textId
         * @return bool
         */
        function addItem( $text, $textId ) {