Subversion Repositories qbpwcf-lib(archive)

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
828 liveuser 1
<?php
2
 
3
#使用命名空間qbpwcf
4
namespace qbpwcf;
5
 
6
#assets dir
7
$assetsDir="assets of cmd::getArgu_20241204";
8
 
9
#函式說明:
10
#抓取命令列的參數.
11
#回傳結果:
12
#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
13
#$reuslt["error"],執行不正常結束的錯訊息陣列.
14
#$result["function"],當前執行的函式名稱.
15
#$result["argu"],使用的參數陣列.
16
#$result["content"],要回傳的參數陣列.
17
#$result["count"],參數的數量.
18
#$result["_GET"],收到的 HTTP GET 參數陣列.
19
#$result["_POST"],收到的 HTTP POST 參數陣列.
20
#必填參數:
21
#無
22
#可省略參數:
23
#$conf["echo"],字串,"true"代表要將抓到的參數一個個印出來,"false"代表用回傳的方式,預設為"false".
24
#$conf["echo"]="false";
25
#$conf["httpGetToArgu"],字串,"true"代表要將 http get 參數變成參數來取得,像是 $_GET["p1"] 會變成 $result["content"]["p1"] 回傳,預設為"false"代表不使用.
26
$conf["httpGetToArgu"]="true";
27
#$conf["httpPostToArgu"],字串,"true"代表要將 http post 參數變成參數來取得,像是 $_POST["p1"] 會變成 $result["content"]["p1"] 回傳,預設為"false"代表不使用.
28
$conf["httpPostToArgu"]="true";
29
#參考資料:
30
#無.
31
#備註:
32
#無.
33
$getArgu=cmd::getArgu($conf);
34
unset($conf);
35
 
36
#如果執行失敗
37
if($getArgu["status"]==="false"){
38
 
39
	#函式說明:
40
	#撰寫log
41
	#回傳結果:
42
	#$result["status"],狀態,"true"或"false".
43
	#$result["error"],錯誤訊息陣列.
44
	#$result["function"],當前函式的名稱.
45
	#$result["argu"],使用的參數.
46
	#必填參數:
47
	#$conf["path"],字串,log檔案的路徑與名稱.
48
	$conf["path"]=$logFile;
49
	#$conf["content"],any,要寫的內容,若內容不為字串則會用var_dump的格式寫入.
50
	$conf["content"]=$getArgu;
51
	#$conf["fileArgu"],字串,php變數__FILE__的內容,亦即該檔案在檔案系統的絕對路徑
52
	$conf["fileArgu"]=__FILE__;
53
	#可省略參數:
54
	#$conf["rewrite"],預設為"false",接續寫入;反之"true"代表重新寫入.
55
	#$conf["rewrite"]="false";
56
	#參考資料:
57
	#無.
58
	#備註:
59
	#無.
60
	$record=logs::record($conf);
61
	unset($conf);
62
 
63
	#如果寫log失敗
64
	if($record["status"]==="false"){
65
 
66
		#印出結果
67
		var_dump($record);
68
 
69
		}#if end
70
 
71
	#結束執行,回傳錯誤代碼1
72
	exit(1);
73
 
74
	}#if end
75
 
76
#顯示結果
77
var_dump($getArgu);