This commit is contained in:
crispycat 2024-02-20 13:49:24 -05:00
parent ad21dca2f0
commit b24c9fc884
2 changed files with 5 additions and 3 deletions

View File

@ -65,9 +65,11 @@
}
public function initializeCache(bool $clear = true): int {
$count = 0;
if (!file_exists($this->path)) mkdir($this->path);
elseif ($clear) return FileUtils::emptyDirectory($this->path);
return 0;
elseif ($clear) $count = FileUtils::emptyDirectory($this->path);
$this->app->dispatcher->trigger("crispage.cache.initialize", $count);
return $count;
}
public function createBucket(string $name): string {

View File

@ -99,7 +99,7 @@
public function upload(array $file): ?Extension {
$sn = FileUtils::sanitizeName($file["name"]);
$time = time();
$upath = ROOT . Config::TEMP_PATH . "/pkguploads/$time\_$sn";
$upath = ROOT . Config::TEMP_PATH . "/pkguploads/{$time}_$sn";
if ($file["error"] != UPLOAD_ERR_OK) {
$this->status = static::ERR_UPLOAD_FAILED;