-
Notifications
You must be signed in to change notification settings - Fork 0
/
craftsman
executable file
·57 lines (51 loc) · 1.9 KB
/
craftsman
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
#!/usr/bin/env php
<?php
use Craftsman\Commands\Generators\Controller as Generator_Controller;
use Craftsman\Commands\Generators\Model as Generator_Model;
use Craftsman\Commands\Generators\Migration as Generator_Migration;
use Craftsman\Commands\Generators\Seeder as Generator_Seeder;
use Craftsman\Commands\Migrations\Info as Migration_Info;
use Craftsman\Commands\Migrations\Version as Migration_Version;
use Craftsman\Commands\Migrations\Latest as Migration_Latest;
use Craftsman\Commands\Migrations\Rollback as Migration_Rollback;
use Craftsman\Commands\Migrations\Reset as Migration_Reset;
use Craftsman\Commands\Migrations\Refresh as Migration_Refresh;
use Craftsman\Commands\Seeder;
use Symfony\Component\Console\Application;
/**
* CLI Codeigniter Crafstman
*
* @author David Sosa Valdes <https://github.com/davidsosavaldes>
* @license MIT License
* @link https://github.com/davidsosavaldes/Craftsman
* @copyright Copyright (c) 2016, David Sosa Valdes.
*/
// Set to run indefinitely if needed
set_time_limit(0);
define('CRAFTSMANPATH', __DIR__.DIRECTORY_SEPARATOR);
// Create a Codeigniter instance
$CI = require CRAFTSMANPATH.'src/_ci_instance.php';
// Add the user database configuration according to main application directory.
$CI->load->add_package_path('application/');
// Add the Craftsman extended packages
$CI->load->add_package_path(CRAFTSMANPATH.'src/Extend');
// Set the commands
$commands = array(
new Generator_Migration(),
new Generator_Controller(),
new Generator_Model(),
new Generator_Seeder(),
new Migration_Info($CI),
new Migration_Version($CI),
new Migration_Latest($CI),
new Migration_Rollback($CI),
new Migration_Reset($CI),
new Migration_Refresh($CI),
new Seeder()
);
$application = new Application('Craftsman', '3.5.3');
// Add the default commands
foreach ($commands as $key => $command) {
$application->add($command);
}
$application->run();