コード例 #1
0
ファイル: lib_scheduling.php プロジェクト: jingyexu/ezcast
function lib_scheduling_file_rmdir($dir)
{
    foreach (lib_scheduling_file_ls($dir) as $file) {
        if ($file == '.' || $file == '..') {
            continue;
        }
        if (is_dir($file)) {
            lib_scheduling_file_rmdir($dir . '/' . $file);
        } else {
            unlink($dir . '/' . $file);
        }
    }
    return rmdir($dir);
}
コード例 #2
0
ファイル: lib_scheduling.php プロジェクト: jingyexu/ezcast
/**
 * Read all the job in the given dir
 *
 * @param string $dir The enclosing dir
 * @return array All jobs contained in the directory
 */
function lib_scheduling_job_read_all($dir)
{
    $files = lib_scheduling_file_ls($dir);
    $jobs = array();
    foreach ($files as $file) {
        $jobs[] = lib_scheduling_job_read($file);
    }
    return $jobs;
}