forked from leafsphp/leafAPI
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathConsole.php
More file actions
52 lines (43 loc) · 1.45 KB
/
Copy pathConsole.php
File metadata and controls
52 lines (43 loc) · 1.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<?php
namespace Config;
use Symfony\Component\Console\Application;
class Console {
private $app;
public function __construct() {
$this->app = new Application("Leaf API Framework v1.1.0");
// Random Commands
$this->app->add(new \Config\Command\ServerCommand());
$this->app->add(new \Config\Command\ConsoleCommand());
// Generate Commands
$this->app->add(new \Config\Command\GenerateTemplateCommand());
$this->app->add(new \Config\Command\GenerateMigrationCommand());
$this->app->add(new \Config\Command\GenerateModelCommand());
$this->app->add(new \Config\Command\GenerateHelperCommand());
$this->app->add(new \Config\Command\GenerateControllerCommand());
$this->app->add(new \Config\Command\GenerateSeedCommand());
// Delete Commands
$this->app->add(new \Config\Command\DeleteModelCommand());
$this->app->add(new \Config\Command\DeleteTemplateCommand());
$this->app->add(new \Config\Command\DeleteControllerCommand());
// Database Commands
$this->app->add(new \Config\Command\DatabaseMigrationCommand());
$this->app->add(new \Config\Command\DatabaseRollbackCommand());
$this->app->add(new \Config\Command\DatabaseSeedCommand());
}
/**
* Register a custom command
*
* @param Symfony\Component\Console\Command\Command $command: Command to run
*
* @return void
*/
public function registerCustom($command) {
$this->app->add($command);
}
/**
* Run the console app
*/
public function run() {
$this->app->run();
}
}