您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

每天laravel-20160712|Schedule

2024/5/14 18:35:28发布39次查看
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
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product