Array store (LCStoreStaticArray) should behave as standard LCStoreCDB,
creating the target directory when it doesn't exist.
This fixes unexpected "No such file or directory" errors when
replacing 'files' with 'array' in $wgLocalisationCacheConf['store'].
Change-Id: Ie49cf03ca93ac47fc98665de36e6207bef287193
}
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}\"" );
+ }
+ }
+
$this->currentLang = $code;
$this->fname = $this->directory . '/' . $code . '.l10n.php';
$this->data[$code] = [];