本文整理汇总了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');
}
示例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']);
}
示例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}");
}
示例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}");
}
示例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');
}
示例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;
}
示例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}");
}
示例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]);
}
}
示例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}");
}
示例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);
}
示例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');
}
}
}
示例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];
}
示例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);
}
示例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');
}
示例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')]);
}
}