Skip to content

Commit d646f9d

Browse files
committed
MAGETWO-38219: Bug Contribution
Merge remote-tracking branch 'ogresCE/MAGETWO-36367-fix-messages-setup-cli' into PR_Branch
2 parents e7eb5a3 + 5d9a867 commit d646f9d

24 files changed

+68
-46
lines changed

app/code/Magento/User/Model/UserValidationRules.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ class UserValidationRules
2929
public function addUserInfoRules(\Magento\Framework\Validator\Object $validator)
3030
{
3131
$userNameNotEmpty = new NotEmpty();
32-
$userNameNotEmpty->setMessage(__('Please enter a user name.'), \Zend_Validate_NotEmpty::IS_EMPTY);
32+
$userNameNotEmpty->setMessage(__('User Name is a required field.'), \Zend_Validate_NotEmpty::IS_EMPTY);
3333
$firstNameNotEmpty = new NotEmpty();
34-
$firstNameNotEmpty->setMessage(__('Please enter a first name.'), \Zend_Validate_NotEmpty::IS_EMPTY);
34+
$firstNameNotEmpty->setMessage(__('First Name is a required field.'), \Zend_Validate_NotEmpty::IS_EMPTY);
3535
$lastNameNotEmpty = new NotEmpty();
36-
$lastNameNotEmpty->setMessage(__('Please enter a last name.'), \Zend_Validate_NotEmpty::IS_EMPTY);
36+
$lastNameNotEmpty->setMessage(__('Last Name is a required field.'), \Zend_Validate_NotEmpty::IS_EMPTY);
3737
$emailValidity = new EmailAddress();
3838
$emailValidity->setMessage(__('Please enter a valid email.'), \Zend_Validate_EmailAddress::INVALID);
3939

bin/magento

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,16 @@
55
* See COPYING.txt for license details.
66
*/
77

8+
use Magento\Framework\AppInterface;
9+
810
try {
911
require __DIR__ . '/../app/bootstrap.php';
1012
if (PHP_SAPI == 'cli') {
1113
// For Cli we are using our customized error handler
1214
$handler = new \Magento\Framework\App\ErrorHandler();
1315
set_error_handler([$handler, 'handler']);
1416

15-
$application = new Magento\Framework\Console\Cli('Magento CLI');
17+
$application = new Magento\Framework\Console\Cli('Magento CLI', AppInterface::VERSION);
1618
$application->run();
1719
}
1820

setup/src/Magento/Setup/Console/Command/AbstractMaintenanceCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ protected function configure()
5353
self::INPUT_KEY_IP,
5454
null,
5555
InputOption::VALUE_IS_ARRAY | InputOption::VALUE_REQUIRED,
56-
'Allowed IP addresses'
56+
"Allowed IP addresses (use 'none' to clear allowed IP list)"
5757
),
5858
];
5959
$this->setDefinition($options);

setup/src/Magento/Setup/Console/Command/AbstractModuleCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
121121
$output->writeln('<info>- ' . implode("\n- ", $modulesToChange) . '</info>');
122122
$output->writeln('');
123123
$output->writeln(
124-
'<info>To make sure that the enabled modules are properly registered,'
124+
'<info>To make sure the modules are properly enabled,'
125125
. " run 'setup:upgrade'.</info>"
126126
);
127127
} else {

setup/src/Magento/Setup/Console/Command/AbstractSetupCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ protected function configure()
2727
null,
2828
InputOption::VALUE_REQUIRED,
2929
'Add to any command to customize Magento initialization parameters' . PHP_EOL .
30-
"For example: 'MAGE_MODE=developer&MAGE_DIRS[base][path]" .
31-
"=/var/www/example.com&MAGE_DIRS[cache][path]=/var/tmp/cache'"
30+
'For example: "MAGE_MODE=developer&MAGE_DIRS[base][path]' .
31+
'=/var/www/example.com&MAGE_DIRS[cache][path]=/var/tmp/cache"'
3232
);
3333
}
3434
}

setup/src/Magento/Setup/Console/Command/AdminUserCreateCommand.php

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public function __construct(InstallerFactory $installerFactory, UserValidationRu
4545
protected function configure()
4646
{
4747
$this->setName('admin:user:create')
48-
->setDescription('Creates admin user')
48+
->setDescription('Creates an administrator')
4949
->setDefinition($this->getOptionsList());
5050
parent::configure();
5151
}
@@ -62,7 +62,9 @@ protected function execute(InputInterface $input, OutputInterface $output)
6262
}
6363
$installer = $this->installerFactory->create(new ConsoleLogger($output));
6464
$installer->installAdminUser($input->getOptions());
65-
$output->writeln('<info>Created admin user ' . $input->getOption(AdminAccount::KEY_USER) . '</info>');
65+
$output->writeln(
66+
'<info>Created Magento administrator user named ' . $input->getOption(AdminAccount::KEY_USER) . '</info>'
67+
);
6668
}
6769

6870
/**
@@ -73,11 +75,21 @@ protected function execute(InputInterface $input, OutputInterface $output)
7375
public function getOptionsList()
7476
{
7577
return [
76-
new InputOption(AdminAccount::KEY_USER, null, InputOption::VALUE_REQUIRED, 'Admin user'),
77-
new InputOption(AdminAccount::KEY_PASSWORD, null, InputOption::VALUE_REQUIRED, 'Admin password', ''),
78-
new InputOption(AdminAccount::KEY_EMAIL, null, InputOption::VALUE_REQUIRED, 'Admin email'),
79-
new InputOption(AdminAccount::KEY_FIRST_NAME, null, InputOption::VALUE_REQUIRED, 'Admin first name'),
80-
new InputOption(AdminAccount::KEY_LAST_NAME, null, InputOption::VALUE_REQUIRED, 'Admin last name'),
78+
new InputOption(AdminAccount::KEY_USER, null, InputOption::VALUE_REQUIRED, '(Required) Admin user'),
79+
new InputOption(AdminAccount::KEY_PASSWORD, null, InputOption::VALUE_REQUIRED, '(Required) Admin password'),
80+
new InputOption(AdminAccount::KEY_EMAIL, null, InputOption::VALUE_REQUIRED, '(Required) Admin email'),
81+
new InputOption(
82+
AdminAccount::KEY_FIRST_NAME,
83+
null,
84+
InputOption::VALUE_REQUIRED,
85+
'(Required) Admin first name'
86+
),
87+
new InputOption(
88+
AdminAccount::KEY_LAST_NAME,
89+
null,
90+
InputOption::VALUE_REQUIRED,
91+
'(Required) Admin last name'
92+
),
8193
];
8294
}
8395

@@ -95,7 +107,10 @@ public function validate(InputInterface $input)
95107
->setLastname($input->getOption(AdminAccount::KEY_LAST_NAME))
96108
->setUsername($input->getOption(AdminAccount::KEY_USER))
97109
->setEmail($input->getOption(AdminAccount::KEY_EMAIL))
98-
->setPassword($input->getOption(AdminAccount::KEY_PASSWORD));
110+
->setPassword(
111+
$input->getOption(AdminAccount::KEY_PASSWORD) === null
112+
? '' : $input->getOption(AdminAccount::KEY_PASSWORD)
113+
);
99114

100115
$validator = new \Magento\Framework\Validator\Object;
101116
$this->validationRules->addUserInfoRules($validator);

setup/src/Magento/Setup/Console/Command/ConfigSetCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ protected function configure()
6060
$options = $this->configModel->getAvailableOptions();
6161

6262
$this->setName('setup:config:set')
63-
->setDescription('Sets deployment configuration')
63+
->setDescription('Creates or modifies the deployment configuration')
6464
->setDefinition($options);
6565

6666
parent::configure();

setup/src/Magento/Setup/Console/Command/DbDataUpgradeCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ protected function configure()
6161
protected function execute(InputInterface $input, OutputInterface $output)
6262
{
6363
if (!$this->deploymentConfig->isAvailable()) {
64-
$output->writeln("<info>No information is available: the application is not installed.</info>");
64+
$output->writeln("<info>No information is available: the Magento application is not installed.</info>");
6565
return;
6666
}
6767
$installer = $this->installFactory->create(new ConsoleLogger($output));

setup/src/Magento/Setup/Console/Command/DbSchemaUpgradeCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ protected function configure()
6161
protected function execute(InputInterface $input, OutputInterface $output)
6262
{
6363
if (!$this->deploymentConfig->isAvailable()) {
64-
$output->writeln("<info>No information is available: the application is not installed.</info>");
64+
$output->writeln("<info>No information is available: the Magento application is not installed.</info>");
6565
return;
6666
}
6767
$installer = $this->installFactory->create(new ConsoleLogger($output));

setup/src/Magento/Setup/Console/Command/DbStatusCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public function __construct(ObjectManagerProvider $objectManagerProvider, Deploy
5050
protected function configure()
5151
{
5252
$this->setName('setup:db:status')
53-
->setDescription('Checks if update of DB schema or data is required');
53+
->setDescription('Checks if DB schema or data requires upgrade');
5454
parent::configure();
5555
}
5656

@@ -60,7 +60,7 @@ protected function configure()
6060
protected function execute(InputInterface $input, OutputInterface $output)
6161
{
6262
if (!$this->deploymentConfig->isAvailable()) {
63-
$output->writeln("<info>No information is available: the application is not installed.</info>");
63+
$output->writeln("<info>No information is available: the Magento application is not installed.</info>");
6464
return;
6565
}
6666
/** @var DbVersionInfo $dbVersionInfo */

0 commit comments

Comments
 (0)