| 714 |
liveuser |
1 |
<?php
|
|
|
2 |
|
|
|
3 |
#使用命名空間qbpwcf
|
|
|
4 |
namespace qbpwcf;
|
|
|
5 |
|
|
|
6 |
#assets dir
|
|
|
7 |
$assetsDir="assets of config::client_xxxxxxxx";
|
|
|
8 |
|
|
|
9 |
#函式說明:
|
|
|
10 |
#查尋有使用 server 函式提供組態設定檔的服務,取得key的value.
|
|
|
11 |
#回傳結果:
|
|
|
12 |
#$result["status"],執行是否正常,"true"為正常,"false"為不正常.
|
|
|
13 |
#$result["error"],錯誤訊息陣列.
|
|
|
14 |
#$result["function"],當前執行的函數名稱.
|
|
|
15 |
#$result["content"],結果.
|
|
|
16 |
#必填參數:
|
|
|
17 |
#$conf["server"],字串,組態服務設定服務的網址
|
|
|
18 |
$conf["server"]="https://latest.qbpwcf.org/sample/config::server.php";
|
|
|
19 |
#$conf["postName"],字串,POST變數的名稱,亦即要查尋的定義名稱.
|
|
|
20 |
$conf["postName"]="169.254.1.1";
|
|
|
21 |
#$conf["fileArgu"],字串,變數__FILE__的內容.
|
|
|
22 |
$conf["fileArgu"]=__FILE__;
|
|
|
23 |
#可省略參數:
|
|
|
24 |
#$conf["cache"],字串,預設為"true",代表會啟用cache服務;反之為"false".
|
|
|
25 |
$conf["cache"]="false";
|
|
|
26 |
#$conf["clientCacheDaemonSock"],字串,提供cache服務的 unix domain socket 檔案位置,預設為套件根目錄底下的"var/config::client/clientCacheDaemon.sock";.
|
|
|
27 |
#$conf["clientCacheDaemonSock"]="";
|
|
|
28 |
#$conf["inBg"],字串,預設為"false",代表在前景執行;反之為"true"代表在背景中執行,會強制將"cache"參數設為"false".
|
|
|
29 |
#$conf["inBg"]="true";
|
|
|
30 |
#參考資料:
|
|
|
31 |
#無.
|
|
|
32 |
#備註:
|
|
|
33 |
#目前僅能跟server函式提供的服務對接.
|
|
|
34 |
$client=config::client($conf);
|
|
|
35 |
unset($conf);
|
|
|
36 |
|
|
|
37 |
#如果執行失敗
|
|
|
38 |
if($client["status"]==="false"){
|
|
|
39 |
|
|
|
40 |
#函式說明:
|
|
|
41 |
#撰寫log
|
|
|
42 |
#回傳結果:
|
|
|
43 |
#$result["status"],狀態,"true"或"false".
|
|
|
44 |
#$result["error"],錯誤訊息陣列.
|
|
|
45 |
#$result["function"],當前函式的名稱.
|
|
|
46 |
#$result["argu"],使用的參數.
|
|
|
47 |
#必填參數:
|
|
|
48 |
#$conf["path"],字串,log檔案的路徑與名稱.
|
|
|
49 |
$conf["path"]=$logFile;
|
|
|
50 |
#$conf["content"],any,要寫的內容,若內容不為字串則會用var_dump的格式寫入.
|
|
|
51 |
$conf["content"]=$client;
|
|
|
52 |
#$conf["fileArgu"],字串,php變數__FILE__的內容,亦即該檔案在檔案系統的絕對路徑
|
|
|
53 |
$conf["fileArgu"]=__FILE__;
|
|
|
54 |
#可省略參數:
|
|
|
55 |
#$conf["rewrite"],預設為"false",接續寫入;反之"true"代表重新寫入.
|
|
|
56 |
#$conf["rewrite"]="false";
|
|
|
57 |
#參考資料:
|
|
|
58 |
#無.
|
|
|
59 |
#備註:
|
|
|
60 |
#無.
|
|
|
61 |
$record=logs::record($conf);
|
|
|
62 |
unset($conf);
|
|
|
63 |
|
|
|
64 |
#結束執行
|
|
|
65 |
exit(1);
|
|
|
66 |
|
|
|
67 |
}#if end
|
|
|
68 |
|
|
|
69 |
#印出 json 結果
|
|
|
70 |
echo json_encode($client["content"]);
|