private $directory;
public function __construct( $conf = [] ) {
- global $wgCacheDirectory;
-
- $this->directory = $conf['directory'] ?? $wgCacheDirectory;
+ $this->directory = $conf['directory'];
}
public function startWrite( $code ) {
- if ( !file_exists( $this->directory ) ) {
- if ( !wfMkdirParents( $this->directory, null, __METHOD__ ) ) {
- throw new MWException( "Unable to create the localisation store " .
- "directory \"{$this->directory}\"" );
- }
+ if ( !file_exists( $this->directory ) && !wfMkdirParents( $this->directory, null, __METHOD__ ) ) {
+ throw new MWException( "Unable to create the localisation store " .
+ "directory \"{$this->directory}\"" );
}
$this->currentLang = $code;
'Generated by LCStoreStaticArray.php -- do not edit!'
);
file_put_contents( $this->fname, $out );
+ // Release the data to manage the memory in rebuildLocalisationCache
+ unset( $this->data[$this->currentLang] );
$this->currentLang = null;
$this->fname = null;
}