Daily laravel-20160712| Schedule

Source: Internet
Author: User
 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 Php       Executablefinder)->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 a new artisan command//Suport the HHVM, good/** * Add a new command event to the S     Chedule.  *   * @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: $k EY. ' ='.        (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 in the schedule that is 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 of the events on the schedule that is due.} At last, this is a events schedule, which was set Bigset get bigget and change the params
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.