for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Redaxscript\Console\Command;
use Redaxscript\Console\Parser;
use Redaxscript\Installer;
/**
* children class to execute the migrate command
*
* @since 4.4.0
* @package Redaxscript
* @category Console
* @author Henry Ruhs
*/
class Migrate extends CommandAbstract
{
* array of the command
* @var array
protected $_commandArray =
[
'migrate' =>
'description' => 'Migrate command',
'argumentArray' =>
'database' =>
'description' => 'Migrate the database',
]
];
* run the command
* @param string $mode name of the mode
* @return string|null
public function run(string $mode = null) : ?string
$parser = new Parser($this->_request);
$parser->init($mode);
/* run command */
$argumentKey = $parser->getArgument(1);
$haltOnError = (bool)$parser->getOption('halt-on-error');
if ($argumentKey === 'database')
return $this->_database() ? $this->success() : $this->error($haltOnError);
}
return $this->getHelp();
* migrate the database
* @return bool
protected function _database() : bool
$installer = new Installer($this->_registry, $this->_request, $this->_language, $this->_config);
$installer->init();
return $installer->rawMigrate();