本文整理汇总了PHP中Illuminate\Console\Command::call方法的典型用法代码示例。如果您正苦于以下问题:PHP Command::call方法的具体用法?PHP Command::call怎么用?PHP Command::call使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Illuminate\Console\Command
的用法示例。
在下文中一共展示了Command::call方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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']);
}
示例2: 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;
}
示例3: fire
/**
* Fire the install script.
*
* @param Command $command
*
* @return mixed
*/
public function fire(Command $command)
{
if ($command->option('verbose')) {
$command->call('key:generate');
$command->call('api:key-generate');
return;
}
$command->callSilent('key:generate');
$command->callSilent('api:key-generate');
}
示例4: call
public function call($command, array $arguments = [], array $options = [])
{
foreach ($options as $option => $value) {
$arguments['--' . $option] = $value;
}
return parent::call($command, $arguments);
}
示例5: generateResources
/**
* Generate some resources.
*/
public function generateResources()
{
$this->console->call('module:make-seed', ['name' => $this->getName(), 'module' => $this->getName(), '--master' => true]);
$this->console->call('module:make-provider', ['name' => $this->getName() . 'ServiceProvider', 'module' => $this->getName(), '--master' => true]);
$this->console->call('module:make-controller', ['controller' => $this->getName() . 'Controller', 'module' => $this->getName()]);
$this->console->call('module:make-backend-controller', ['controller' => $this->getName() . 'Controller', 'module' => $this->getName()]);
}
示例6: 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')]);
}
}
示例7: generateRequest
/**
* Generate request classes.
*/
public function generateRequest()
{
if (!$this->confirm('Do you want to create form request classes?')) {
return;
}
foreach (['Create', 'Update'] as $request) {
$name = $this->getPrefix('/') . $this->getEntities() . '/' . $request . Str::studly($this->getEntity()) . 'Request';
$this->console->call('generate:request', ['name' => $name, '--scaffold' => true, '--auth' => true, '--rules' => $this->console->option('fields'), '--force' => $this->console->option('force')]);
}
}
示例8: handle
/**
* Handle the command.
*
* @param AddonCollection $addons
*/
public function handle(AddonCollection $addons)
{
foreach ($this->paths as $path) {
$options = ['--path' => $path];
if ($this->command->option('force')) {
$options['--force'] = true;
}
if ($this->command->option('pretend')) {
$options['--pretend'] = true;
}
if ($this->command->option('seed')) {
$options['--seed'] = true;
}
if ($database = $this->command->option('database')) {
$options['--database'] = $database;
}
$this->command->call('migrate', $options);
}
return;
}
示例9: handle
/**
* Handle the command.
*
* @param AddonCollection $addons
*/
public function handle(AddonCollection $addons)
{
foreach ($addons->enabled() as $addon) {
$options = ['--addon' => $addon->getNamespace()];
if ($this->command->option('force')) {
$options['--force'] = true;
}
if ($this->command->option('pretend')) {
$options['--pretend'] = true;
}
if ($this->command->option('seed')) {
$options['--seed'] = true;
}
if ($database = $this->command->option('database')) {
$options['--database'] = $database;
}
$this->command->call('migrate', $options);
}
return;
}
示例10: 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');
}
示例11: fire
/**
* Fire the install script
* @param Command $command
* @return mixed
*/
public function fire(Command $command)
{
$this->command = $command;
// Publish asgard configs
if ($this->command->option('verbose')) {
$this->command->call('vendor:publish', ['--provider' => 'Modules\\Core\\Providers\\CoreServiceProvider']);
} else {
$this->command->callSilent('vendor:publish', ['--provider' => 'Modules\\Core\\Providers\\CoreServiceProvider']);
}
if (!$this->checkIsInstalled()) {
return $this->command->error('No user driver was installed. Please check the presence of a Service Provider');
}
$this->publish();
$this->configure();
$this->migrate();
$this->seed();
$this->createFirstUser();
if ($this->command->option('verbose')) {
$command->info($this->driver . ' succesfully configured');
}
}
示例12: 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]);
}
}
示例13: enable
/**
* Fire demo scripts.
*
* @param Command $command
*
* @return bool
*/
public function enable(Command $command)
{
$command->call('down');
foreach ($this->scripts as $script) {
try {
$this->app->make($script)->fire($command);
} catch (\Exception $e) {
$command->error($e->getMessage());
return false;
}
}
$command->call('up');
return true;
}
示例14: fire
/**
* Clear the settings cache, and backup the databases.
*
* @param \Illuminate\Console\Command $command
*
* @return void
*/
public function fire(Command $command)
{
$command->line('Clearing settings cache...');
$this->cache->clear();
$command->line('Settings cache cleared!');
$command->line('Backing up database...');
try {
$command->call('db:backup', ['--compression' => 'gzip', '--database' => $this->config->get('database.default'), '--destination' => 'local', '--destinationPath' => Carbon::now()->format('Y-m-d H.i.s'), '--no-interaction' => true]);
} catch (Exception $e) {
$command->error($e->getMessage());
$command->line('Backup skipped!');
}
$command->line('Backup completed!');
}
示例15: runMigrationRollback
/**
* Executa rollback das migrations do modulo
*
* @param array $rollback
* @param Command $command
* @return array|bool
*/
private static function runMigrationRollback(array $rollback, Command $command)
{
$errors = [];
if (array_key_exists(Strings::ROLLBACK_MIGRATE, $rollback)) {
if ($rollback[Strings::ROLLBACK_MIGRATE] == true) {
try {
$command->call(Strings::COMMAND_ROLLBACK);
if (array_key_exists(Strings::ROLLBACK_LOADED_MODULE_TAG, $rollback)) {
if (count(DB::table(Strings::TABLE_PROJECT_MODULES)->where(Strings::TABLE_PROJECT_MODULES_NAME, $rollback[Strings::ROLLBACK_LOADED_MODULE_TAG])->first()) > 0) {
$errors[] = Strings::ERROR_MIGRATE_ROLLBACK;
}
} else {
$errors[] = Strings::ERROR_GET_MODULE_NAME_FROM_DB;
}
} catch (Exception $e) {
$errors[] = Strings::ERROR_DATABASE_CONECTION;
}
}
}
return !empty($errors) ? $errors : true;
}