imi / robo-pack
iMi Package Tasks for Robo task runner
2.6.0
2019-06-28 12:56 UTC
Requires
- consolidation/robo: ^1.0.0
- imi/robo-laravel: ^1.0.0
- imi/robo-run: ^2.0.0
- imi/robo-typo3: ^1.3.2
- imi/robo-wpcli: ^1.0.0
- nordcode/robo-parameters: ^1.1
README
We use this pack internally to unify the setup of our projects.
Robo-pack is included the .phar of iRobo
Included Tasks
The robo-pack includes
- WPCli wrappers Commands
- Typo3(console) wrappers Commands
- Laravel wrappers Commands
Check the above links for documentation.
Utility Function: askSetup
$this->askSetup()
Asks basic setup questions that apply to most if not all of our projects. This is the database configuration and the base URL. Smart guesses are made based on our heuristics.
- The live URL is supposed to be the directory name
- The database name shall be the directory name, special characters replaced by _
- The base URL is live URL and the host name appended
Returns an array with the keys
dbName
dbHost
dbUser
dbPassword
baseUrl
If you use place holders like #dbName#
, #dbHost#
and so on in the config file how can use the following to fill a config file:
$settings = $this->askSetup();
$this->taskFilesystemStack()->copy('app/etc/env.template.php', 'app/etc/env.php')->run();
foreach ( $settings as $key => $value ) {
if (strpos($key,'db') === 0) {
$this->taskReplaceInFile( 'app/etc/env.php' )->from( '#' . $key . '#' )->to( $value )->run();
}
}
In the future, such a code should also be included in roboPack