From d4eff3e3820833ad345f7b44f7d5c48a4086821f Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Thu, 13 Aug 2009 20:55:26 +0000 Subject: [PATCH] Fixed 'permission denied' cdb fatals (on windows at least) --- includes/LocalisationCache.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/includes/LocalisationCache.php b/includes/LocalisationCache.php index 77fa7cb587..fe22079731 100644 --- a/includes/LocalisationCache.php +++ b/includes/LocalisationCache.php @@ -827,6 +827,10 @@ class LCStore_CDB implements LCStore { "directory \"{$this->directory}\"" ); } } + // Close reader to stop permission errors on write + if( !empty($this->readers[$code]) ) { + $this->readers[$code]->close(); + } $this->writer = CdbWriter::open( $this->getFileName( $code ) ); $this->currentLang = $code; } @@ -836,7 +840,7 @@ class LCStore_CDB implements LCStore { $this->writer->close(); $this->writer = null; - // Reopen the reader + // Close and remove the reader if ( !empty( $this->readers[$this->currentLang] ) ) { $this->readers[$this->currentLang]->close(); } -- 2.20.1