Fallback for missing tmp:// stream and unified method

This commit is contained in:
Andy Miller
2016-09-07 22:00:57 -06:00
parent 26bb3508ba
commit 8a02b72307
4 changed files with 20 additions and 5 deletions

View File

@@ -1322,4 +1322,14 @@ class Admin
return trim($string);
}
public static function getTempDir()
{
try {
$tmp_dir = Grav::instance()['locator']->findResource('tmp://', true, true);
} catch (\Exception $e) {
$tmp_dir = Grav::instance()['locator']->findResource('cache://', true, true);
}
return $tmp_dir;
}
}