- quickfixes

This commit is contained in:
mcndave committed 2021-02-26 13:49:07 +00:00
1 parent 14c3fb79ad
commit 84e3b91199
2 files changed
+8 -1

No files matched your search

+2
View File
@@ -31,6 +31,8 @@ class I18n implements MissingKeyInterface
$this->dataReader = $dataReader;
$this->cacheReader = $cacheReader;
$this->missingKey = $missingKey;
$this->locale = \Locale::getDefault() ?: $this->locale;
}
public function initialize(bool $useCache) : bool
+6 -1
View File
@@ -39,6 +39,11 @@ class PhpReader implements ReaderInterface {
public function save(string $filepath, array $content) : bool
{
$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) . ";");
}
}