Exemplo n.º 1
0
 public static function write($input, $output)
 {
     $path = self::_parseScheduleFilePath($input);
     $jobs = array();
     if (file_exists($path)) {
         require $path;
         $jobs = Scheduler::instance()->parse();
         if (!empty($jobs)) {
             array_unshift($jobs, "#BEGIN DEFINE CRON JOBS FROM:{$path}");
             array_push($jobs, "#END DEFINE CRON JOBS FROM:{$path}");
         }
     }
     self::_writeCrontab(array_merge(self::_parseJobsWhichCanNotRemove($input), $jobs), $input);
     $output->writeln('<info>Crontab file has been written</info>');
 }