$number OR $range_stop < $number) { continue; } } if($mod && ($number-$range_start)%$mod != 0) { continue; } return TRUE; } return FALSE; } function crontab_match($line) { $parts = preg_split('/[\40\t]+/', $line, 6); // Minutes part - skip // Hour part if(!crontab_field($parts[1], date('H'))) { return FALSE; } // Day part if(!crontab_field($parts[2], date('j'))) { return FALSE; } // Month part if(!crontab_field($parts[3], date('n'))) { return FALSE; } // Weekday part if(!crontab_field($parts[4], date('w'))) { return FALSE; } return $parts[5]; } function launch($file) { return include($file); } function crontab_parse($dir) { chdir($dir); $done = FALSE; $file = file('crontab'); foreach($file as $line) { $line = trim($line); if(empty($line) || substr($line, 0, 1)=='#') continue; $ret = crontab_match($line); if($ret) { if(!$done) echo "\n"; launch($ret); $done = TRUE; } } if(!$done) { echo NOT; } chdir('..'); } chdir(dirname(__FILE__)); $dirs = glob('./*', GLOB_ONLYDIR); foreach($dirs as $dir) { if(file_exists($dir.'/crontab')) { echo MAINSTAR.'Moduł '.basename($dir).NORMAL; crontab_parse($dir); } } echo "\n"; ?>