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
計算小時分鐘加總
27
計算小時分鐘加總
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 "--input [time to add sum] 要計算時間加種的字串".PHP_EOL;
79
	echo "--input [time to add sum] 要計算時間加種的字串".PHP_EOL;
80
	
80
 
81
	#結束執行
81
	#結束執行
82
	exit;
82
	exit;
83
 
83
 
84
	}#function help end
84
	}#function help end
85
 
85
 
Line 107... Line 107...
107
#如果解析參數失敗
107
#如果解析參數失敗
108
if($parseArgu["status"]==="false")
108
if($parseArgu["status"]==="false")
109
{
109
{
110
	#印出結果
110
	#印出結果
111
	var_dump($parseArgu);
111
	var_dump($parseArgu);
112
	
112
 
113
	#結束執行
113
	#結束執行
114
	exit;
114
	exit;
115
	
115
 
116
}#if end
116
}#if end
117
 
117
 
118
#檢查參數
118
#檢查參數
119
#函式說明:
119
#函式說明:
120
#檢查必填與可省略參數,可省略參數可指定預設要給與什麼數值內容。
120
#檢查必填與可省略參數,可省略參數可指定預設要給與什麼數值內容。
Line 167... Line 167...
167
#若執行失敗
167
#若執行失敗
168
if($checkArguments["status"]==="false"){
168
if($checkArguments["status"]==="false"){
169
 
169
 
170
	#印出結果
170
	#印出結果
171
	var_dump($checkArguments);
171
	var_dump($checkArguments);
172
	
172
 
173
	#結束執行
173
	#結束執行
174
	exit;
174
	exit;
175
 
175
 
176
	}#if end
176
	}#if end
177
 
177
 
178
#若檢查不通過
178
#若檢查不通過
179
if($checkArguments["passed"]==="false"){
179
if($checkArguments["passed"]==="false"){
180
 
180
 
181
	#印出結果
181
	#印出結果
182
	var_dump($checkArguments);
182
	var_dump($checkArguments);
183
	
183
 
184
	#結束執行
184
	#結束執行
185
	exit;
185
	exit;
186
 
186
 
187
	}#if end
187
	}#if end
188
 
188
 
Line 214... Line 214...
214
#如果執行失敗
214
#如果執行失敗
215
if($caculate["status"]==="false"){
215
if($caculate["status"]==="false"){
216
 
216
 
217
	#印出結果
217
	#印出結果
218
	var_dump($caculate);
218
	var_dump($caculate);
219
	
219
 
220
	#結束並回傳1給shell
220
	#結束並回傳1給shell
221
	exit(1);
221
	exit(1);
222
 
222
 
223
	}#if end
223
	}#if end
224
	
224
 
225
#函式說明:
225
#函式說明:
226
#顯示多行文字.
226
#顯示多行文字.
227
#回傳的結果:
227
#回傳的結果:
228
#$result["status"],執行是否正常,"true"為正常,"false"為不正常.
228
#$result["status"],執行是否正常,"true"為正常,"false"為不正常.
229
#$result["error"],錯誤訊息陣列.
229
#$result["error"],錯誤訊息陣列.
Line 241... Line 241...
241
#$conf["type"],字串,要用"div"或"span"或"br"或"p"或"EOL"來段行,預設為"EOL".
241
#$conf["type"],字串,要用"div"或"span"或"br"或"p"或"EOL"來段行,預設為"EOL".
242
#$conf["type"]="EOL";
242
#$conf["type"]="EOL";
243
#參考資料:
243
#參考資料:
244
#無.
244
#無.
245
#備註:
245
#備註:
246
#無.		
246
#無.
247
$multiLine=text::multiLine($conf);
247
$multiLine=text::multiLine($conf);
248
unset($conf);
248
unset($conf);
249
 
249
 
250
#如果執行失敗
250
#如果執行失敗
251
if($multiLine["status"]==="false"){
251
if($multiLine["status"]==="false"){
252
 
252
 
253
	#印出結果
253
	#印出結果
254
	var_dump($multiLine);
254
	var_dump($multiLine);
255
	
255
 
256
	#結束並回傳1給shell
256
	#結束並回傳1給shell
257
	exit(1);
257
	exit(1);
258
 
258
 
259
	}#if end
259
	}#if end
260
	
260
 
261
#印出結果
261
#印出結果
262
echo $multiLine["content"];
262
echo $multiLine["content"];
263
 
263
 
264
?>
-
 
265
264
?>
-
 
265