1
0
Fork 0
mirror of synced 2024-06-02 10:54:44 +12:00

Added option to delete project #340

This commit is contained in:
Eldad Fux 2020-05-26 22:12:40 +03:00
parent 419fabd80a
commit 0b3cb1c302
4 changed files with 4 additions and 14 deletions

View file

@ -429,14 +429,6 @@ $utopia->delete('/v1/projects/:projectId')
throw new Exception('Failed to remove project from DB', 500);
}
// Delete all DBs
$consoleDB->deleteNamespace($project->getId());
// Optimize DB?
// Delete all storage files
// Delete all storage cache
$response->noContent();
}
);

View file

@ -49,9 +49,7 @@ class DeletesV1
$uploads = new Local(APP_STORAGE_UPLOADS.'/app-'.$document->getId());
$cache = new Local(APP_STORAGE_CACHE.'/app-'.$document->getId());
// Optimize DB?
// Delete all storage files
// Delete all storage cache
$uploads->delete($uploads->getRoot(), true);
$cache->delete($cache->getRoot(), true);
}
}

View file

@ -99,7 +99,7 @@ abstract class Device
*
* @return bool
*/
abstract public function delete(string $path, bool $recrusive):bool;
abstract public function delete(string $path, bool $recrusive = false):bool;
/**
* Returns given file path its size.

View file

@ -161,7 +161,7 @@ class Local extends Device
$files = glob($path.'*', GLOB_MARK); // GLOB_MARK adds a slash to directories returned
foreach($files as $file) {
$this->delete($file);
$this->delete($file, true);
}
rmdir($path);