-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathignite
executable file
·67 lines (58 loc) · 1.65 KB
/
ignite
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/usr/bin/env php
<?php
use Dotenv\Dotenv;
use Symfony\Component\Console\Application;
require_once(__DIR__.'/cli/bootstrap.php');
/**
* CLI Codeigniter Crafstman
* Name changed to Ignite
*
* @author David Sosa Valdes <https://github.com/davidsosavaldes>
* @author Oteng Kwame Appiah Nti <https://github.com/otengkwame>
* @license MIT License
* @link https://github.com/davidsosavaldes/Craftsman
* @link https://github.com/otengkwame/Ignite
* @copyright Copyright (c) 2016, David Sosa Valdes.
* @copyright Copyright (c) 2017, Oteng Kwame Appiah Nti.
*/
try
{
$dotenv = new Dotenv(getcwd(), '.env');
$dotenv->load();
$dotenv->required(['CI_BASEPATH','CI_APPPATH'])->notEmpty();
define('IGNITEPATH', __DIR__.'/');
}
catch (Exception $e)
{
exit(preg_replace('/\s+/', ' ', $e->getMessage()));
}
$generators = [
new CLI\Commands\Generators\Controller,
new CLI\Commands\Generators\Model,
new CLI\Commands\Generators\Migration,
new CLI\Commands\Generators\Seeder,
new CLI\Commands\Generators\Interfaces
];
$migrations = [
new CLI\Commands\Migrations\Info,
new CLI\Commands\Migrations\Version,
new CLI\Commands\Migrations\Latest,
new CLI\Commands\Migrations\Rollback,
new CLI\Commands\Migrations\Reset,
new CLI\Commands\Migrations\Refresh
];
$general = [
new CLI\Commands\Serve,
new CLI\Commands\Console,
new CLI\Commands\Notes,
new CLI\Commands\Seeder,
new \CLI\Commands\Key
];
// Set the commands
$commands = array_merge($generators, $migrations, $general);
$application = new Application('Ignite', '1.0');
// Add the default commands
foreach ($commands as $key => $command) {
$application->add($command);
}
$application->run();