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


PHP Command::option方法代码示例

本文整理汇总了PHP中Illuminate\Console\Command::option方法的典型用法代码示例。如果您正苦于以下问题:PHP Command::option方法的具体用法?PHP Command::option怎么用?PHP Command::option使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Illuminate\Console\Command的用法示例。


在下文中一共展示了Command::option方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: 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

示例2: seedAdminRole

 /**
  * @return mixed
  */
 public function seedAdminRole()
 {
     if ($this->command->option('verbose')) {
         return $this->command->call('db:seed', ['--class' => 'Modules\\User\\Database\\Seeders\\GroupSeedTableSeeder']);
     }
     return $this->command->callSilent('db:seed', ['--class' => 'Modules\\User\\Database\\Seeders\\GroupSeedTableSeeder']);
 }
开发者ID:SocietyCMS,项目名称:Core,代码行数:10,代码来源:AdminUserInstaller.php

示例3: handle

 /**
  * Handle the command.
  *
  * @param  Filesystem  $filesystem
  * @param  Application $application
  * @return string
  */
 public function handle(Filesystem $filesystem, Application $application)
 {
     $destination = $application->getResourcesPath('streams/lang');
     if (is_dir($destination) && !$this->command->option('force')) {
         return $this->command->error("{$destination} already exists.");
     }
     $filesystem->copyDirectory(__DIR__ . '/../../../../resources/lang', $destination);
     $this->command->info("Published {$destination}");
 }
开发者ID:huglester,项目名称:streams-platform,代码行数:16,代码来源:PublishTranslations.php

示例4: handle

 /**
  * Handle the command.
  *
  * @param  Filesystem  $filesystem
  * @param  Application $application
  * @return string
  */
 public function handle(Filesystem $filesystem, Application $application)
 {
     $destination = $application->getResourcesPath('addons/' . $this->addon->getVendor() . '/' . $this->addon->getSlug() . '-' . $this->addon->getType() . '/views');
     if (is_dir($destination) && !$this->command->option('force')) {
         $this->command->error("{$destination} already exists.");
         return;
     }
     $filesystem->copyDirectory($this->addon->getPath('resources/views'), $destination);
     $this->command->info("Published {$destination}");
 }
开发者ID:huglester,项目名称:streams-platform,代码行数:17,代码来源:PublishViews.php

示例5: fire

 /**
  * Fire the install script.
  *
  * @param Command $command
  *
  * @return mixed
  */
 public function fire(Command $command)
 {
     if ($command->option('verbose')) {
         $command->blockMessage('Themes', 'Publishing theme assets ...', 'comment');
     }
     if ($command->option('verbose')) {
         $command->call('stylist:publish');
         return;
     }
     $command->callSilent('stylist:publish');
 }
开发者ID:SocietyCMS,项目名称:Core,代码行数:18,代码来源:ThemeAssets.php

示例6: handle

 /**
  * Handle the command.
  *
  * @param Filesystem  $filesystem
  * @param Application $application
  * @return string
  */
 public function handle(Filesystem $filesystem, Application $application)
 {
     $shared = $this->command->option('shared') ? 'shared' : $application->getReference();
     $path = base_path("addons/{$shared}/{$this->vendor}/{$this->slug}-{$this->type}");
     $config = "{$path}/resources/config";
     $views = "{$path}/resources/views";
     $filesystem->makeDirectory($path, 0755, true, true);
     $filesystem->makeDirectory($views, 0755, true, true);
     $filesystem->makeDirectory($config, 0755, true, true);
     return $path;
 }
开发者ID:jacksun101,项目名称:streams-platform,代码行数:18,代码来源:MakeAddonPaths.php

示例7: handle

 /**
  * Handle the command.
  *
  * @param  Filesystem  $filesystem
  * @param  Application $application
  * @return string
  */
 public function handle(Filesystem $filesystem, Application $application)
 {
     $destination = $application->getResourcesPath('.env');
     if (!is_dir(dirname($destination))) {
         $filesystem->makeDirectory(dirname($destination), 0777, true, true);
     }
     if (is_file($destination) && !$this->command->option('force')) {
         return $this->command->error("{$destination} already exists.");
     }
     $filesystem->put($destination, '#EXAMPLE=foo');
     $this->command->info("Published {$destination}");
 }
开发者ID:huglester,项目名称:streams-platform,代码行数:19,代码来源:PublishEnv.php

示例8: 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');
     }
     foreach ($this->modules as $module) {
         if ($command->option('verbose')) {
             $command->call('module:seed', ['module' => $module]);
             continue;
         }
         $command->callSilent('module:seed', ['module' => $module]);
     }
 }
开发者ID:Houbsi,项目名称:Core,代码行数:18,代码来源:ModuleSeeders.php

示例9: handle

 /**
  * Handle the command.
  *
  * @param  Filesystem  $filesystem
  * @param  Application $application
  * @return string
  */
 public function handle(Filesystem $filesystem, Application $application)
 {
     $destination = $application->getResourcesPath('routes.php');
     if (!is_dir(dirname($destination))) {
         $filesystem->makeDirectory(dirname($destination), 0777, true, true);
     }
     if (is_file($destination) && !$this->command->option('force')) {
         return $this->command->error("{$destination} already exists.");
     }
     $content = "<?php\n\n// Route::get('/', function () {\n//     return view('welcome');\n// });\n";
     $filesystem->put($destination, $content);
     $this->command->info("Published {$destination}");
 }
开发者ID:huglester,项目名称:streams-platform,代码行数:20,代码来源:PublishRoutes.php

示例10: prepareOptions

 private function prepareOptions()
 {
     $options = ['fieldsFile', 'tableName', 'fromTable', 'save'];
     foreach ($options as $option) {
         $this->options[$option] = $this->commandObj->option($option);
     }
     if ($this->options['fromTable']) {
         if (!$this->options['tableName']) {
             $this->commandError('tableName required with fromTable option.');
             exit;
         }
     }
     $this->options['softDelete'] = config('infyom.laravel_generator.options.softDelete', true);
 }
开发者ID:CasperLaiTW,项目名称:laravel-generator,代码行数:14,代码来源:CommandData.php

示例11: fire

 /**
  * Fire the install script.
  *
  * @param Command $command
  *
  * @throws Exception
  *
  * @return mixed
  */
 public function fire(Command $command)
 {
     if (!$this->finder->isFile('.env')) {
         throw new Exception('SocietyCMS is not installed. Please run "php artisan society:install" first.');
     }
     if ($command->option('refresh') && !App::environment('demo')) {
         throw new Exception('Refresh option is only available in demo mode.');
     }
     if (!$command->option('force') && !$command->option('refresh')) {
         if (!$command->confirm('Are you sure you want to start Demo Mode?')) {
             throw new Exception('Demo Mode cancelled');
         }
     }
 }
开发者ID:SocietyCMS,项目名称:Core,代码行数:23,代码来源:ProtectInstallation.php

示例12: 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

示例13: 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

示例14: 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

示例15: generateLangResources

 /**
  * Generate request classes.
  */
 public function generateLangResources()
 {
     if (!$this->confirm('Do you want to create the language resource files?')) {
         return;
     }
     foreach ($this->getMainTables() as $table) {
         $this->console->call('generate:lang', ['name' => $this->getEntity($table), '--languages' => $this->console->option('languages'), '--translations' => $this->getLangTranslations($table), '--force' => $this->console->option('force')]);
     }
 }
开发者ID:mayconbordin,项目名称:laragen,代码行数:12,代码来源:ScaffoldGenerator.php


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