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


PHP Command::error方法代码示例

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


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

示例1: handle

 /**
  * Handle the command.
  *
  * @param Markdown $markdown
  */
 public function handle(Markdown $markdown)
 {
     $this->command->info(strip_tags($markdown->transform(file_get_contents(base_path('LICENSE.md')))));
     if (!$this->command->confirm('Do you agree to the provided license and terms of service?')) {
         $this->command->error('You must agree to the license and terms of service before continuing.');
         exit;
     }
 }
开发者ID:huglester,项目名称:streams-platform,代码行数:13,代码来源:ConfirmLicense.php

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

示例3: askDatabaseUsername

 /**
  * @param
  * @return string
  */
 protected function askDatabaseUsername()
 {
     do {
         $user = $this->command->ask('Enter your database username', 'root');
         if ($user == '') {
             $this->command->error('Database username is required');
         }
     } while (!$user);
     return $user;
 }
开发者ID:ruscon,项目名称:Core,代码行数:14,代码来源:ConfigureDatabase.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: handle

 /**
  * Handle the command.
  */
 public function handle()
 {
     $this->data->put('ADMIN_USERNAME', $this->command->ask('Enter the desired username for the admin user', env('ADMIN_USERNAME', 'admin')));
     $this->data->put('ADMIN_EMAIL', $this->command->ask('Enter the desired email for the admin user', env('ADMIN_EMAIL')));
     // Validate email.
     if (!filter_var($this->data->get('ADMIN_EMAIL'), FILTER_VALIDATE_EMAIL)) {
         $this->command->error('You must provide a valid email for the admin.');
         exit;
     }
     $this->data->put('ADMIN_PASSWORD', $this->command->ask('Enter the desired password for the admin user', env('ADMIN_PASSWORD')));
 }
开发者ID:huglester,项目名称:streams-platform,代码行数:14,代码来源:SetAdminData.php

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

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

示例8: fire

 /**
  * @param Command $console
  * @param $module
  * @param $name
  * @return mixed
  */
 public function fire(Command $console, $module, $name)
 {
     $this->console = $console;
     $this->moduleName = Str::studly($module);
     $this->modelName = $name;
     if (!$this->module->has($this->moduleName)) {
         $console->error("Module [{$this->moduleName}] does not exists.");
         return false;
     }
     if ($this->exists()) {
         $message = "Model [{$this->modelName}] is already exists on '{$this->moduleName}' module.";
         return $console->error($message);
     }
     return $this->generate();
 }
开发者ID:acmadi,项目名称:modules-1,代码行数:21,代码来源:ModuleModelHandler.php

示例9: fire

 public function fire($arguments, $options)
 {
     $instanceId = array_get($arguments, CommandRules::INSTANCE_ID);
     $logFile = array_get($arguments, CommandRules::LOGFILE);
     $user = array_get($options, CommandRules::USER);
     $keyFile = array_get($options, CommandRules::KEY_FILE);
     $host = $this->aws->getPublicDNSFromInstanceId($instanceId);
     if (is_null($host)) {
         $this->command->error('Error: Could not find Host from Instance ID. Please try again.');
     } else {
         $connection = $this->connectionFactory->createConnection($instanceId, $host, $user, $keyFile);
         $connection->run(array('tail -f ' . $logFile), function ($line) {
             $this->command->info($line);
         });
     }
 }
开发者ID:atyagi,项目名称:laravel-aws-ssh,代码行数:16,代码来源:EC2TailCommandController.php

示例10: error

 /**
  * Display error message with date and message, and log it
  * @param  string $message Error message to display & log
  */
 public function error($message)
 {
     // Log message
     $this->log($message, 'error');
     // Display message
     parent::error(date($this->timestampFormat) . ' ' . $message);
 }
开发者ID:PoxyDoxy,项目名称:lanager,代码行数:11,代码来源:BaseCommand.php

示例11: error

 /**
  * 输出错误信息,并记录日志
  *
  * @param string $message
  * @param bool $isExit
  * @return void
  */
 public function error($message, $isExit = true)
 {
     parent::error($message);
     Log::error($message, [__CLASS__]);
     if ($isExit) {
         exit;
     }
 }
开发者ID:popfeng,项目名称:zao,代码行数:15,代码来源:Command.php

示例12: publishFromModule

 /**
  * Publish assets form the specified module.
  *
  * @param $module
  */
 protected function publishFromModule($module)
 {
     if (!$this->module->has($module)) {
         $this->console->error("Module [{$module}] does not exist.");
         exit;
     }
     $this->filesystem->copyDirectory($this->getPublishingPath($module), $this->getDestinationPath($module));
     $this->console->info("Assets published from module : {$module}");
 }
开发者ID:chronokz,项目名称:modules,代码行数:14,代码来源:AssetPublisher.php

示例13: askForPasswordConfirmation

 /**
  * @return string
  */
 private function askForPasswordConfirmation()
 {
     do {
         $passwordConfirmation = $this->command->secret('Please confirm your password');
         if ($passwordConfirmation == '') {
             $this->command->error('Password confirmation is required');
         }
     } while (!$passwordConfirmation);
     return $passwordConfirmation;
 }
开发者ID:SocietyCMS,项目名称:Core,代码行数:13,代码来源:AdminUserInstaller.php

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

示例15: generate

 /**
  * Generate the module.
  */
 public function generate()
 {
     if ($this->module->has($name = $this->getName())) {
         $this->console->error("Module [{$name}] already exist!");
         return;
     }
     $this->generateFolders();
     $this->generateFiles();
     $this->generateResources();
     $this->console->info("Module [{$name}] created successfully.");
 }
开发者ID:chronokz,项目名称:modules,代码行数:14,代码来源:ModuleGenerator.php


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