- quickfixes

This commit is contained in:
Dave M. 2021-02-26 13:49:07 +00:00
parent 14c3fb79ad
commit 84e3b91199
2 changed files with 8 additions and 1 deletions

View File

@ -31,6 +31,8 @@ class I18n implements MissingKeyInterface
$this->dataReader = $dataReader; $this->dataReader = $dataReader;
$this->cacheReader = $cacheReader; $this->cacheReader = $cacheReader;
$this->missingKey = $missingKey; $this->missingKey = $missingKey;
$this->locale = \Locale::getDefault() ?: $this->locale;
} }
public function initialize(bool $useCache) : bool public function initialize(bool $useCache) : bool

View File

@ -39,6 +39,11 @@ class PhpReader implements ReaderInterface {
public function save(string $filepath, array $content) : bool public function save(string $filepath, array $content) : bool
{ {
$path = $this->pathList[0]; $path = $this->pathList[0];
return (bool) file_put_contents($path . DIRECTORY_SEPARATOR . "$filepath." . $this->accept[0], "return " . var_export($content, true) . ";");
if ( ! file_exists($path) ) {
mkdir($path, '0775', true);
}
return (bool) file_put_contents($path . DIRECTORY_SEPARATOR . "$filepath." . $this->accept[0], "<?php return " . var_export($content, true) . ";");
} }
} }