hacky rename function - as php seems to have broken theirs
authorAlan <alan@roojs.com>
Wed, 30 Mar 2022 08:30:36 +0000 (16:30 +0800)
committerAlan <alan@roojs.com>
Wed, 30 Mar 2022 08:30:36 +0000 (16:30 +0800)
System.php

index fbd0428..25d36c0 100644 (file)
@@ -626,4 +626,19 @@ class System
         }
         return $files;
     }
+    /**
+     * rename - which uses unix mv 
+     *
+     * @param    string  $src source file
+     * @param    string  $dest  destination location
+     * @static
+      */
+    static function rename($src, $dest)
+    {
+        if (file_exists($src)) {
+            trigger_error("Rename source location does not exist",E_FATAL);
+        }
+        $cmd = System::which('mv') . ' ' . escapeshellarg($src) . ' ' . escapeshellarg($dest);
+    }
+    
 }
\ No newline at end of file