$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); return $parts[5]; } $included = array(); function launch($file) { global $included; if(!in_array($file, $included)) { $included[] = $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__)); $dir = './'.$_SERVER['argv'][1]; if(file_exists($dir.'/crontab')) { echo MAINSTAR.'Moduł '.basename($dir).NORMAL; crontab_parse($dir); } echo "\n"; ?>