-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathengine
55 lines (46 loc) · 894 Bytes
/
engine
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
<?php
require __DIR__.'/core/singapura/autoloader.php';
use Core\Singapura\Maker;
$function = $argv[1];
if(count($argv) > 2)
$param = $argv[2];
else
$param = null;
if(function_exists($function))
$function($param);
else
echo "Invalid function, please check your spelling";
function run_server($host_port)
{
if($host_port == null)
$host_port = "localhost:8000";
echo "\nListening on ".$host_port."\n" ;
exec('php -S '. $host_port.' -t public');
}
function create_controller($class_name)
{
$maker = new Maker();
$create = $maker->create_controller($class_name);
if($create)
{
echo "Successfully created controller";
}
else
{
echo "File Already Exists";
}
}
function create_model($class_name)
{
$maker = new Maker();
$create = $maker->create_model($class_name);
if($create)
{
echo "Successfully created model";
}
else
{
echo "File Already Exists";
}
}
?>