This repository has been archived by the owner on Nov 21, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcli
executable file
·98 lines (87 loc) · 3.17 KB
/
cli
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
#!/usr/bin/env php
<?php
class Colors {
public const HEADER = "\033[95m",
OKBLUE = "\033[94m",
OKGREEN = "\033[92m",
WARNING = "\033[93m",
FAIL = "\033[91m",
ENDC = "\033[0m",
BOLD = "\033[1m",
UNDERLINE = "\033[4m",
RED = "\033[31m",
BLUE = "\033[34m",
YELLOW = "\033[33m",
TURQUIOUS = "\033[36m",
GREEN = "\033[32m",
BLINK = "\033[5m",
BG_RED = "\033[41m",
BG_BLUE = "\033[44m",
BG_GREEN = "\033[42m",
BG_YELLOW = "\033[43m",
BG_BLACK = "\033[40m";
public const PREFIX_DONE = "\033[92m᮰ Done\033[0m: ",
PREFIX_WARN = "\033[93m᮰ WARNING\033[0m: ",
PREFIX_ERROR = "\033[91m᮰ ERROR\033[0m: ";
}
/*
Deprecated color vars: */
$HEADER = "\033[95m";
$OKBLUE = "\033[94m";
$OKGREEN = "\033[92m";
$WARNING = "\033[93m";
$FAIL = "\033[91m";
$ENDC = "\033[0m";
$BOLD = "\033[1m";
$UNDERLINE = "\033[4m";
$RED = "\033[31m";
$BLUE = "\033[34m";
$YELLOW = "\033[33m";
$TURQUIOUS = "\033[36m";
$GREEN = "\033[32m";
$BLINK = "\033[5m";
$BG_RED = "\033[41m";
$BG_BLUE = "\033[44m";
$BG_GREEN = "\033[42m";
$BG_YELLOW = "\033[43m";
$BG_BLACK = "\033[40m";
$OKTEXT = $GREEN."᮰ Done".$ENDC.": ";
$done_prefix = "\033[92m᮰ Done\033[0m: ";
$warn_prefix = "\033[93m᮰ WARNING\033[0m: ";
$error_prefix = "\033[91m᮰ ERROR\033[0m: ";
echo "\n\n ".$BLUE."U".$GREEN."L".$TURQUIOUS."O".$RED."L".$YELLOW."E".$RED.$BOLD." CLI".$ENDC."\n\n\n";
spl_autoload_register(function($class) {
@include_once "./".str_replace("\\","/",$class).".php";
});
if (!isset($argv[1])) exit("Function not found :(!");
if ($argv[1] == "server") {
require "ulole/CLI/Server.php";
} elseif ($argv[1] == "compile") {
require "ulole/CLI/Compile.php";
ulole\CLI\Compile::compileDir('resources/compile/css/compile.json', "resources/compile/css");
echo "\n".$OKTEXT."Bundled all files from config file: resources/compile/css/compile.json";
ulole\CLI\Compile::compileDir('resources/compile/js/compile.json', "resources/compile/js");
echo "\n".$OKTEXT."Bundled all files from config file: resources/compile/js/compile.json";
ulole\CLI\Compile::compileViews("resources/compile/views/", "resources/views/");
echo "\n".$OKTEXT."Compiled all view.php files in directory resources/compile/views/\n";
} elseif ($argv[1] == "run") {
require "app/ulole/CustomCLI.php";
$CLI->run($argv[1], $argv);
} elseif ($argv[1] == "devtest") {
require "ulole/CLI/DevTests.php";
$CLI->run($argv[1], $argv);
} elseif ($argv[1] == "repl") {
require "ulole/CLI/repl.php";
} elseif ($argv[1] == "generate") {
require "ulole/CLI/Generate.php";
$CLI->run($argv[1], $argv);
} elseif ($argv[1] == "migrate") {
require "ulole/CLI/Migrate.php";
$CLI->run($argv[1], $argv);
} elseif ($argv[1] == "modules") {
require "ulole/CLI/Modules.php";
$CLI->run($argv[1], $argv);
}
else {
echo "\033[91m᮰ ERROR\033[0m: Function \"".$argv[1]."\" not found!\n\n";
}