Subversion Repositories php-qbpwcf

Rev

Rev 339 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
3 liveuser 1
<?php
2
 
3
/*
4
 
5
	QBPWCF, Quick Build PHP website Component base on Fedora Linux.
239 liveuser 6
    Copyright (C) 2014~2026 MIN ZHI, CHEN
3 liveuser 7
 
8
    This file is part of QBPWCF.
9
 
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
12
    the Free Software Foundation, either version 3 of the License, or
13
    (at your option) any later version.
14
 
15
    QBPWCF is distributed in the hope that it will be useful,
16
    but WITHOUT ANY WARRANTY; without even the implied warranty of
17
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
    GNU General Public License for more details.
19
 
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/>.
22
 
23
*/
24
 
25
#頁面說明:
26
#負責將其它類別匯入到該檔案裏面,這樣撰寫網頁的時候就只需要將此檔案匯入即可使用所有的類別函式
27
#該檔案,不適用於撰寫SOAP服務。
28
 
29
#使用方法:
30
/*
31
 
32
#只要匯入當前目錄底下的 allInOne.php 即可使用各式類別方法。
33
#匯入的範例:
34
 
35
<?php
36
 
37
#使用命名空間,請務必指派爲 qbpwcf
38
namespace qbpwcf;
39
 
40
#匯入外部套件,檔案位置請依照需求去修改
41
require_once("allInOne.php");
42
 
43
#以下爲你的程式...
44
 
45
?>
46
 
47
*/
48
 
49
#指派命名空間
50
namespace qbpwcf;
51
 
52
#參考資料
53
#http://php.net/manual/en/function.set-exception-handler.php
54
#http://php.net/manual/en/function.set-error-handler.php
55
#https://stackoverflow.com/questions/4514568/how-to-catch-all-php-error
56
 
57
/*
58
 
59
#處理會導致程式無法執行的錯誤
60
set_error_handler(function($errno, $errstr, $errfile, $errline ){
61
	throw new \ErrorException($errstr, $errno, 0, $errfile, $errline);
62
});
63
 
64
#處理非導致程式無法執行的錯誤
65
#參考資料:
66
#http://php.net/manual/en/class.exception.php
67
set_exception_handler(function($exception){
68
	echo "<p>".PHP_EOL;
69
	echo "Uncaught exception: ".$exception->getMessage()."<br>".PHP_EOL;
70
	echo "File: ".$exception->getFile()."<br>".PHP_EOL;
71
	echo "Line: ".$exception->getLine()."<br>".PHP_EOL;
72
	echo "Trace: ".print_r($exception->getTrace(),true)."<br>".PHP_EOL;
73
	echo "The exception code is: ".$exception->getCode()."<br>".PHP_EOL;
74
	exit;
75
});
76
 
77
*/
78
 
79
#如果是在命令列環境
80
if(!(isset($_SERVER['HTTP_USER_AGENT']))){
81
 
82
	#改匯入 "allInOneForCmd.php"
83
	require_once("allInOneForCmd.php");
84
 
85
	#結束程式
86
	return 0;
87
 
88
	}#if end
89
 
317 liveuser 90
#取得 session id
91
$sId=session_id();
92
 
93
#定義 sId
94
define("sId",$sId);
95
 
3 liveuser 96
#如果 session 不存在
97
if(!isset($_SESSION)){
98
 
99
	#啟動 session
100
	session_start();
101
 
102
	}#if end
103
 
104
#如果尚未取得 lib path
105
if(!isset($folderOfUsrLib)){
106
 
107
	#儲存要執行的指令
108
	$cmd="php -f ".escapeshellarg(pathinfo(__FILE__)["dirname"]."/../../bin/libexec/folderOfUsrLib.php");
109
 
110
	#取得 lib path
111
	exec($cmd,$output,$status);
112
 
113
	#如果執行失敗
114
	if($status!==0){
115
 
116
		#debug
117
		var_dump($cmd,$ouput,$status);
118
 
119
		#結束執行,回傳shell 1.
120
		exit(1);
121
 
122
		}#if end
123
 
124
	#儲存lib path
125
	$folderOfUsrLib=$output[0];
226 liveuser 126
 
3 liveuser 127
	}#if end
128
 
129
#匯入自建的php類別檔
130
require_once("amazon.php"); #跟 amazon 互動的類別
131
require_once("analyse.php"); #跟問卷整理分析有關的類別
132
require_once("app.php"); #讓網頁變得更行動與app化
133
require_once("autoService.php"); #讓網頁可以管理系統的自動化服務
134
require_once("arrays.php"); #跟陣列有關的方法
135
require_once("authenticate.php"); #裏面包含跟驗證有關的功能
136
require_once("bigbluebutton.php"); #big blue button的應用
137
require_once("canvas.php"); #canvas 的應用
138
require_once("catchWebContent.php"); #包含可以抓取網頁內容的功能
139
require_once("chartJS.php"); #繪製圖表的js
140
require_once("cmd.php"); #跟命令列有關的功能
141
require_once("config.php"); #用於改變php執行環境的類別
142
require_once("css.php"); #裏面包含設定css樣式的功能,網頁美觀就靠它了。
143
require_once("csv.php"); #跟csv檔案有關的功能
144
require_once("csInformation.php"); #裏面包含取得用戶、伺服端資訊的功能。
145
#require_once("communication.php"); #網路通訊相關功能,開發中...
169 liveuser 146
require_once("controlStructures.php"); #control structures 的應用.
3 liveuser 147
require_once("ckEditor.php"); #ckeditor的相關應用
148
require_once("dataTable.php"); #將資料表的資料呈現出來並附上操作選項的設置
149
require_once("db.php"); #裏面包含跟資料庫操作有關的功能
150
require_once("external.php"); #執行外部程式
151
require_once("exam.php"); #包含跟測驗有關的功能
152
require_once("fb.php"); #裏面包含facebook提供的api服務
153
require_once("fileAccess.php"); #裏面包含檔案讀、寫的功能
154
require_once("flash.php"); #裏面包含嵌入flash到網頁會用到的功能
155
require_once("form.php"); #裏面包含表單的設計、傳送、接收與跟處理上傳檔案有關的功能
156
require_once("fuse.php"); #包含fuse的使用(ftp,sftp,glusterfs...)
157
require_once("frame.php"); #裏面包含 iframe 的設置功能
158
require_once("googleMap.php"); #裡面包含 googleMap 的應用
159
require_once("header.php"); #裏面包含轉址、網頁編碼、檔案下載、網頁資訊等設定功能
160
require_once("hive.php"); #連線到hiveServer進行操作
161
require_once("html.php"); #管理網頁內容的功能
162
require_once("img.php"); #裏面關於在網頁嵌入圖片、與繪圖的功能
163
require_once("javaScript.php"); #一些javaScript函式、語法可以參考
164
require_once("jquery.php"); #javascript的函式庫,提供較易使用的方式
165
require_once("jwt.php"); #提供 jwt token 的應用
166
require_once("libreoffice.php"); #提供 libreoffice 相關的應用
167
require_once("line.php"); # 提供 line 的相關應用
168
require_once("link.php"); #裏面包含跟超連結有關的功能
169
require_once("logs.php"); #跟log相關的功能
170
require_once("mail.php"); #跟寄信有關的功能
171
require_once("maintain.php"); #跟維護有關的類別
172
require_once("math.php"); #裏面包含跟數學運算有關的功能
173
require_once("od.php"); #跟open document有關的功能
174
require_once("parser.php"); #跟解析內容相關的功能.
175
require_once("phpLib.php"); #跟php函式庫管理有關的類別
176
require_once("qemu.php"); #跟qemu有關的功能
177
require_once("qrCode.php"); #裏面包含qrCode的功能
178
require_once("R.php"); #用於統計與報表產生的套件
179
require_once("record.php"); #用於記錄資訊的套件功能
339 liveuser 180
require_once("resource.php"); #類似Redias/Valkey的功能
3 liveuser 181
require_once("session.php"); #用於管理session的功能
182
require_once("search.php"); #裏面包含跟搜尋有關的功能
183
require_once("security.php"); #裏面包含跟保護製作權有關的功能
184
require_once("soap.php"); #webService建構、存取的相關功能
185
require_once("sock.php"); #unix domain socket
186
require_once("sound.php"); #裏面包含嵌入音樂、聲音、語音到網頁的功能
187
require_once("stop.php"); #跟程式中止有關的功能
188
require_once("stringProcess.php"); #裏面包含字串處理的功能
189
require_once("tab.php"); #提供建立tab的功能
190
require_once("text.php"); #提供文字顯示的功能
191
require_once("table.php"); #裏面包含建立表格的功能
192
require_once("threads.php"); #提供多執行序功能
193
require_once("time.php"); #裏面包含關於跟時鐘、期間限定有關的功能
194
require_once("variableCheck.php"); #變數檢查
195
require_once("video.php"); #裏面包含跟嵌入影片到網頁有關的功能
196
require_once("webSock.php"); #裡面包含web socket的應用
197
require_once("xml.php"); #裏面包含xml資料的截取功能
198
require_once("zerossl.php"); #裡面包含應用zerossl提供的服務
199
 
200
#匯入別人的php類別檔
201
 
202
#套件說明:
203
#tcpdf,用於編輯pdf檔案的套件。
204
#參考資料:
205
#http://www.tcpdf.org/index.php
206
require_once("tcpdf/tcpdf.php");
207
 
208
#/*
209
 
210
#設定檢視該網頁時預設的編碼
211
#必填的參數:
212
$conf["encodingName"]="utf-8";#為網頁顯示的編碼的名稱,例如:"UTF-8"
213
header::htmlEncoding($conf);
214
unset($conf);
215
 
216
#*/
217
 
218
#/*
219
 
220
#預設啟用防止複製與右鍵功能
207 liveuser 221
#函式說明:
222
#禁止做任違反版權的事情,禁止在網頁按下滑鼠右鍵,禁止複製圖片,禁止開新分頁(失敗), 版權所有、Power by訊息.
3 liveuser 223
#回傳的內容:
224
#保護版權的語法
207 liveuser 225
#必填參數:
226
#無
227
#可省略參數:
228
#$conf["name"],字串,公司、組織、單位的名稱,預設不指定.
229
$conf["name"]="北角網頁設計";
230
#$conf["powerBy"],字串,由誰提供,預設爲QBPWCF.
231
#$conf["powerBy"]="";
232
#$conf["powerByLink"],字串,power by字串的連結目標,預設爲"https://www.qbpwcf.org".
233
#$conf["powerByLink"]="";
234
#$conf["bgColor"],字串,背景顏色,預設爲淡藍色.
235
#$conf["bgColor"]="";
236
#參考資料:
237
#http://www.w3schools.com/jsref/dom_obj_event.asp
238
#備註:
239
#無.
3 liveuser 240
$copyRight=security::copyRight($conf);
207 liveuser 241
unset($conf);
180 liveuser 242
 
243
if($copyRight["status"]==="false"){
244
 
3 liveuser 245
	#debug
246
	var_dump($copyRight);
247
	exit;
180 liveuser 248
 
249
	}#if end
206 liveuser 250
 
251
#印出版權宣告
3 liveuser 252
echo $copyRight["content"];
253
unset($conf);
254
 
255
#*/
256
 
257
#/*
258
 
259
#qbpwcf用的css樣式
260
$qbpwcfStyle=css::qbpwcfStyle();
261
 
262
#如果建立 qbpwcf 用的 css 語法失敗
263
if($qbpwcfStyle["status"]==="false"){
264
 
265
	#debug
266
	var_dump($qbpwcfStyle);
267
	exit;
268
 
269
	}#if end
270
 
271
#印出css語法
272
echo $qbpwcfStyle["content"];
273
 
274
#*/
275
 
276
#/* prevent header error
277
 
278
#qbpwcf用的javascript
279
$qbpwcfJavaScript=javaScript::qbpwcfJavaScript();
280
 
281
#如果建立 qbpwcf 用的 js 語法失敗
282
if($qbpwcfJavaScript["status"]==="false"){
283
 
284
	#debug
285
	var_dump($qbpwcfJavaScript);
226 liveuser 286
 
3 liveuser 287
	#結束執行
288
	exit;
289
 
290
	}#if end
291
 
292
#印出js語法
293
echo $qbpwcfJavaScript["content"];
294
 
207 liveuser 295
#將指定的字形套用在body上
296
#函式說明:
297
#將指定的字形套用在body上.
298
#回傳結果:
299
#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
300
#$result["error"],錯誤訊息.
301
#$result["function"],當前執行的函數名稱.
302
#$result["content"],語法.
303
#必填參數:
304
#無.
305
#可省略參數:
306
#$conf["fontPath"],字串,字形檔案的位置,預設為"liberation-mono/LiberationMono-Regular.ttf".
307
#$conf["fontPath"]="";
308
#參考資料:
309
#無.
310
#備註:
311
#無.
312
$conf=array();
313
$setBodyFont=javaScript::setBodyFont($conf);
314
unset($conf);
315
 
316
#如果執行異常
317
if($setBodyFont["status"]==="false"){
318
 
319
	#debug
320
	var_dump($setBodyFont);
226 liveuser 321
 
207 liveuser 322
	#結束執行
323
	exit;
324
 
325
	}#if end
326
 
327
#印出語法
328
echo $setBodyFont["content"];
329
 
3 liveuser 330
#*/
331
 
332
#匯入全域的設定檔
333
require_once(pathinfo(__FILE__)["dirname"]."/../../../etc/qbpwcf/allInOneConfig.php");
334
 
335
#覆蓋資料庫連結用的資訊
336
#$dbAddress="localhost";#資料庫的位置
337
#$dbPort="3306";#資料庫的 tcp port
338
#$dbAccount="root";#資料庫帳號
339
#$dbPassword="";#資料庫密碼
340
#$dbName="test";#資料庫名稱
341
 
342
#定義常數變數,bbb service url
343
define("bbbUrl",$bbbUrl);
344
 
345
#定義常數變數,bbb service secret
346
define("bbbSecret",$bbbSecret);
347
 
182 liveuser 348
#定義資料庫系統加解密用的GnuPG ID
3 liveuser 349
define("dbSecret",$dbSecret);
350
 
351
#定義 qbpwcf unix domain socket path
352
define("qbpwcf_usock_path",$qbpwcf_usock_path);
353
 
354
#定義 Zero SSL API access key
355
define("zeroSSLapiKey",$zeroSSLapiKey);
356
 
77 liveuser 357
#定義運行web服務的賬戶
358
define("webUser",$webUser);
359
 
360
#定義系統的domain
361
define("domain",$domain);
362
 
63 liveuser 363
#定義用於gpg加解密的預設id
364
define("gnupgId",$gnupgId);
365
 
30 liveuser 366
#定義供系統寄送信件的email帳號
367
define("systemMailAcct",$systemMailAcct);
368
 
369
#定義供系統寄送信件的email密碼
370
define("systemMailPass",$systemMailPass);
371
 
47 liveuser 372
#定義環境模式
373
define("mode",$mode);
374
 
53 liveuser 375
#定義 web socket server 預設的 listen address
376
define("webSocketServerDefaultListenAddr",$webSocketServerDefaultListenAddr);
377
 
378
#定義 web soscket server 預設的 listen port
379
define("webSocketServerDefaultListenPort",$webSocketServerDefaultListenPort);
380
 
317 liveuser 381
#定義 usr/share/qbpwcf/system/sendMailAgent 對應的網域名稱
382
define("system_sendMailAgent_domain",$system_sendMailAgent_domain);
383
 
319 liveuser 384
#預設 usr/share/qbpwcf/system/sendMailAgent 對應的 web socket 網域名稱為
385
define("system_sendMailAgent_ws_domain",$system_sendMailAgent_ws_domain);
317 liveuser 386
 
387
#定義 usr/share/qbpwcf/system/sendMailAgent 的 path
388
define("system_sendMailAgent_path",$system_sendMailAgent_path);
389
 
3 liveuser 390
/*
391
 
392
#取得使用者拜訪的頁面
393
#涵式說明:
394
#取得用戶端的資訊
395
#回傳的結果:
396
#$result["status"],執行是否正常,"true"代表執行成功,"false"代表執行失敗.
397
#$result["error"],錯誤訊息.
398
#$result["function"],檔前執行的函數名稱.
399
#$result["mode"],當前的模式是"cmd"還是"web".
400
#$result["userBrowserType"],爲使用者的瀏覽器資訊
401
#$result["userIp"],爲使用者的IP
402
#$result["serverIp"],為伺服器的IP
403
#$result["scheme"],通訊協定
404
#$result["serverPort"],伺服器給對外下載網頁的port
405
#$result["requestUri"],爲使用者要求的網址
406
#$result["username"],爲使用者目前的帳戶,若爲""則表示尚未登入成功
407
#$result["phpUser"],運行該php的使用者帳戶.
408
#必填的參數:
409
$conf["getAccount"]="true";#是否要取得帳號
410
#可省略的參數:
411
#$conf["accountVar"]=$_SESSION["username"];#帳號儲存在哪個變數裏面,預設爲$_SESSION["username"]
412
$conf["saveToDb"]="true";#是否要除儲存到資料庫,"true"為要儲存",預設為不儲存
413
$conf["dbAddress"]=$dbAddress;;#爲mysql-Server的位置,若#$conf["saveToDb"]設為"true",則該參數為必填。
414
$conf["dbAccount"]=$dbAccount;#爲用於連入mysql-Server時要使用的帳號,若#$conf["saveToDb"]設為"true",則該參數為必填。
415
$conf["dbName"]=$dbName;#要選取的資料庫名稱,若#$conf["saveToDb"]設為"true",則該參數為必填。
416
$conf["tableName"]="visitorInfo";#爲要插入資料的資料表名稱,若#$conf["saveToDb"]設為"true",則該參數為必填。
417
$conf["columnName"]=array("username","userWebBrowser","userIp","requestUri","systemDateAndTime");#爲資料表的項目名稱,
418
	#例如:$conf["columnName"]=array("columnName1","columnName2","columnName3",...);
419
	#寫入的資料依序為,使用者帳戶、瀏覽器資訊、使用者IP、觀看的網址、當時的時間
420
	#$conf["saveToDb"]設為"true",則該參數為必填。
421
$conf["dbPassword"]=$dbPassword;#爲連線到mysql-Server時要使用的密碼,可省略,若省略則代表不使用密碼
422
#$conf["displayQueryError"]="true";#爲是否呈現Query的錯誤訊息,預設不呈現,若要呈現則請將此值設爲"true"
423
#$conf["displayQueryString"]="true";#爲是否呈現Query的命令,預設不呈現,若要呈現則請將此值設爲"true"
424
$recordResult=csInformation::getConnectionInfo($conf);
425
unset($conf);
426
 
427
#如果記錄拜訪資訊失敗
428
if($recordResult["status"]=="false"){
429
 
430
	#debug
431
	var_dump($recordResult);
432
	exit;
433
 
434
	}#if end
435
 
436
#如果要求的通訊協定不為https
437
if($recordResult["scheme"]!=="https"){
438
 
439
	#函式說明:
440
	#設定session變數後,立即轉址.
441
	#回傳的結果:
442
	#$result["status"],執行是否成功,"true"代表成功,"false"代表不成功.
443
	#$result["function"],當前執行的函數名稱.
444
	#$result["error"],錯誤訊息陣列.
445
	#必填的參數:
446
	#$conf["headerLocation"],為要轉址到的地方,若爲 $_SERVER["PHP_SELF"],則爲回到目前頁面,全民資安素養網爲 https://isafe.moe.edu.tw/.
447
	$conf["header::redirectionNow"]["headerLocation"]=$recordResult["scheme"]."s://".$recordResult["serverIp"].$recordResult["requestUri"];
448
	#可省略的參數:
449
	#$conf["sessionName"],字串陣列,可以指派session變數的名稱.
450
	#$conf["sessionName"]=array("");
451
	#$conf["sessionValue"]字串陣列,可以指派session變數的內容.
452
	#$conf["sessionValue"]=array("");
453
	#參靠資料來源:
454
	#http://php.net/manual/en/reserved.variables.server.php
455
	$redirectionNow=header::redirectionNow($conf["header::redirectionNow"]);
456
	unset($conf["header::redirectionNow"]);
457
 
458
	#如果轉址失敗
459
	if($redirectionNow["status"]==="false"){
460
 
461
		#停止執行
462
		exit;
463
 
464
		}#if end
465
 
466
	}#if end
467
 
468
#驗證權限,檢查會員所屬群組是否能拜訪該子細統
469
#函式說明:
470
#檢查session裏面的使用者資訊是否在會員清單裏面,
471
#該會員所屬的羣組是否具有權限瀏覽該子功能頁面
472
#目標資料庫裏面必須有名爲member作爲儲存會員資料的資料表。
473
#目標資料庫裏面必須有名爲userGroupAuthorities作爲儲存羣組資料的資料表
474
#回傳的參數:
475
#$result["status"],執行是否正常的識別,"true"代表一切正常,"false"代表不正常
476
#$result["error"],錯誤訊息
477
#$result["function"],當前執行的函數名稱
478
#$result["passed"],是否通過檢查,"true"代表通過檢查,"false"代表沒有通過檢查.
479
#$result["warning"],記錄不會影響程式執行,但是需要注意的事情。
480
#必填寫的參數:
481
$conf["thisSubSystemName"]="phplib";#爲該子系統的名稱,若該羣組所能瀏覽的子系統裏面有該名稱,則通過驗證。
482
$conf["dbName"]=$dbName;#爲指定的資料庫名稱,欲選擇的資料庫名稱
483
$conf["dbPassword"]=$dbPassword;#爲連線到mysql-Server時要使用的密碼,可省略,若省略則代表不使用密碼
484
#可省略的參數:
485
#$conf["dbAddress"]="localhost";#爲資料庫的位置,預設爲 "localhost"
486
#$conf["dbAccount"]="root";#爲用於連入資料庫時要使用的帳號,預設爲 "root"
487
#$conf["dtName.member"]="member";#儲存會員資料的資料表,預設爲 "member"
488
#$conf["dtName.userGroup"]="userGroupAuthorities";#儲存羣組資料的資,預設爲 "userGroupAuthorities"
489
$authenticate=authenticate::checkUserGroupAuthorities($conf);
490
unset($conf);
491
 
492
#debug
493
#var_dump($conf);
494
#var_dump($authenticate);
495
#exit;
496
 
497
#如果驗證權權限失敗
498
if($authenticate["status"]==="false"){
499
 
500
	#debug
501
	#var_dump($authenticate);
502
	#exit;
503
 
504
	#函式說明:
505
	#用彈出式視窗顯示訊息,接著設置seesion變數,最後進行轉址.
506
	#回傳的結果:
507
	#$result["status"],執行是否成功,"true"代表成功,"false"代表不成功.
508
	#$result["error"],錯誤訊息陣列.
509
	#必填的參數:
510
	#$conf["headerLocation"],為要轉址到的地方,若爲 $_SERVER["PHP_SELF"],則爲回到目前頁面,全民資安素養網爲 https://isafe.moe.edu.tw/.
511
	$conf["headerLocation"]="/~qbpwcf/";
512
	#$conf["alertMessage"],字串陣列,要顯示的彈出式視窗內容,第n個元素代表第n行的內容.
513
	$conf["alertMessage"]=$authenticate["warning"];
514
	#可省略的參數:
515
	#$conf["sessionName"],字串陣,可以指派要建立的session變數名稱.
516
	#$conf["sessionName"]=array("");
517
	#$conf["sessionValue"]字串陣列,可以指派要建立的session變數的內容.
518
	#$conf["sessionValue"]=array("");
519
	#參靠資料來源:
520
	#http://php.net/manual/en/reserved.variables.server.php
521
	header::redirectionAfterAlertWindows($conf);
522
	unset($conf);
523
 
524
	}#if end
525
 
526
#如果驗證權限不通過
527
if($authenticate["passed"]==="false"){
528
 
529
	#函式說明:
530
	#用彈出式視窗顯示訊息,接著設置seesion變數,最後進行轉址.
531
	#回傳的結果:
532
	#$result["status"],執行是否成功,"true"代表成功,"false"代表不成功.
533
	#$result["error"],錯誤訊息陣列.
534
	#必填的參數:
535
	#$conf["headerLocation"],為要轉址到的地方,若爲 $_SERVER["PHP_SELF"],則爲回到目前頁面,全民資安素養網爲 https://isafe.moe.edu.tw/.
536
	$conf["headerLocation"]="/~qbpwcf/";
537
	#$conf["alertMessage"],字串陣列,要顯示的彈出式視窗內容,第n個元素代表第n行的內容.
538
	$conf["alertMessage"]=$authenticate["warning"];
539
	#可省略的參數:
540
	#$conf["sessionName"],字串陣,可以指派要建立的session變數名稱.
541
	#$conf["sessionName"]=array("");
542
	#$conf["sessionValue"]字串陣列,可以指派要建立的session變數的內容.
543
	#$conf["sessionValue"]=array("");
544
	#參靠資料來源:
545
	#http://php.net/manual/en/reserved.variables.server.php
546
	header::redirectionAfterAlertWindows($conf);
547
	unset($conf);
548
 
549
	}#if end
550
 
551
*/
552
 
553
#涵式說明:
554
#使用預設的app化設置.
555
#回傳的結果:
556
#app化的語法.
557
echo app::defaultMode();
558
 
559
#函式說明:
560
#將php設定檔常用的設定進行調整使之變成適用於開發模式、釋出模式、或自訂要調整哪些設定值
561
#回傳結果:
562
#$result["status"],執行是否正常,"true"為正常,"false"為不正常.
563
#$result["error"],錯誤訊息陣列.
564
#$result["function"],當前執行的函數名稱.
565
#必填參數:
566
#$conf["mode"],參數設定的模式,"release"代表是指共一般使用所需;"develop"代表是在開發狀態下所需;"custom"代表自訂參數設定內容
47 liveuser 567
$conf["mode"]=mode;
3 liveuser 568
#可省略參數:
569
#$conf["customSettings"],要自訂的參數與其數值,例如array("display_errors=On").
570
$conf["customSettings"]=array();
571
#參考資料:
572
#ini_set=>http://www.php.net/manual/en/function.ini-set.php
573
#各個參數適用的修改方式=>http://www.php.net/manual/en/ini.list.php
574
#各個參數適用的修改方式的解說=>http://hi.baidu.com/richardali/item/d28104083c70c638a2332a60
575
#備註:
576
#使用該函式後,網頁會無法顯示。
577
$changeSettings=config::changeSettings($conf);
578
unset($conf);
579
 
580
#如果變更設定失敗
581
if($changeSettings["status"]==="false"){
582
 
583
	#debug
47 liveuser 584
	var_dump($changeSettings);exit(1);
3 liveuser 585
 
586
	}#if end
587
 
226 liveuser 588
?>