Subversion Repositories qbpwcf-lib(archive)

Rev

Details | Last modification | View Log | RSS feed

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