每天laravel-20160712|Schedule
程序员文章站
2024-02-07 15:26:28
...
events[] = $event = new CallbackEvent($callback, $parameters); return $event; }// get a instance about the event function ,and add it to the events array. /** * Add a new Artisan command event to the schedule. * * @param string $command * @param array $parameters * @return \Illuminate\Console\Scheduling\Event */ public function command($command, array $parameters = []) { $binary = ProcessUtils::escapeArgument((new PhpExecutableFinder)->find(false)); // change argument if (defined('HHVM_VERSION')) { $binary .= ' --php'; } if (defined('ARTISAN_BINARY')) { $artisan = ProcessUtils::escapeArgument(ARTISAN_BINARY); } else { $artisan = 'artisan'; } return $this->exec("{$binary} {$artisan} {$command}", $parameters); }// the author said this is a new artisan command // suport the HHVM ,good /** * Add a new command event to the schedule. * * @param string $command * @param array $parameters * @return \Illuminate\Console\Scheduling\Event */ public function exec($command, array $parameters = []) { if (count($parameters)) { $command .= ' '.$this->compileParameters($parameters); }// prepare the command. $this->events[] = $event = new Event($command);// add the instance to the compileParameters return $event; }// Add a new command event to the schedule /** * Compile parameters for a command. * * @param array $parameters * @return string */ protected function compileParameters(array $parameters) { return collect($parameters)->map(function ($value, $key) { return is_numeric($key) ? $value : $key.'='.(is_numeric($value) ? $value : ProcessUtils::escapeArgument($value)); })->implode(' '); }// compile or change the parameters for you want. /** * Get all of the events on the schedule. * * @return array */ public function events() { return $this->events; }// big _get /** * Get all of the events on the schedule that are due. * * @param \Illuminate\Contracts\Foundation\Application $app * @return array */ public function dueEvents($app) { return array_filter($this->events, function ($event) use ($app) { return $event->isDue($app); }); }// a super big _get function // this can get all the events on the schedule that are due.}// at last ,this is a events schedule, that be set bigset get bigget and change the params
推荐阅读
-
飞猪app怎么每天领60M流量? 飞猪app领流量的技巧
-
[李景山php]每天laravel-20160906|Dispatcher-6
-
每天一个linux命令(30): chown命令详解
-
每天laravel-20160819| Container -22
-
LVM 类型的 Storage Pool - 每天5分钟玩转 OpenStack(8)_PHP教程
-
shell初步之:mysql每天定时倒出本地数据,替换远程数据库数据_MySQL
-
利用crontab系统每天定时备份MySQL数据库
-
php依据时间段查询每天的数据
-
PyQt5每天必学之创建窗口居中效果
-
撩课-Java每天5道面试题第13天