function lxfile_rm($file)
{
    $file = expand_real_root($file);
    log_filesys("Removing {$file}");
    if (lis_dir($file)) {
        return rmdir($file);
    } else {
        return unlink($file);
    }
}
Exemple #2
0
function do_recurse_dir($dir, $func)
{
    $list = lscandir($dir);
    if (!$list) {
        return;
    }
    foreach ($list as $file) {
        if ($file === "." || $file === "..") {
            continue;
        }
        $path = $dir . "/" . $file;
        if (lis_dir($path)) {
            do_recurse_dir($path, $func);
        }
        $func($path);
    }
}
Exemple #3
0
function remove_if_older_than_a_day_dir($dir, $day = 1)
{
    if (!lis_dir($dir)) {
        return;
    }
    $list = lscandir_without_dot($dir);
    foreach ($list as $l) {
        remove_if_older_than_a_day("{$dir}/{$l}", $day);
    }
}
Exemple #4
0
 static function getWebmailProgList()
 {
     $plist = lscandir_without_dot_or_underscore("__path_kloxo_httpd_root/webmail");
     foreach ($plist as $k => $v) {
         if ($v === 'img') {
             unset($plist[$k]);
         }
         if ($v === 'images') {
             unset($plist[$k]);
         }
         if ($v === 'disabled') {
             unset($plist[$k]);
         }
         if (!lis_dir("__path_kloxo_httpd_root/webmail/{$v}")) {
             unset($plist[$k]);
         }
     }
     return $plist;
 }