Create directory if it is missing
This commit is contained in:
parent
ddee1931ce
commit
165de29793
1 changed files with 7 additions and 1 deletions
|
@ -139,7 +139,13 @@ class EmbedCache
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($generateCache) {
|
if ($generateCache) {
|
||||||
file_put_contents($this->getFilepath(), json_encode($info));
|
$directory = dirname($filepath);
|
||||||
|
|
||||||
|
if (false === file_exists($directory)) {
|
||||||
|
mkdir($directory);
|
||||||
|
}
|
||||||
|
|
||||||
|
file_put_contents($filepath, json_encode($info));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue