From: Vincent Vanwaelscappel Date: Mon, 13 Feb 2023 14:37:04 +0000 (+0100) Subject: wip #5725 @0.25 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=8ec1af01708beaa06d1680bf359e4d687488cee7;p=fluidbook_distantstorage.git wip #5725 @0.25 --- diff --git a/app/src/Tools.php b/app/src/Tools.php index 9e76bae..995bc50 100644 --- a/app/src/Tools.php +++ b/app/src/Tools.php @@ -42,4 +42,13 @@ class Tools { protected static function _args($args, $defaults = []) { return array_merge($defaults, $args); } + + public static function rmdir($args) { + $path = preg_replace('/\/+/', '/', $args['path']); + $componants = count(explode('/', $path)); + if ($componants < 3) { + return; + } + `rm -rf $path`; + } } \ No newline at end of file diff --git a/app/tools.php b/app/tools.php index 93dc285..264eb92 100644 --- a/app/tools.php +++ b/app/tools.php @@ -6,6 +6,7 @@ require_once __DIR__ . "/vendor/autoload.php"; $f = $_POST['function']; if (is_callable([Tools::class, $f])) { + $res=''; try { $res = Tools::$f($_POST); } catch (Exception $e) {