-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathartisan.php
More file actions
70 lines (56 loc) · 1.62 KB
/
artisan.php
File metadata and controls
70 lines (56 loc) · 1.62 KB
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
<?php
define('ROOT', dirname(__FILE__) . '/'); // 根目录
define("ACCESS", true);// 入口标识
// var_dump(ROOT);die;
require_once ROOT . "core/Loader.php";
require_once ROOT . "core/CoreFn.php";
core\App::initDir();
if (php_sapi_name() != 'cli')
die('使用错误');
// var_dump($argv);
if ($argv[1] == 'serve') {
echo 'http://localhost:9999';
exec("php -S localhost:9999 -t public/");
}
if ($argv[1] == 'index') {
exec("php public/index.php static index");
echo '更新完毕 http://www.my.com/index.html';
}
if ($argv[1] == 'contents') {
exec("php public/index.php static contents");
echo 'content更新完毕 http://www.my.com';
}
if ($argv[1] == 'q') {
if ($argv[2] == 'mail')
exec("php public/index.php queue sendmail", $data);
if ($argv[2] == 'other')
exec("php public/index.php queue sendmail", $data);
}
if ($argv[1] == 'mock') {
if ($argv[2] == 'comments')
exec("php public/index.php mock comments", $data);
if ($argv[2] == 'other')
exec("php public/index.php mock sendmail", $data);
}
use libs\Make;
if($argv[1] == 'make'){
$make = new Make;
// var_dump($make);die;;
if ($argv[2] == 'C'){
$make->controller($argv[3]);
echo $make->cdir . PHP_EOL;
}
if ($argv[2] == 'M'){
if(isset($argv[4]))
return $make->model($argv[3],$argv[4]);
else
$make->model($argv[3]);
echo $make->mdir . PHP_EOL;
}
if($argv[2] == 'G'){
if(isset($argv[4]))
$make->group($argv[3],$argv[4]);
else
$make->group($argv[3]);
}
}