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