Make Status extend StatusValue and start FileBackend update
[lhc/web/wiklou.git] / includes / filebackend / filejournal / FileJournal.php
index c065148..f0bb92d 100644 (file)
@@ -57,14 +57,14 @@ abstract class FileJournal {
         *
         * @param array $config
         * @param string $backend A registered file backend name
-        * @throws MWException
+        * @throws Exception
         * @return FileJournal
         */
        final public static function factory( array $config, $backend ) {
                $class = $config['class'];
                $jrn = new $class( $config );
                if ( !$jrn instanceof self ) {
-                       throw new MWException( "Class given is not an instance of FileJournal." );
+                       throw new Exception( "Class given is not an instance of FileJournal." );
                }
                $jrn->backend = $backend;
 
@@ -81,9 +81,9 @@ abstract class FileJournal {
                for ( $i = 0; $i < 5; $i++ ) {
                        $s .= mt_rand( 0, 2147483647 );
                }
-               $s = wfBaseConvert( sha1( $s ), 16, 36, 31 );
+               $s = Wikimedia\base_convert( sha1( $s ), 16, 36, 31 );
 
-               return substr( wfBaseConvert( wfTimestamp( TS_MW ), 10, 36, 9 ) . $s, 0, 31 );
+               return substr( Wikimedia\base_convert( wfTimestamp( TS_MW ), 10, 36, 9 ) . $s, 0, 31 );
        }
 
        /**
@@ -95,11 +95,11 @@ abstract class FileJournal {
         *     newSha1 : The final base 36 SHA-1 of the file
         *   Note that 'false' should be used as the SHA-1 for non-existing files.
         * @param string $batchId UUID string that identifies the operation batch
-        * @return Status
+        * @return StatusValue
         */
        final public function logChangeBatch( array $entries, $batchId ) {
                if ( !count( $entries ) ) {
-                       return Status::newGood();
+                       return StatusValue::newGood();
                }
 
                return $this->doLogChangeBatch( $entries, $batchId );
@@ -110,7 +110,7 @@ abstract class FileJournal {
         *
         * @param array $entries List of file operations (each an array of parameters)
         * @param string $batchId UUID string that identifies the operation batch
-        * @return Status
+        * @return StatusValue
         */
        abstract protected function doLogChangeBatch( array $entries, $batchId );
 
@@ -186,7 +186,7 @@ abstract class FileJournal {
        /**
         * Purge any old log entries
         *
-        * @return Status
+        * @return StatusValue
         */
        final public function purgeOldLogs() {
                return $this->doPurgeOldLogs();
@@ -194,7 +194,7 @@ abstract class FileJournal {
 
        /**
         * @see FileJournal::purgeOldLogs()
-        * @return Status
+        * @return StatusValue
         */
        abstract protected function doPurgeOldLogs();
 }
@@ -208,10 +208,10 @@ class NullFileJournal extends FileJournal {
         * @see FileJournal::doLogChangeBatch()
         * @param array $entries
         * @param string $batchId
-        * @return Status
+        * @return StatusValue
         */
        protected function doLogChangeBatch( array $entries, $batchId ) {
-               return Status::newGood();
+               return StatusValue::newGood();
        }
 
        /**
@@ -238,14 +238,14 @@ class NullFileJournal extends FileJournal {
         * @return array
         */
        protected function doGetChangeEntries( $start, $limit ) {
-               return array();
+               return [];
        }
 
        /**
         * @see FileJournal::doPurgeOldLogs()
-        * @return Status
+        * @return StatusValue
         */
        protected function doPurgeOldLogs() {
-               return Status::newGood();
+               return StatusValue::newGood();
        }
 }