rougin /
combustor
| 1 | <?php |
||
| 2 | |||
| 3 | namespace Rougin\Combustor\Commands; |
||
| 4 | |||
| 5 | use Symfony\Component\Console\Input\InputInterface; |
||
| 6 | use Symfony\Component\Console\Output\OutputInterface; |
||
| 7 | |||
| 8 | use Rougin\Combustor\Common\File; |
||
| 9 | use Rougin\Combustor\Common\Tools; |
||
| 10 | use Rougin\Combustor\Common\Commands\InstallCommand; |
||
| 11 | |||
| 12 | /** |
||
| 13 | * Install Wildfire Command |
||
| 14 | * |
||
| 15 | * Installs Wildfire for CodeIgniter |
||
| 16 | * |
||
| 17 | * @package Combustor |
||
| 18 | * @author Rougin Gutib <[email protected]> |
||
| 19 | */ |
||
| 20 | class InstallWildfireCommand extends InstallCommand |
||
| 21 | { |
||
| 22 | /** |
||
| 23 | * @var string |
||
| 24 | */ |
||
| 25 | protected $library = 'wildfire'; |
||
| 26 | |||
| 27 | /** |
||
| 28 | * Executes the command. |
||
| 29 | * |
||
| 30 | * @param \Symfony\Component\Console\Input\InputInterface $input |
||
| 31 | * @param \Symfony\Component\Console\Output\OutputInterface $output |
||
| 32 | * @return object|\Symfony\Component\Console\Output\OutputInterface |
||
| 33 | */ |
||
| 34 | 18 | protected function execute(InputInterface $input, OutputInterface $output) |
|
| 35 | { |
||
| 36 | 18 | $this->addLibrary('wildfire'); |
|
| 37 | |||
| 38 | 18 | $template = $this->renderer->render('Libraries/Wildfire.tpl'); |
|
| 39 | 18 | $wildfire = new File(APPPATH . 'libraries/Wildfire.php'); |
|
|
0 ignored issues
–
show
Bug
introduced
by
Loading history...
|
|||
| 40 | |||
| 41 | 18 | $wildfire->putContents($template); |
|
| 42 | 18 | $wildfire->close(); |
|
| 43 | |||
| 44 | 18 | Tools::ignite(); |
|
| 45 | |||
| 46 | 18 | $message = 'Wildfire is now installed successfully!'; |
|
| 47 | |||
| 48 | 18 | return $output->writeln('<info>' . $message . '</info>'); |
|
| 49 | } |
||
| 50 | } |
||
| 51 |