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
建立暫存從config server取得的內容.
27
建立暫存從config server取得的內容.
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 socket unix doamin socket 的位置,預設為套件根目錄底下的'var/config::client/clientCacheDaemon.sock'".PHP_EOL;
79
	echo "--sock socket unix doamin socket 的位置,預設為套件根目錄底下的'var/config::client/clientCacheDaemon.sock'".PHP_EOL;
80
	echo "--cacheFilePath path cache的檔案位置,預設為套件根目錄底下的'var/config::client/'".PHP_EOL;
80
	echo "--cacheFilePath path cache的檔案位置,預設為套件根目錄底下的'var/config::client/'".PHP_EOL;
81
	echo "--checkVersionInterval second(s) 距離最後一次取得資料的時間多久就要檢查是否有新資料,預設為60秒.".PHP_EOL;
81
	echo "--checkVersionInterval second(s) 距離最後一次取得資料的時間多久就要檢查是否有新資料,預設為60秒.".PHP_EOL;
82
		
82
 
83
	#結束執行
83
	#結束執行
84
	exit;
84
	exit;
85
 
85
 
86
	}#function help end
86
	}#function help end
87
	
87
 
88
#函式說明:
88
#函式說明:
89
#解析參數.
89
#解析參數.
90
#回傳結果:
90
#回傳結果:
91
#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
91
#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
92
#$reuslt["error"],執行不正常結束的錯訊息陣列.
92
#$reuslt["error"],執行不正常結束的錯訊息陣列.
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;
116
	exit;
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;
176
	exit;
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;
187
	exit;
188
 
188
 
189
	}#if end
189
	}#if end
190
 
190
 
Line 231... Line 231...
231
#無,
231
#無,
232
$clientCacheDaemon=config::clientCacheDaemon($conf);
232
$clientCacheDaemon=config::clientCacheDaemon($conf);
233
unset($conf);
233
unset($conf);
234
 
234
 
235
#debug
235
#debug
236
var_dump($clientCacheDaemon);
-
 
237
236
var_dump($clientCacheDaemon);
-
 
237