| @@ 8-34 (lines=27) @@ | ||
| 5 | use Yarak\Config\Config; |
|
| 6 | use Yarak\Console\DirectoryCreator; |
|
| 7 | ||
| 8 | class ConsoleGenerate extends YarakCommand |
|
| 9 | { |
|
| 10 | /** |
|
| 11 | * Configure the command. |
|
| 12 | */ |
|
| 13 | protected function configure() |
|
| 14 | { |
|
| 15 | $this->setName('console:generate') |
|
| 16 | ->setDescription('Generate the console directory structure.') |
|
| 17 | ->setHelp( |
|
| 18 | 'This command will create all the console directories and files necessary for the Yarak console componet to run.' |
|
| 19 | ); |
|
| 20 | } |
|
| 21 | ||
| 22 | /** |
|
| 23 | * Handle the command. |
|
| 24 | */ |
|
| 25 | protected function handle() |
|
| 26 | { |
|
| 27 | $creator = new DirectoryCreator( |
|
| 28 | Config::getInstance($this->configArray), |
|
| 29 | $this->getOutput() |
|
| 30 | ); |
|
| 31 | ||
| 32 | $creator->create(); |
|
| 33 | } |
|
| 34 | } |
|
| 35 | ||
| @@ 8-34 (lines=27) @@ | ||
| 5 | use Yarak\Config\Config; |
|
| 6 | use Yarak\DB\DirectoryCreator; |
|
| 7 | ||
| 8 | class DBGenerate extends YarakCommand |
|
| 9 | { |
|
| 10 | /** |
|
| 11 | * Configure the command. |
|
| 12 | */ |
|
| 13 | protected function configure() |
|
| 14 | { |
|
| 15 | $this->setName('db:generate') |
|
| 16 | ->setDescription('Generate the database directory structure.') |
|
| 17 | ->setHelp( |
|
| 18 | 'This command will create all the database directories and files necessary for yarak to run.' |
|
| 19 | ); |
|
| 20 | } |
|
| 21 | ||
| 22 | /** |
|
| 23 | * Handle the command. |
|
| 24 | */ |
|
| 25 | protected function handle() |
|
| 26 | { |
|
| 27 | $creator = new DirectoryCreator( |
|
| 28 | Config::getInstance($this->configArray), |
|
| 29 | $this->getOutput() |
|
| 30 | ); |
|
| 31 | ||
| 32 | $creator->create(); |
|
| 33 | } |
|
| 34 | } |
|
| 35 | ||