From 38ec0179bf9c9fba91232858a2f1a155d532eeac Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Mon, 7 Jan 2008 05:38:19 +0000 Subject: [PATCH] Added RepoGroup::setSingleton(). Required to support the DumpHTML extension. --- includes/filerepo/FSRepo.php | 11 ++++++++--- includes/filerepo/RepoGroup.php | 7 +++++++ 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/includes/filerepo/FSRepo.php b/includes/filerepo/FSRepo.php index 84ec9a2709..acffb4b582 100644 --- a/includes/filerepo/FSRepo.php +++ b/includes/filerepo/FSRepo.php @@ -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 ); + } + + } diff --git a/includes/filerepo/RepoGroup.php b/includes/filerepo/RepoGroup.php index 1204031fd0..4e9a8a6dc6 100644 --- a/includes/filerepo/RepoGroup.php +++ b/includes/filerepo/RepoGroup.php @@ -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. -- 2.20.1