Issue #1885796 by sun: Fixed PHP warnings in PhpStorage\FileStorage::save().

8.0.x
catch 2013-01-29 13:08:52 +00:00
parent f6e7a9c66e
commit 5f9c8fdec4
1 changed files with 4 additions and 1 deletions

View File

@ -53,7 +53,10 @@ class FileStorage implements PhpStorageInterface {
*/
public function save($name, $code) {
$path = $this->getFullPath($name);
mkdir(dirname($path), 0700, TRUE);
$dir = dirname($path);
if (!file_exists($dir)) {
mkdir($dir, 0700, TRUE);
}
return (bool) file_put_contents($path, $code);
}