当前位置: 首页>>代码示例>>PHP>>正文


PHP Console\Command类代码示例

本文整理汇总了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>');
 }
开发者ID:defenestrator,项目名称:groid,代码行数:13,代码来源:InstallResources.php

示例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];
 }
开发者ID:klsandbox,项目名称:SmsManager,代码行数:26,代码来源:SmsSender.php

示例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;
 }
开发者ID:aindong,项目名称:pluggables,代码行数:15,代码来源:PluggableMakeHandler.php

示例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);
 }
开发者ID:SocietyCMS,项目名称:Core,代码行数:15,代码来源:ModuleSeeders.php

示例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');
 }
开发者ID:Houbsi,项目名称:Core,代码行数:13,代码来源:SetAppKey.php

示例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>');
 }
开发者ID:defenestrator,项目名称:groid,代码行数:14,代码来源:InstallHttp.php

示例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;
 }
开发者ID:acmadi,项目名称:modules-1,代码行数:13,代码来源:ModuleGeneratorHandler.php

示例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();
 }
开发者ID:SocietyCMS,项目名称:Core,代码行数:19,代码来源:RequirementsCheck.php

示例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.");
 }
开发者ID:fabriciorabelo,项目名称:modules,代码行数:19,代码来源:ModuleMakeControllerHandler.php

示例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.");
 }
开发者ID:acmadi,项目名称:modules-1,代码行数:19,代码来源:ModuleSeedMakerHandler.php

示例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');
 }
开发者ID:czim,项目名称:laravel-pxlcms,代码行数:12,代码来源:AnalyzerContext.php

示例12: generate

 /**
  * Runs the generator.
  */
 public function generate()
 {
     $this->createModulesDir();
     $this->createFolders();
     $this->createFiles();
     $this->console->info("Your module [{$this->name}] has been generated.");
 }
开发者ID:mrterryh,项目名称:modules,代码行数:10,代码来源:ModuleGenerator.php

示例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}");
     }
 }
开发者ID:ncrousset,项目名称:gencrud,代码行数:13,代码来源:GenCrud.php

示例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;
 }
开发者ID:ralphowino,项目名称:restful-api-helper,代码行数:12,代码来源:Configurer.php

示例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}");
     }
 }
开发者ID:bryanashley,项目名称:framework,代码行数:13,代码来源:Seeder.php


注:本文中的Illuminate\Console\Command类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。