本文整理汇总了PHP中Illuminate\Console\Command类的典型用法代码示例。如果您正苦于以下问题:PHP Command类的具体用法?PHP Command怎么用?PHP Command使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Command类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Create a new installer instance.
*
* @param \Illuminate\Console\Command $command
* @return void
*/
public function __construct($command)
{
$this->command = $command;
$this->command->line('Installing JavaScript & Less Assets: <info>✔</info>');
$this->command->line('Installing Language Files: <info>✔</info>');
$this->command->line('Installing Views: <info>✔</info>');
}
示例2: getMessage
private function getMessage($route, $target_id, \Illuminate\Database\Eloquent\Model $user, \Illuminate\Console\Command $command)
{
$url = $route . '/' . $user->id . '/' . $target_id;
$request = Request::create($url, 'GET');
Input::initialize([]);
if ($command->option('verbose')) {
$command->comment('route:' . $route);
}
$item = $this->router->dispatch($request)->getOriginalContent();
if ($item === null) {
return;
}
$view = 'sms.' . $route;
$message = view($view, ['item' => $item]);
if (Config::get('sms-manager.prefix')) {
$message = Config::get('sms-manager.prefix') . $message;
}
$adminPhone = Config::get('sms-manager.admin_phone');
$receiver_number = $adminPhone ? $adminPhone : $user->phone;
$to = $user->name;
// HACKHACK: Needs to update the database instead
if ($receiver_number[0] != '6') {
$receiver_number = '6' . $receiver_number;
}
return (object) ['to' => $to, 'receiver_number' => $receiver_number, 'message' => $message];
}
示例3: generate
/**
* Generate pluggable folders and files.
*
* @param \Aindong\Pluggables\Console\PluggableMakeCommand $console
*
* @return bool
*/
public function generate(Command $console)
{
$this->generateFolders();
$this->generateGitkeep();
$this->generateFiles();
$console->info("Pluggable [{$this->name}] has been created successfully.");
return true;
}
示例4: fire
/**
* Fire the install script.
*
* @param Command $command
*
* @return mixed
*/
public function fire(Command $command)
{
if ($command->option('verbose')) {
$command->blockMessage('Seeds', 'Running the module seeds ...', 'comment');
}
$this->demoSeedCoreModules($command);
$this->demoSeedAdditionalModules($command);
}
示例5: fire
/**
* Fire the install script
* @param Command $command
* @return mixed
*/
public function fire(Command $command)
{
if ($command->option('verbose')) {
$command->call('key:generate');
return;
}
$command->callSilent('key:generate');
}
示例6: __construct
/**
* Create a new installer instance.
*
* @param \Illuminate\Console\Command $command
* @return void
*/
public function __construct($command)
{
$this->command = $command;
$this->command->line('Updating Routes File: <info>✔</info>');
$this->command->line('Updating Controllers: <info>✔</info>');
$this->command->line('Updating Middleware: <info>✔</info>');
$this->command->line('Updating HTTP Kernel: <info>✔</info>');
}
示例7: generate
/**
* @param Command $console
* @return bool
*/
protected function generate(Command $console)
{
$this->generateFolders();
$this->generateFiles();
$console->call('module:seed-make', array('module' => $this->name, 'name' => $this->Name, '--master'));
$console->call('module:controller', array('module' => $this->name, 'controller' => $this->Name . 'Controller'));
$console->info("Module [{$this->Name}] has been created successfully.");
return true;
}
示例8: fire
/**
* Fire the install script.
*
* @param Command $command
*
* @throws Exception
*
* @return mixed
*/
public function fire(Command $command)
{
$this->command = $command;
if ($command->option('verbose')) {
$command->blockMessage('Requirements', 'Checking System Requirements ...', 'comment');
}
$this->checkPHPVersion();
$this->checkExtensions();
$this->showResults();
}
示例9: fire
/**
* Fire off the handler.
*
* @param \Illuminate\Console\Command $console
* @param string $slug
* @param string $class
* @return bool
*/
public function fire(Command $console, $slug, $class)
{
$this->console = $console;
$this->moduleName = Str::studly($slug);
$this->className = studly_case($class);
if ($this->module->exists($slug)) {
$this->makeFile();
return $this->console->info("Created Module Controller: [{$slug}] " . $this->getFilename());
}
return $this->console->info("Module [{$slug}] does not exist.");
}
示例10: fire
/**
* Fire.
*
* @param Command $console
* @param $module
* @param $name
* @return mixed|void
*/
public function fire(Command $console, $module, $name)
{
$this->console = $console;
$this->moduleName = Str::studly($module);
$this->name = $name;
$this->Name = Str::studly($name);
if ($this->module->has($this->moduleName)) {
return $this->makeSeeder();
}
$console->error("Module [{$this->moduleName}] does not exists.");
}
示例11: isInteractive
/**
* Returns whether there is user interaction available
*
* @return array
*/
public function isInteractive()
{
if (is_null($this->command)) {
return false;
}
return !(bool) $this->command->option('auto');
}
示例12: generate
/**
* Runs the generator.
*/
public function generate()
{
$this->createModulesDir();
$this->createFolders();
$this->createFiles();
$this->console->info("Your module [{$this->name}] has been generated.");
}
示例13: call
/**
*
*
* @param string $class
* @return void
*/
public function call($class)
{
$this->resolve($class)->run();
if (isset($this->command)) {
$this->command->getOutput()->writeln("<info>Gencrud:</info> {$class}");
}
}
示例14: run
/**
* Run the list of enquires about the configurations
*
* @return array
*/
public function run()
{
foreach ($this->fields as $configuration => $value) {
$this->configurations[$configuration] = $this->origin->ask($value['question'], $value['default']);
}
return $this->configurations;
}
示例15: call
/**
* Seed the given connection from the given path.
*
* @param string $class
* @return void
*/
public function call($class)
{
$this->resolve($class)->__invoke();
if (isset($this->command)) {
$this->command->getOutput()->writeln("<info>Seeded:</info> {$class}");
}
}