From: Aaron Schulz Date: Thu, 13 Aug 2009 20:55:26 +0000 (+0000) Subject: Fixed 'permission denied' cdb fatals (on windows at least) X-Git-Tag: 1.31.0-rc.0~40322 X-Git-Url: http://git.cyclocoop.org/url?a=commitdiff_plain;h=d4eff3e3820833ad345f7b44f7d5c48a4086821f;p=lhc%2Fweb%2Fwiklou.git Fixed 'permission denied' cdb fatals (on windows at least) --- 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(); }