Added option to delete project #340
This commit is contained in:
parent
419fabd80a
commit
0b3cb1c302
|
@ -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();
|
||||
}
|
||||
);
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue