public static function runMe(&$params, $debug = true)
 {
     $path = driverCommand::getModPath('pharinix_mod_file_manager');
     include_once $path . 'drivers/fileManager.php';
     $resp = array();
     $roots = driverFileManager::getRoots();
     foreach ($roots as $root) {
         $resp[] = $root->getPath();
     }
     return $resp;
 }
 public static function runMe(&$params, $debug = true)
 {
     $path = driverCommand::getModPath('pharinix_mod_file_manager');
     include_once $path . 'drivers/fileManager.php';
     $resp = array();
     $roots = driverFileManager::getRoots();
     foreach ($roots as $root) {
         $total = disk_total_space($root->getRealpath());
         $free = disk_free_space($root->getRealpath());
         $percentage = ($total - $free) * 100 / $total;
         $resp[] = array('path' => $root->getPath(), 'used' => $total - $free, 'total' => $total, 'used_percent' => round($percentage, 2));
     }
     return $resp;
 }
 public static function runMe(&$params, $debug = true)
 {
     $path = driverCommand::getModPath('pharinix_mod_file_manager');
     include_once $path . 'drivers/fileManager.php';
     $params = array_merge(array('path' => '', 'inline' => true), $params);
     $file = driverFileManager::getByPath($params['path']);
     if ($file != null) {
         /*header("Content-type: ".$file->getMimetype());
           header("Content-Disposition:inline;filename=\"".$file->getName()."\"");
           header('Content-Length: ' . $file->fileSize());
           //header("Cache-control: private"); //use this to open files directly                     
           readfile($file->getRealpath());*/
         self::downloadFile($file, 32 * 1024, true);
         exit;
     } else {
         header("HTTP/1.0 404 Not Found");
     }
 }
 public static function getMimeTypes()
 {
     if (count(self::$mimeTypes) == 0) {
         $s = array();
         $modPath = driverCommand::getModPath('pharinix_mod_file_manager');
         $lines = @explode("\n", @file_get_contents($modPath . 'assets/mimetypes.txt'));
         foreach ($lines as $x) {
             if (isset($x[0]) && $x[0] !== '#' && preg_match_all('#([^\\s]+)#', $x, $out) && isset($out[1]) && ($c = count($out[1])) > 1) {
                 for ($i = 1; $i < $c; $i++) {
                     $s[$out[1][$i]] = $out[1][0];
                 }
             }
         }
         return $s;
     }
     return self::$mimeTypes;
 }