Adding verification to the install and update commands to check whether PHPCI is installed.
This commit is contained in:
parent
e7033bfa23
commit
e8abdfcb17
2 changed files with 37 additions and 0 deletions
|
|
@ -48,8 +48,30 @@ class UpdateCommand extends Command
|
|||
*/
|
||||
protected function execute(InputInterface $input, OutputInterface $output)
|
||||
{
|
||||
$this->verifyInstalled($output);
|
||||
|
||||
$output->writeln('Updating PHPCI database.');
|
||||
|
||||
// Update the database:
|
||||
$gen = new \b8\Database\Generator(\b8\Database::getConnection(), 'PHPCI', './PHPCI/Model/Base/');
|
||||
$gen->generate();
|
||||
|
||||
$output->writeln('<info>Done!</info>');
|
||||
}
|
||||
|
||||
protected function verifyInstalled(OutputInterface $output)
|
||||
{
|
||||
if (!file_exists(PHPCI_DIR . 'PHPCI/config.yml')) {
|
||||
$output->writeln('<error>PHPCI does not appear to be installed.</error>');
|
||||
$output->writeln('<error>Please install PHPCI via phpci:install instead.</error>');
|
||||
die;
|
||||
}
|
||||
|
||||
$content = file_get_contents(PHPCI_DIR . 'PHPCI/config.yml');
|
||||
if (empty($content)) {
|
||||
$output->writeln('<error>PHPCI does not appear to be installed.</error>');
|
||||
$output->writeln('<error>Please install PHPCI via phpci:install instead.</error>');
|
||||
die;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue