mirror of
https://github.com/hauke68/Magallanes.git
synced 2026-09-05 17:08:56 +02:00
PHPStorm refactoring.
This commit is contained in:
@@ -21,10 +21,10 @@ use Mage\Console;
|
||||
class InitCommand extends AbstractCommand
|
||||
{
|
||||
|
||||
/**
|
||||
* Command for Initalize a new Configuration Proyect
|
||||
* @see \Mage\Command\AbstractCommand::run()
|
||||
*/
|
||||
/**
|
||||
* Command for Initalize a new Configuration Proyect
|
||||
* @see \Mage\Command\AbstractCommand::run()
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
$configDir = getcwd() . '/.mage';
|
||||
@@ -61,32 +61,32 @@ class InitCommand extends AbstractCommand
|
||||
*/
|
||||
protected function getGeneralConfig()
|
||||
{
|
||||
// Assamble Global Settings
|
||||
$projectName = $this->getConfig()->getParameter('name', '');
|
||||
$notificationEmail = $this->getConfig()->getParameter('email', '');
|
||||
$notificationEnabled = ($notificationEmail != '') ? 'true' : 'false';
|
||||
// Assamble Global Settings
|
||||
$projectName = $this->getConfig()->getParameter('name', '');
|
||||
$notificationEmail = $this->getConfig()->getParameter('email', '');
|
||||
$notificationEnabled = ($notificationEmail != '') ? 'true' : 'false';
|
||||
|
||||
$globalSettings = str_replace(
|
||||
array(
|
||||
'%projectName%',
|
||||
'%notificationEmail%',
|
||||
'%notificationEnabled%',
|
||||
'%loggingEnabled%',
|
||||
'%maxlogs%',
|
||||
'%ssh_needs_tty%',
|
||||
),
|
||||
array(
|
||||
$projectName,
|
||||
$notificationEmail,
|
||||
$notificationEnabled,
|
||||
'true',
|
||||
30,
|
||||
'false'
|
||||
),
|
||||
$this->getGeneralConfigTemplate()
|
||||
);
|
||||
$globalSettings = str_replace(
|
||||
array(
|
||||
'%projectName%',
|
||||
'%notificationEmail%',
|
||||
'%notificationEnabled%',
|
||||
'%loggingEnabled%',
|
||||
'%maxlogs%',
|
||||
'%ssh_needs_tty%',
|
||||
),
|
||||
array(
|
||||
$projectName,
|
||||
$notificationEmail,
|
||||
$notificationEnabled,
|
||||
'true',
|
||||
30,
|
||||
'false'
|
||||
),
|
||||
$this->getGeneralConfigTemplate()
|
||||
);
|
||||
|
||||
return $globalSettings;
|
||||
return $globalSettings;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -95,14 +95,14 @@ class InitCommand extends AbstractCommand
|
||||
*/
|
||||
protected function getGeneralConfigTemplate()
|
||||
{
|
||||
$template = '# global settings' . PHP_EOL
|
||||
. 'name: %projectName%' . PHP_EOL
|
||||
. 'email: %notificationEmail%' . PHP_EOL
|
||||
. 'notifications: %notificationEnabled%' . PHP_EOL
|
||||
. 'logging: %loggingEnabled%' . PHP_EOL
|
||||
. 'maxlogs: %maxlogs%' . PHP_EOL
|
||||
. 'ssh_needs_tty: %ssh_needs_tty%' . PHP_EOL;
|
||||
$template = '# global settings' . PHP_EOL
|
||||
. 'name: %projectName%' . PHP_EOL
|
||||
. 'email: %notificationEmail%' . PHP_EOL
|
||||
. 'notifications: %notificationEnabled%' . PHP_EOL
|
||||
. 'logging: %loggingEnabled%' . PHP_EOL
|
||||
. 'maxlogs: %maxlogs%' . PHP_EOL
|
||||
. 'ssh_needs_tty: %ssh_needs_tty%' . PHP_EOL;
|
||||
|
||||
return $template;
|
||||
return $template;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user