Subversion Repositories php-qbpwcf

Rev

Rev 3 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3 Rev 226
Line 1... Line 1...
1
#!/usr/bin/php
1
#!/usr/bin/php
2
<?php
2
<?php
3
 
3
 
4
/*
4
/*
5
	QBPWCF, Quick Build PHP website Component base on Fedora Linux.
5
	QBPWCF, Quick Build PHP website Component base on Fedora Linux.
6
    Copyright (C) 2015~2024 Min-Jhin,Chen
6
    Copyright (C) 2014~2025 MIN ZHI, CHEN
7
 
7
 
8
    This file is part of QBPWCF.
8
    This file is part of QBPWCF.
9
 
9
 
10
    QBPWCF is free software: you can redistribute it and/or modify
10
    QBPWCF is free software: you can redistribute it and/or modify
11
    it under the terms of the GNU General Public License as published by
11
    it under the terms of the GNU General Public License as published by
Line 17... Line 17...
17
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
    GNU General Public License for more details.
18
    GNU General Public License for more details.
19
 
19
 
20
    You should have received a copy of the GNU General Public License
20
    You should have received a copy of the GNU General Public License
21
    along with QBPWCF.  If not, see <http://www.gnu.org/licenses/>.
21
    along with QBPWCF.  If not, see <http://www.gnu.org/licenses/>.
22
    
22
 
23
*/
23
*/
24
 
24
 
25
/*
25
/*
26
說明:
26
說明:
27
連線到 \qbpwcf\sock::unixDomainSockServer 建立的 unix doamin socket 並傳送訊息,取得回應.
27
連線到 \qbpwcf\sock::unixDomainSockServer 建立的 unix doamin socket 並傳送訊息,取得回應.
Line 63... Line 63...
63
	#結束執行,回傳shell 1.
63
	#結束執行,回傳shell 1.
64
	exit(1);
64
	exit(1);
65
 
65
 
66
	}#if end
66
	}#if end
67
 
67
 
68
#設置 include path 
68
#設置 include path
69
set_include_path($output[0].PATH_SEPARATOR.get_include_path());
69
set_include_path($output[0].PATH_SEPARATOR.get_include_path());
70
 
70
 
71
#匯入外部套件
71
#匯入外部套件
72
include("allInOne.php");
72
include("allInOne.php");
73
 
73
 
74
#說明函式
74
#說明函式
75
function help(){
75
function help(){
76
 
76
 
77
	#印出指令說明
77
	#印出指令說明
78
	echo "Usage of ".basename(__FILE__).":".PHP_EOL; 
78
	echo "Usage of ".basename(__FILE__).":".PHP_EOL;
79
	echo "--sock unix domain socket 的位置與名稱.".PHP_EOL;
79
	echo "--sock unix domain socket 的位置與名稱.".PHP_EOL;
80
	echo "--json 要傳送進去的訊息.".PHP_EOL;
80
	echo "--json 要傳送進去的訊息.".PHP_EOL;
81
	echo "--raw 要直接傳送的字串訊息".PHP_EOL; 
81
	echo "--raw 要直接傳送的字串訊息".PHP_EOL;
82
	
82
 
83
	#結束執行
83
	#結束執行
84
	exit;
84
	exit;
85
 
85
 
86
	}#function help end
86
	}#function help end
87
 
87
 
Line 109... Line 109...
109
#如果解析參數失敗
109
#如果解析參數失敗
110
if($parseArgu["status"]==="false")
110
if($parseArgu["status"]==="false")
111
{
111
{
112
	#印出結果
112
	#印出結果
113
	var_dump($parseArgu);
113
	var_dump($parseArgu);
114
	
114
 
115
	#結束執行
115
	#結束執行
116
	exit(1);
116
	exit(1);
117
	
117
 
118
}#if end
118
}#if end
119
 
119
 
120
#檢查參數
120
#檢查參數
121
#函式說明:
121
#函式說明:
122
#檢查必填與可省略參數,可省略參數可指定預設要給與什麼數值內容。
122
#檢查必填與可省略參數,可省略參數可指定預設要給與什麼數值內容。
Line 169... Line 169...
169
#若執行失敗
169
#若執行失敗
170
if($checkArguments["status"]==="false"){
170
if($checkArguments["status"]==="false"){
171
 
171
 
172
	#印出結果
172
	#印出結果
173
	var_dump($checkArguments);
173
	var_dump($checkArguments);
174
	
174
 
175
	#結束執行
175
	#結束執行
176
	exit(1);
176
	exit(1);
177
 
177
 
178
	}#if end
178
	}#if end
179
 
179
 
180
#若檢查不通過
180
#若檢查不通過
181
if($checkArguments["passed"]==="false"){
181
if($checkArguments["passed"]==="false"){
182
 
182
 
183
	#印出結果
183
	#印出結果
184
	var_dump($checkArguments);
184
	var_dump($checkArguments);
185
	
185
 
186
	#結束執行
186
	#結束執行
187
	exit(1);
187
	exit(1);
188
 
188
 
189
	}#if end
189
	}#if end
190
 
190
 
Line 248... Line 248...
248
#若執行失敗
248
#若執行失敗
249
if($unixDomainSockClient["status"]==="false"){
249
if($unixDomainSockClient["status"]==="false"){
250
 
250
 
251
	#印出結果
251
	#印出結果
252
	var_dump($unixDomainSockClient);
252
	var_dump($unixDomainSockClient);
253
	
253
 
254
	#結束執行
254
	#結束執行
255
	exit(1);
255
	exit(1);
256
 
256
 
257
	}#if end
257
	}#if end
258
	
258
 
259
#印出取得的內容
259
#印出取得的內容
260
echo $unixDomainSockClient["content"];
-
 
261
260
echo $unixDomainSockClient["content"];
-
 
261