-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Feature/UI enhancements #3835
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/UI enhancements #3835
Conversation
| 'db_password', | ||
| ]; | ||
| $code = "\n\n host(<info>'{{alias}}'</info>)"; | ||
| foreach ($params as $name) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we keep printing those code parts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like it was left over from development.
Always prints this:
host('your_hostname_here')
->set('sudo_password', '…')
->set('domain', '…')
->set('public_path', '…')
->set('php_version', '…')
->set('db_type', '…')
->set('db_user', '…')
->set('db_name', '…')
->set('db_password', '…');
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we keep printing those code parts?
Hi @antonmedv, I just noticed this code was put back in the master. Just curious, what's the purpose of printing those in the output?
Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So users can cope pase those and put into deploy.php.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If that's the case, I want to point out couple things.
We are printing lines for only $params array now. I split the $params array to $dbparams to aid in asking database info only if the database type is not none
So, if you need all the parameters output like before, I would modify it to:
$params = [
'sudo_password',
'domain',
'public_path',
'php_version',
'db_type',
];
$dbparams = [
'db_user',
'db_name',
'db_password',
];
$code = "\n\n host(<info>'{{alias}}'</info>)";
foreach (array_merge($params, $dbparams) as $name) {
$code .= "\n ->set(<info>'$name'</info>, <info>'…'</info>)";
}
$code .= ";\n\n";
writeln($code);
});
In this, the array_merge function will combine $params and $dbparams into a single array, which is then iterated over to generate the configuration code. This way, all parameters from both arrays will be included in the output.
Also, I think it would be helpful to include a message just before printing it.
For example, "To avoid entering parameters during script execution, include the following config with values in your deploy.php"
Also, I would be careful when including sudo password and database info in a config file. If the user publishes the config to a public repository, it won't be good.
Let me know what you think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good suggestions. PR?
* origin/master: (40 commits) Improve the configuration options console output in provision:configure (deployphp#3840) Update Craft CMS deploy recipe (deployphp#3839) [automatic] Update docs with bin/docgen Update provision.php Feature/UI enhancements (deployphp#3835) Hotfix/v7.4.0: Fixes caddyfile and realpath errors in provision:website (deployphp#3837) [automatic] Update docs with bin/docgen docs(recipe/shopware): add code syntax highlighting (deployphp#3834) [automatic] Update docs with bin/docgen docs(recipe/magento2): fix typo in conccurent (deployphp#3830) [automatic] Update docs with bin/docgen magento2 theme processing fix for 3786 (deployphp#3818) use md5 of task name for section id in gitlab ci (deployphp#3817) [automatic] Update docs with bin/docgen Magento 2: Changed upgrading database (deployphp#3812) [automatic] Update docs with bin/docgen Shopware: Added `deploy:update_code` (deployphp#3816) [automatic] Update docs with bin/docgen Update nodejs to LTS version (deployphp#3815) Update LICENSE ...
Bug fix: No bugs were fixed in this release.New feature: Add some UI enhancements for provision.
recipe/provision,recipe/laravel,provision/phprecipe/laravel] add default laravelpublic_pathconfig valueprovision/php] set defaultphp_versionfromcomposer.json(if available) in the ask promptrecipe/provision] remove unnecessary print lines forprovision:configurerecipe/provision] avoid prompt for database info if database type isnonerecipe/provision] add confirmation to continue provision in unsupported OSBC breaks: No backward compatibility breaks in this release.Tests added: No new tests were added in this release.Docs added: No new documentation was added in this release.