Added RepoGroup::setSingleton(). Required to support the DumpHTML extension.
authorTim Starling <tstarling@users.mediawiki.org>
Mon, 7 Jan 2008 05:38:19 +0000 (05:38 +0000)
committerTim Starling <tstarling@users.mediawiki.org>
Mon, 7 Jan 2008 05:38:19 +0000 (05:38 +0000)
includes/filerepo/FSRepo.php
includes/filerepo/RepoGroup.php

index 84ec9a2..acffb4b 100644 (file)
@@ -149,7 +149,7 @@ class FSRepo extends FileRepo {
                                // In the deleted zone, seed new directories with a blank 
                                // index.html, to prevent crawling
                                if ( $dstZone == 'deleted' ) {
-                                       file_put_contents( "$dstDir/index.html", '' );
+                                       $this->file_put_contents( "$dstDir/index.html", '' );
                                }
                        }
                        
@@ -189,7 +189,7 @@ class FSRepo extends FileRepo {
 
                        if ( $flags & self::DELETE_SOURCE ) {
                                if ( $deleteDest ) {
-                                       unlink( $dstPath );
+                                       $this->unlink( $dstPath );
                                }
                                if ( !rename( $srcPath, $dstPath ) ) {
                                        $status->error( 'filerenameerror', $srcPath, $dstPath );
@@ -202,7 +202,7 @@ class FSRepo extends FileRepo {
                                }
                        }
                        if ( $good ) {
-                               chmod( $dstPath, 0644 );
+                               $this->chmod( $dstPath, 0644 );
                                $status->successCount++;
                        } else {
                                $status->failCount++;
@@ -525,6 +525,11 @@ class FSRepo extends FileRepo {
                return strtr( $param, $this->simpleCleanPairs );
        }
 
+       function file_put_contents( $fileName, $contents ) {
+               file_put_contents( $fileName, $contents );
+       }
+
+       
 }
 
 
index 1204031..4e9a8a6 100644 (file)
@@ -31,6 +31,13 @@ class RepoGroup {
                self::$instance = null;
        }
 
+       /**
+        * Set the singleton instance to a given object
+        */
+       static function setSingleton( $instance ) {
+               self::$instance = $instance;
+       }
+
        /**
         * Construct a group of file repositories. 
         * @param array $data Array of repository info arrays.