Subversion Repositories php-qbpwcf

Rev

Rev 226 | Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
3 liveuser 1
#!/usr/bin/php
2
<?php
3
 
4
/*
5
	QBPWCF, Quick Build PHP website Component base on Fedora Linux.
6
    Copyright (C) 2015~2024 Min-Jhin,Chen
7
 
8
    This file is part of QBPWCF.
9
 
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
12
    the Free Software Foundation, either version 3 of the License, or
13
    (at your option) any later version.
14
 
15
    QBPWCF is distributed in the hope that it will be useful,
16
    but WITHOUT ANY WARRANTY; without even the implied warranty of
17
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
    GNU General Public License for more details.
19
 
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/>.
22
 
23
*/
24
 
25
/*
26
 
27
說明:
28
終止指定的一個或多個程序,然後再啟動其程式.
29
 
30
*/
31
 
32
#指派命名空間
33
namespace qbpwcf;
34
 
35
#取得 lib path
36
exec("php -f ".escapeshellarg(pathinfo(__FILE__)["dirname"]."/libexec/folderOfUsrLib.php"),$output,$status);
37
 
38
#如果執行失敗
39
if($status!==0){
40
 
41
	#debug
42
	var_dump(__LINE__,$output);
43
 
44
	#結束執行,回傳shell 1.
45
	exit(1);
46
 
47
	}#if end
48
 
49
#儲存lib path
50
$folderOfUsrLib=$output[0];
51
 
52
#以該檔案的實際位置的 lib path 為 include path 首位
53
$output=array();
54
exec("cd ".escapeshellarg(pathinfo(__FILE__)["dirname"]."/../".$folderOfUsrLib."/qbpwcf").";pwd;",$output,$status);
55
 
56
#如果執行失敗
57
if($status!==0){
58
 
59
	#debug
60
	var_dump(__LINE__,$output);
61
 
62
	#結束執行,回傳shell 1.
63
	exit(1);
64
 
65
	}#if end
66
 
67
#設置 include path 
68
set_include_path($output[0].PATH_SEPARATOR.get_include_path());
69
 
70
#匯入外部套件
71
include("allInOne.php");
72
 
73
#函式說明:
74
#抓取命令列的參數.
75
#回傳結果:
76
#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
77
#$reuslt["error"],執行不正常結束的錯訊息陣列.
78
#$result["function"],當前執行的函式名稱.
79
#$result["argu"],使用的參數陣列.
80
#$result["content"],要回傳的參數陣列.
81
#$result["count"],參數的數量.
82
#必填參數:
83
#無
84
#可省略參數:
85
#$conf["echo"],"true"代表要將抓到的參數一個個印出來,"false"代表用回傳的方式,預設為"false".
86
#$conf["echo"]="false";
87
$conf=array();
88
$getArgu=cmd::getArgu($conf);
89
unset($conf);
90
 
91
#如果執行失敗
92
if($getArgu["status"]==="false"){
93
 
94
	#設置執行失敗
95
	$result["status"]="false";
96
 
97
	#設置執行錯誤訊息
98
	$result["error"]=$getArgu;
99
 
100
	#印出訊息
101
	var_dump($result);
102
 
103
	#結束執行
104
	exit;
105
 
106
	}#if end
107
 
108
#如果沒參數
109
if($getArgu["count"]===1){
110
 
111
	#印出用法
112
	#函式說明:
113
	#印出多行文字,結尾自動換行.
114
	#回傳的結果:
115
	#$result["status"],執行是否成功,"true"代表成功,"false"代表失敗.
116
	#$result["function"],當前執行的函數名稱.
117
	#$result["error"],錯誤訊息陣列.
118
	#必填的參數:
119
	#$conf["outputStringArray"],字串陣列,每行要印出的文字內容.
120
	$conf["outputStringArray"]=array();
121
	$conf["outputStringArray"][]="-h/--help 顯示本說明";
122
	$conf["outputStringArray"][]="--program2kill 要結束的特定程式關鍵字,若有多個則代表有多個程序要結束";
123
	$conf["outputStringArray"][]="--program2run 要執行的程式位置與名稱";
124
	$echoMultiLine=cmd::echoMultiLine($conf);
125
	unset($conf);
126
 
127
	#結束執行
128
	exit;
129
 
130
	}
131
 
132
#第一個參數
133
$firsArgu=$getArgu["content"][1];
134
 
135
#如果程式後面的參數爲 -h 或 --help 參
136
if($firsArgu==="-h" || $firsArgu==="--help"){
137
 
138
	#印出用法
139
	#函式說明:
140
	#印出多行文字,結尾自動換行.
141
	#回傳的結果:
142
	#$result["status"],執行是否成功,"true"代表成功,"false"代表失敗.
143
	#$result["function"],當前執行的函數名稱.
144
	#$result["error"],錯誤訊息陣列.
145
	#必填的參數:
146
	#$conf["outputStringArray"],字串陣列,每行要印出的文字內容.
147
	$conf["outputStringArray"]=array();
148
	$conf["outputStringArray"][]="-h/--help 顯示本說明";
149
	$conf["outputStringArray"][]="--program2kill 要結束的程式關鍵字";
150
	$conf["outputStringArray"][]="--program2run 要執行的程式位置與名稱";
151
	$echoMultiLine=cmd::echoMultiLine($conf);
152
	unset($conf);
153
 
154
	#結束執行
155
	exit;
156
 
157
	}
158
 
159
#函式說明:
160
#解析參數.
161
#回傳結果:
162
#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
163
#$reuslt["error"],執行不正常結束的錯訊息陣列.
164
#$result["function"],當前執行的函式名稱.
165
#$result["content"],解析好的參數陣列.
166
#$result["content"][$key][$i],參數 $key 的 $i+1 個參數數值內容.
167
#$result["program"],字串,執行的程式名稱.
168
#必填參數:
169
#無
170
#可省略參數:
171
#無
172
#備註:
173
#僅能在命令列底下執行.
174
#建議:
175
#以後可將參數 --a--b 的名稱與後面的數值 $value 存成 $result["a"]["b"][$i]=$value .
176
$conf=array();
177
$parseArgu=cmd::parseArgu($conf);
178
unset($conf);
179
 
180
#要終止的程式關鍵字
181
$programs2kill=$parseArgu["content"]["program2kill"];
182
 
183
#要執行的程式位置與名稱
184
$program2run=$parseArgu["content"]["program2run"][0];
185
 
186
#針對每個要中止程序的關鍵字
187
foreach($programs2kill as $program2kill){
188
 
189
	#透過 ps auxwf 檢查執行中的程式 pid
190
	#涵式說明:
191
	#呼叫shell執行系統命令,並取得回傳的內容.
192
	#回傳的結果:
193
	#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
194
	#$result["error"],錯誤訊息陣列.
195
	#$result["function"],當前執行的函數名稱.
196
	#$result["argu"],使用的參數.
197
	#$result["cmd"],執行的指令內容.
198
	#$result["fullCmd"],如果參數 $conf["inBackGround"] 為 "true" 則會回傳該值.
199
	#$result["output"],爲執行完二元碼後的輸出陣列,若 $conf["inBackGround"] 為 "true",則為當下的輸出.
200
	#$result["tmpFileOutput"],儲存輸出的暫存檔案名稱,若 $conf["inBackGround"] 為 "true" 則會回傳該值.
201
	#$result["running"],是否還在執行.
202
	#$result["pid"],pid.
203
	#$result["statusCode"],執行結束後的代碼.
204
	#必填的參數
205
	#$conf["command"],字串,要執行的指令與.
206
	$conf["command"]="ps";
207
	#$conf["fileArgu"],字串,變數__FILE__的內容.
208
	$conf["fileArgu"]=__FILE__;		
209
	#可省略參數:
210
	#$conf["argu"],陣列字串,指令搭配的參數,預設為空陣列.
211
	$conf["argu"]=array("auxwf","|","grep",$program2kill);
212
	#$conf["arguIsAddr"],陣列字串,指令搭配的哪些參數為路徑,為路徑的參數會進行轉換以便符合呼叫當前函數的位置,預設不指定,若有3個參數,其中第3個參數為路徑,則表示為array("false","false","true").
213
	#$conf["arguIsAddr"]=array();	
214
	#$conf["pre"],陣列,要在本指令前執行的每個指令與參數.
215
	#$conf["pre"][$i]["cmd"],字串,要在本指令前執行的第$i+1個指令.
216
	#$conf["pre"][$i]["param"],陣列字串,要在本指令前執行的第$i+1個指令的參數.
217
	#$conf["enablePrintDescription"],字串,是否要印出$conf["printDescription"]的內容,"true"代表要,"false"代表不要,預設為"false".
218
	$conf["enablePrintDescription"]="true";
219
	#$conf["printDescription"],字串,執行該外部程式前要印出來的的文字,預設為$conf["command"]的內容加上使用的$conf["argu"]參數.
220
	#$conf["printDescription"]="";
221
	#$conf["escapeshellarg"],字串,是否要啟用過濾參數,用了比較安全,但可能會出錯,"true"為啟用,"false"為不啟用,預設為"false".
222
	$conf["escapeshellarg"]="true";
223
	#$conf["username"],字串,要用什麼使用者來執行,預設為執行php的使用者,該參數不適用於apache環境.
224
	#$conf["username"]="";
225
	#$conf["password"],字串,root的使用者密碼,預設不使用密碼,該參數不適用於apache環境.
226
	#$conf["password"]="";
227
	#$conf["useScript"],字串,是否要啟用Linux的script指令來記錄輸出,"true"代表要,Fedora的selinux會擋住該操作;"false"代表不要,預設為"false".
228
	#$conf["useScript"]="";
229
	#$conf["logFilePath"],字串,當 $conf["useScript"] 為 "true" 時,輸出的內容要暫存到哪裡,預設為 "/tmp/.qbpwcf_tmp/external/callShell/".
230
	#$conf["logFilePath"]=".qbpwcf_tmp/external/callShell/";
231
	#$conf["inBackGround"],字串,是否要在背景執行,且不會等待程式執行結束再執行下一個指令,"true"代表是,"false"代表不要,預設為"false",如果$conf["command"]有用「;」區隔的多個指令將會出錯.
232
	#$conf["inBackGround"]="";
233
	#$conf["getErr"],字串,"true"代表將錯誤輸出變成標準輸出,反之"false"為不變動.
234
	#$conf["getErr"]="false";
235
	#備註:
236
	#不是所有指令都能用apache的身份執行,目前已知java,javac指令無法執行,使用root身份可能會被selinux阻擋.
237
	#參考資料:
238
	#exec=>http://php.net/manual/en/function.exec.php
239
	#escapeshellcmd=>http://php.net/manual/en/function.escapeshellcmd.php
240
	#escapeshellarg=>http://php.net/manual/en/function.escapeshellarg.php
241
	$callShell=external::callShell($conf);
242
	unset($conf);
243
 
244
	#如果執行失敗
245
	if($callShell["status"]==="false"){
246
 
247
		#設置執行失敗
248
		$result["status"]="false";
249
 
250
		#設置執行錯誤訊息
251
		$result["error"]=$getArgu;
252
 
253
		#印出訊息
254
		var_dump($result);
255
 
256
		#結束執行
257
		exit;
258
 
259
		}
260
 
261
	#取得輸出
262
	$output=$callShell["output"];
263
 
264
	#剔除有grep關鍵字的程式	
265
	#函式說明:
266
	#檢查多個字串中的每個字串是否有多個關鍵字
267
	#回傳的結果:
268
	#$result["status"],整體來說,執行是否成功,"true"代表執行成功,"false"代表執行失敗。
269
	#$result["function"],當前執行的函數名稱.
270
	#$result["error"],錯誤訊息.
271
	#$result["argu"],使用的參數.
272
	#$result["foundedTrueKey"],結果為"true"的被搜尋元素key陣列.
273
	#$result["foundedKeyWords"].找到的關鍵字.
274
	#$result["foundedFalseKey"],結果為"false"的被搜尋元素key陣列.
275
	#$result["foundedTrueKeyWords"],二維陣列,各個字串有找到的關鍵字陣列.
276
	#$result["foundedAll"],是否每個關鍵字都有找到,"true"代表每個都有找到,"false"代表沒有每個都找到.
277
	#必填的參數:
278
	$conf["keyWords"]=array("grep","rerunProgram.php");#想要搜尋的關鍵字
279
	$conf["stringArray"]=$output;#要被搜尋的字串內容陣列
280
	#可省略的參數:
281
	#$conf["completeEqual"]="true";#是否內容要完全符合,不能多出任何不符合的內容,預設為"false"不需要完全符合.
282
	$findManyKeyWordsFromManyString=search::findManyKeyWordsFromManyString($conf);
283
	unset($conf);
284
 
285
	#如果執行失敗
286
	if($findManyKeyWordsFromManyString["status"]==="false"){
287
 
288
		#設置執行失敗
289
		$result["status"]="false";
290
 
291
		#設置執行錯誤訊息
292
		$result["error"]=$findManyKeyWordsFromManyString;
293
 
294
		#印出訊息
295
		var_dump($result);
296
 
297
		#結束執行
298
		exit;
299
 
300
		}
301
 
302
	#如果沒有找到要移除的程序
303
	if(!isset($findManyKeyWordsFromManyString["foundedFalseKey"]))
304
	{
305
		#跳下一個
306
		continue;
307
	}
308
 
309
	#取得程序的輸出
310
	$pidsInfo=$findManyKeyWordsFromManyString["foundedFalseKey"];
311
 
312
	#有幾個程序就執行幾次
313
	foreach($pidsInfo as $pidInfo){
314
 
315
		#取得 pid
316
		#涵式說明:
317
		#將固定格式的字串分開,並回傳分開的結果。
318
		#回傳結果:
319
		#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
320
		#$result["error"],錯誤訊息陣列
321
		#$result["function"],當前執行的函數名稱.
322
		#$result["argu"],使用的參數.
323
		#$result["oriStr"],要分割的原始字串內容
324
		#$result["dataArray"],爲分割好字串的陣列內容,$result["dataArray"][$i]爲第($i+1)段的內容。
325
		#$result["dataCounts"],爲總共分成幾段
326
		#$result["found"],是否有在$conf["stringIn"]找到$conf["spiltSymbol"],"true"代表有找到,"false"代表沒有找到.
327
		#必填的參數:
328
		$conf["stringIn"]=$pidInfo;#要處理的字串。
329
		$conf["spiltSymbol"]=" ";#爲以哪個符號作爲分割
330
		#可省略參數:
331
		#$conf["allowEmptyStr"],是否允許分割出來空字串,預設為"false"不允許;"true"代表允許.
332
		$conf["allowEmptyStr"]="false";
333
		$spiltString=stringProcess::spiltString($conf);
334
		unset($conf);
335
 
336
		#如果執行失敗
337
		if($spiltString["status"]==="false"){
338
 
339
			#設置執行失敗
340
			$result["status"]="false";
341
 
342
			#設置執行錯誤訊息
343
			$result["error"]=$spiltString;
344
 
345
			#印出訊息
346
			var_dump($result);
347
 
348
			#結束執行
349
			exit;
350
 
351
			}
352
 
353
		#取得程序的pid
354
		$pid=$spiltString["dataArray"][1];
355
 
356
		#涵式說明:
357
		#呼叫shell執行系統命令,並取得回傳的內容.
358
		#回傳的結果:
359
		#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
360
		#$result["error"],錯誤訊息陣列.
361
		#$result["function"],當前執行的函數名稱.
362
		#$result["argu"],使用的參數.
363
		#$result["cmd"],執行的指令內容.
364
		#$result["fullCmd"],如果參數 $conf["inBackGround"] 為 "true" 則會回傳該值.
365
		#$result["output"],爲執行完二元碼後的輸出陣列,若 $conf["inBackGround"] 為 "true",則為當下的輸出.
366
		#$result["tmpFileOutput"],儲存輸出的暫存檔案名稱,若 $conf["inBackGround"] 為 "true" 則會回傳該值.
367
		#$result["running"],是否還在執行.
368
		#$result["pid"],pid.
369
		#$result["statusCode"],執行結束後的代碼.
370
		#必填的參數
371
		#$conf["command"],字串,要執行的指令與.
372
		$conf["command"]="kill";
373
		#$conf["fileArgu"],字串,變數__FILE__的內容.
374
		$conf["fileArgu"]=__FILE__;		
375
		#可省略參數:
376
		#$conf["argu"],陣列字串,指令搭配的參數,預設為空陣列.
377
		$conf["argu"]=array($pid);
378
		#$conf["arguIsAddr"],陣列字串,指令搭配的哪些參數為路徑,為路徑的參數會進行轉換以便符合呼叫當前函數的位置,預設不指定,若有3個參數,其中第3個參數為路徑,則表示為array("false","false","true").
379
		#$conf["arguIsAddr"]=array();	
380
		#$conf["pre"],陣列,要在本指令前執行的每個指令與參數.
381
		#$conf["pre"][$i]["cmd"],字串,要在本指令前執行的第$i+1個指令.
382
		#$conf["pre"][$i]["param"],陣列字串,要在本指令前執行的第$i+1個指令的參數.
383
		#$conf["enablePrintDescription"],字串,是否要印出$conf["printDescription"]的內容,"true"代表要,"false"代表不要,預設為"false".
384
		$conf["enablePrintDescription"]="true";
385
		#$conf["printDescription"],字串,執行該外部程式前要印出來的的文字,預設為$conf["command"]的內容加上使用的$conf["argu"]參數.
386
		#$conf["printDescription"]="";
387
		#$conf["escapeshellarg"],字串,是否要啟用過濾參數,用了比較安全,但可能會出錯,"true"為啟用,"false"為不啟用,預設為"false".
388
		$conf["escapeshellarg"]="true";
389
		#$conf["username"],字串,要用什麼使用者來執行,預設為執行php的使用者,該參數不適用於apache環境.
390
		#$conf["username"]="";
391
		#$conf["password"],字串,root的使用者密碼,預設不使用密碼,該參數不適用於apache環境.
392
		#$conf["password"]="";
393
		#$conf["useScript"],字串,是否要啟用Linux的script指令來記錄輸出,"true"代表要,Fedora的selinux會擋住該操作;"false"代表不要,預設為"false".
394
		#$conf["useScript"]="";
395
		#$conf["logFilePath"],字串,當 $conf["useScript"] 為 "true" 時,輸出的內容要暫存到哪裡,預設為 "/tmp/.qbpwcf_tmp/external/callShell/".
396
		#$conf["logFilePath"]=".qbpwcf_tmp/external/callShell/";
397
		#$conf["inBackGround"],字串,是否要在背景執行,且不會等待程式執行結束再執行下一個指令,"true"代表是,"false"代表不要,預設為"false",如果$conf["command"]有用「;」區隔的多個指令將會出錯.
398
		#$conf["inBackGround"]="";
399
		#$conf["getErr"],字串,"true"代表將錯誤輸出變成標準輸出,反之"false"為不變動.
400
		#$conf["getErr"]="false";
401
		#備註:
402
		#不是所有指令都能用apache的身份執行,目前已知java,javac指令無法執行,使用root身份可能會被selinux阻擋.
403
		#參考資料:
404
		#exec=>http://php.net/manual/en/function.exec.php
405
		#escapeshellcmd=>http://php.net/manual/en/function.escapeshellcmd.php
406
		#escapeshellarg=>http://php.net/manual/en/function.escapeshellarg.php
407
		$callShell=external::callShell($conf);
408
		unset($conf);
409
 
410
		#如果執行失敗
411
		if($callShell["status"]==="false"){
412
 
413
			#設置執行失敗
414
			$result["status"]="false";
415
 
416
			#設置執行錯誤訊息
417
			$result["error"]=$getArgu;
418
 
419
			#印出訊息
420
			var_dump($result);
421
 
422
			#結束執行
423
			exit;
424
 
425
			}
426
 
427
		#印出執行的結果
428
		var_dump($callShell);
429
 
430
		}
431
 
432
	}#foreach end
433
 
434
#執行程式 $program2run
435
#涵式說明:
436
#呼叫shell執行系統命令,並取得回傳的內容.
437
#回傳的結果:
438
#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
439
#$result["error"],錯誤訊息陣列.
440
#$result["function"],當前執行的函數名稱.
441
#$result["argu"],使用的參數.
442
#$result["cmd"],執行的指令內容.
443
#$result["fullCmd"],如果參數 $conf["inBackGround"] 為 "true" 則會回傳該值.
444
#$result["output"],爲執行完二元碼後的輸出陣列,若 $conf["inBackGround"] 為 "true",則為當下的輸出.
445
#$result["tmpFileOutput"],儲存輸出的暫存檔案名稱,若 $conf["inBackGround"] 為 "true" 則會回傳該值.
446
#$result["running"],是否還在執行.
447
#$result["pid"],pid.
448
#$result["statusCode"],執行結束後的代碼.
449
#必填的參數
450
#$conf["command"],字串,要執行的指令與.
451
$conf["command"]=$program2run;
452
#$conf["fileArgu"],字串,變數__FILE__的內容.
453
$conf["fileArgu"]=__FILE__;		
454
#可省略參數:
455
#$conf["argu"],陣列字串,指令搭配的參數,預設為空陣列.
456
#$conf["argu"]=array($pid);
457
#$conf["arguIsAddr"],陣列字串,指令搭配的哪些參數為路徑,為路徑的參數會進行轉換以便符合呼叫當前函數的位置,預設不指定,若有3個參數,其中第3個參數為路徑,則表示為array("false","false","true").
458
#$conf["arguIsAddr"]=array();	
459
#$conf["pre"],陣列,要在本指令前執行的每個指令與參數.
460
#$conf["pre"][$i]["cmd"],字串,要在本指令前執行的第$i+1個指令.
461
#$conf["pre"][$i]["param"],陣列字串,要在本指令前執行的第$i+1個指令的參數.
462
#$conf["enablePrintDescription"],字串,是否要印出$conf["printDescription"]的內容,"true"代表要,"false"代表不要,預設為"false".
463
$conf["enablePrintDescription"]="true";
464
#$conf["printDescription"],字串,執行該外部程式前要印出來的的文字,預設為$conf["command"]的內容加上使用的$conf["argu"]參數.
465
#$conf["printDescription"]="";
466
#$conf["escapeshellarg"],字串,是否要啟用過濾參數,用了比較安全,但可能會出錯,"true"為啟用,"false"為不啟用,預設為"false".
467
$conf["escapeshellarg"]="true";
468
#$conf["username"],字串,要用什麼使用者來執行,預設為執行php的使用者,該參數不適用於apache環境.
469
#$conf["username"]="";
470
#$conf["password"],字串,root的使用者密碼,預設不使用密碼,該參數不適用於apache環境.
471
#$conf["password"]="";
472
#$conf["useScript"],字串,是否要啟用Linux的script指令來記錄輸出,"true"代表要,Fedora的selinux會擋住該操作;"false"代表不要,預設為"false".
473
#$conf["useScript"]="";
474
#$conf["logFilePath"],字串,當 $conf["useScript"] 為 "true" 時,輸出的內容要暫存到哪裡,預設為 "/tmp/.qbpwcf_tmp/external/callShell/".
475
#$conf["logFilePath"]=".qbpwcf_tmp/external/callShell/";
476
#$conf["inBackGround"],字串,是否要在背景執行,且不會等待程式執行結束再執行下一個指令,"true"代表是,"false"代表不要,預設為"false",如果$conf["command"]有用「;」區隔的多個指令將會出錯.
477
$conf["inBackGround"]="true";
478
#$conf["getErr"],字串,"true"代表將錯誤輸出變成標準輸出,反之"false"為不變動.
479
#$conf["getErr"]="false";
480
#備註:
481
#不是所有指令都能用apache的身份執行,目前已知java,javac指令無法執行,使用root身份可能會被selinux阻擋.
482
#參考資料:
483
#exec=>http://php.net/manual/en/function.exec.php
484
#escapeshellcmd=>http://php.net/manual/en/function.escapeshellcmd.php
485
#escapeshellarg=>http://php.net/manual/en/function.escapeshellarg.php
486
$callShell=external::callShell($conf);
487
unset($conf);
488
 
489
#如果執行失敗
490
if($callShell["status"]==="false"){
491
 
492
	#設置執行失敗
493
	$result["status"]="false";
494
 
495
	#設置執行錯誤訊息
496
	$result["error"]=$getArgu;
497
 
498
	#印出訊息
499
	var_dump($result);
500
 
501
	#結束執行
502
	exit;
503
 
504
	}#if end
505
 
506
#印出執行的結果
507
var_dump($callShell);
508
 
509
?>