Subversion Repositories php-qbpwcf

Rev

Rev 39 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 39 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
namespace qbpwcf;
26
namespace qbpwcf;
27
 
27
 
Line 55... Line 55...
55
	#結束執行,回傳shell 1.
55
	#結束執行,回傳shell 1.
56
	exit(1);
56
	exit(1);
57
 
57
 
58
	}#if end
58
	}#if end
59
 
59
 
60
#設置 include path 
60
#設置 include path
61
set_include_path($output[0].PATH_SEPARATOR.get_include_path());
61
set_include_path($output[0].PATH_SEPARATOR.get_include_path());
62
 
62
 
63
#匯入外部套件
63
#匯入外部套件
64
include("allInOne.php");
64
include("allInOne.php");
65
 
65
 
66
#說明函式
66
#說明函式
67
function help(){
67
function help(){
68
 
68
 
69
	#印出指令說明
69
	#印出指令說明
70
	echo "Usage of ".basename(__FILE__).":".PHP_EOL; 
70
	echo "Usage of ".basename(__FILE__).":".PHP_EOL;
71
	echo "--input [utf7 imap string to decode] 代表要解碼的 uft7 imap 字串".PHP_EOL;
71
	echo "--input [utf7 imap string to decode] 代表要解碼的 uft7 imap 字串".PHP_EOL;
72
	
72
 
73
	#結束執行
73
	#結束執行
74
	exit;
74
	exit;
75
 
75
 
76
	}#function help end
76
	}#function help end
77
 
77
 
Line 99... Line 99...
99
#如果解析參數失敗
99
#如果解析參數失敗
100
if($parseArgu["status"]==="false"){
100
if($parseArgu["status"]==="false"){
101
 
101
 
102
	#印出結果
102
	#印出結果
103
	var_dump($parseArgu);
103
	var_dump($parseArgu);
104
	
104
 
105
	#結束執行,回傳shell 1,代表異常.
105
	#結束執行,回傳shell 1,代表異常.
106
	exit(1);
106
	exit(1);
107
	
107
 
108
	}#if end
108
	}#if end
109
 
109
 
110
#檢查參數
110
#檢查參數
111
#函式說明:
111
#函式說明:
112
#檢查必填與可省略參數,可省略參數可指定預設要給與什麼數值內容。
112
#檢查必填與可省略參數,可省略參數可指定預設要給與什麼數值內容。
Line 159... Line 159...
159
#若執行失敗
159
#若執行失敗
160
if($checkArguments["status"]==="false"){
160
if($checkArguments["status"]==="false"){
161
 
161
 
162
	#印出結果
162
	#印出結果
163
	var_dump($checkArguments);
163
	var_dump($checkArguments);
164
	
164
 
165
	#結束執行,回傳shell 1,代表異常.
165
	#結束執行,回傳shell 1,代表異常.
166
	exit(1);
166
	exit(1);
167
 
167
 
168
	}#if end
168
	}#if end
169
 
169
 
170
#若檢查不通過
170
#若檢查不通過
171
if($checkArguments["passed"]==="false"){
171
if($checkArguments["passed"]==="false"){
172
 
172
 
173
	#提示用法
173
	#提示用法
174
	help();
174
	help();
175
	
175
 
176
	#結束執行
176
	#結束執行
177
	exit;
177
	exit;
178
 
178
 
179
	}#if end
179
	}#if end
180
 
180
 
Line 201... Line 201...
201
#若執行失敗
201
#若執行失敗
202
if($utf7_imap_to_utf8["status"]==="false"){
202
if($utf7_imap_to_utf8["status"]==="false"){
203
 
203
 
204
	#印出結果
204
	#印出結果
205
	var_dump($utf7_imap_to_utf8);
205
	var_dump($utf7_imap_to_utf8);
206
	
206
 
207
	#結束執行,回傳shell 1,代表異常.
207
	#結束執行,回傳shell 1,代表異常.
208
	exit(1);
208
	exit(1);
209
 
209
 
210
	}#if end
210
	}#if end
211
	
211
 
212
#印出解好的內容
212
#印出解好的內容
213
echo $utf7_imap_to_utf8["content"];
-
 
214
213
echo $utf7_imap_to_utf8["content"];
-
 
214