-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathartisan
More file actions
29 lines (26 loc) · 762 Bytes
/
artisan
File metadata and controls
29 lines (26 loc) · 762 Bytes
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
<?php
const DEFAULT_PORT = 7000;
if(count($argv) > 1) {
switch($argv[1]) {
case "serve":
serve();
break;
case "help":
help();
break;
default:
echo "Command not found. Try using 'php artisan help'";
}
}else{
serve();
}
function help() {
echo "=== Commands ===\r\n";
echo "php artisan help This will show the help page of the artisan command\r\n";
echo "php artisan serve This will start a local server on port " . DEFAULT_PORT . " hosting your API\r\n";
echo "\r\n";
}
function serve() {
shell_exec("php -S localhost:" . DEFAULT_PORT);
}
?>