Fix warning: check for RASPI_CACHE_PATH

This commit is contained in:
billz 2021-02-02 11:15:08 +00:00
parent bdafa8dfbd
commit 3d2d608477
1 changed files with 5 additions and 3 deletions

View File

@ -492,9 +492,11 @@ function readCache($key)
function writeCache($key, $data)
{
mkdir(RASPI_CACHE_PATH, 0777, true);
$cacheKey = expandCacheKey($key);
file_put_contents($cacheKey, $data);
if (!file_exists(RASPI_CACHE_PATH)) {
mkdir(RASPI_CACHE_PATH, 0777, true);
$cacheKey = expandCacheKey($key);
file_put_contents($cacheKey, $data);
}
}
function deleteCache($key)