]> _ Git - fluidbook_distantstorage.git/commitdiff
wip #5725 @0.25
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 13 Feb 2023 14:37:04 +0000 (15:37 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 13 Feb 2023 14:37:04 +0000 (15:37 +0100)
app/src/Tools.php
app/tools.php

index 9e76bae520cf58109f3b1440ed9bffc63de5487f..995bc5039d656e6c1c0677d88e5d4a40e1b0991d 100644 (file)
@@ -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
index 93dc285f23a50e74eea0b2bb69ce6422b1d5b575..264eb92d599d9c49590311d6f99b0b0e0fe9d7ae 100644 (file)
@@ -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) {