| 3 |
liveuser |
1 |
<?php
|
|
|
2 |
|
|
|
3 |
/*
|
|
|
4 |
|
|
|
5 |
QBPWCF, Quick Build PHP website Component base on Fedora Linux.
|
| 226 |
liveuser |
6 |
Copyright (C) 2014~2025 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 |
#只要匯入當前目錄底下的 allInOneForSOAP.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 |
#如果尚未取得 lib path
|
|
|
53 |
if(!isset($folderOfUsrLib)){
|
|
|
54 |
|
|
|
55 |
#儲存要執行的指令
|
|
|
56 |
$cmd="php -f ".escapeshellarg(pathinfo(__FILE__)["dirname"]."/../../bin/libexec/folderOfUsrLib.php");
|
|
|
57 |
|
|
|
58 |
#取得 lib path
|
|
|
59 |
exec($cmd,$output,$status);
|
|
|
60 |
|
|
|
61 |
#如果執行失敗
|
|
|
62 |
if($status!==0){
|
|
|
63 |
|
|
|
64 |
#debug
|
|
|
65 |
var_dump($cmd,$ouput,$status);
|
|
|
66 |
|
|
|
67 |
#結束執行,回傳shell 1.
|
|
|
68 |
exit(1);
|
|
|
69 |
|
|
|
70 |
}#if end
|
|
|
71 |
|
|
|
72 |
#儲存lib path
|
|
|
73 |
$folderOfUsrLib=$output[0];
|
| 226 |
liveuser |
74 |
|
| 3 |
liveuser |
75 |
}#if end
|
|
|
76 |
|
|
|
77 |
#匯入自建的php類別檔
|
|
|
78 |
require_once("amazon.php"); #跟 amazon 互動的類別
|
|
|
79 |
require_once("analyse.php"); #跟問卷整理分析有關的類別
|
|
|
80 |
require_once("app.php"); #讓網頁變得更行動與app化
|
|
|
81 |
require_once("autoService.php"); #讓網頁可以管理系統的自動化服務
|
|
|
82 |
require_once("arrays.php"); #跟陣列有關的方法
|
|
|
83 |
require_once("authenticate.php"); #裏面包含跟驗證有關的功能
|
|
|
84 |
require_once("bigbluebutton.php"); #big blue button的應用
|
|
|
85 |
require_once("canvas.php"); #canvas 的應用
|
|
|
86 |
require_once("catchWebContent.php"); #包含可以抓取網頁內容的功能
|
|
|
87 |
require_once("chartJS.php"); #繪製圖表的js
|
|
|
88 |
require_once("cmd.php"); #跟命令列有關的功能
|
|
|
89 |
require_once("config.php"); #用於改變php執行環境的類別
|
|
|
90 |
require_once("css.php"); #裏面包含設定css樣式的功能,網頁美觀就靠它了。
|
|
|
91 |
require_once("csv.php"); #跟csv檔案有關的功能
|
|
|
92 |
require_once("csInformation.php"); #裏面包含取得用戶、伺服端資訊的功能。
|
|
|
93 |
#require_once("communication.php"); #網路通訊相關功能,開發中...
|
| 169 |
liveuser |
94 |
require_once("controlStructures.php"); #control structures 的應用.
|
| 3 |
liveuser |
95 |
require_once("ckEditor.php"); #ckeditor的相關應用
|
|
|
96 |
require_once("dataTable.php"); #將資料表的資料呈現出來並附上操作選項的設置
|
|
|
97 |
require_once("db.php"); #裏面包含跟資料庫操作有關的功能
|
|
|
98 |
require_once("external.php"); #執行外部程式
|
|
|
99 |
require_once("exam.php"); #包含跟測驗有關的功能
|
|
|
100 |
require_once("fb.php"); #裏面包含facebook提供的api服務
|
|
|
101 |
require_once("fileAccess.php"); #裏面包含檔案讀、寫的功能
|
|
|
102 |
require_once("flash.php"); #裏面包含嵌入flash到網頁會用到的功能
|
|
|
103 |
require_once("form.php"); #裏面包含表單的設計、傳送、接收與跟處理上傳檔案有關的功能
|
|
|
104 |
require_once("fuse.php"); #包含fuse的使用(ftp,sftp,glusterfs...)
|
|
|
105 |
require_once("frame.php"); #裏面包含 iframe 的設置功能
|
|
|
106 |
require_once("googleMap.php"); #裡面包含 googleMap 的應用
|
|
|
107 |
require_once("header.php"); #裏面包含轉址、網頁編碼、檔案下載、網頁資訊等設定功能
|
|
|
108 |
require_once("hive.php"); #連線到hiveServer進行操作
|
|
|
109 |
require_once("html.php"); #管理網頁內容的功能
|
|
|
110 |
require_once("img.php"); #裏面關於在網頁嵌入圖片、與繪圖的功能
|
|
|
111 |
require_once("javaScript.php"); #一些javaScript函式、語法可以參考
|
|
|
112 |
require_once("jquery.php"); #javascript的函式庫,提供較易使用的方式
|
|
|
113 |
require_once("jwt.php"); #提供 jwt token 的應用
|
|
|
114 |
require_once("libreoffice.php"); #提供 libreoffice 相關的應用
|
|
|
115 |
require_once("line.php"); # 提供 line 的相關應用
|
|
|
116 |
require_once("link.php"); #裏面包含跟超連結有關的功能
|
|
|
117 |
require_once("logs.php"); #跟log相關的功能
|
|
|
118 |
require_once("mail.php"); #跟寄信有關的功能
|
|
|
119 |
require_once("maintain.php"); #跟維護有關的類別
|
|
|
120 |
require_once("math.php"); #裏面包含跟數學運算有關的功能
|
|
|
121 |
require_once("od.php"); #跟open document有關的功能
|
|
|
122 |
require_once("parser.php"); #跟解析內容相關的功能.
|
|
|
123 |
require_once("phpLib.php"); #跟php函式庫管理有關的類別
|
|
|
124 |
require_once("qemu.php"); #跟qemu有關的功能
|
|
|
125 |
require_once("qrCode.php"); #裏面包含qrCode的功能
|
|
|
126 |
require_once("R.php"); #用於統計與報表產生的套件
|
|
|
127 |
require_once("record.php"); #用於記錄資訊的套件功能
|
|
|
128 |
require_once("session.php"); #用於管理session的功能
|
|
|
129 |
require_once("search.php"); #裏面包含跟搜尋有關的功能
|
|
|
130 |
require_once("security.php"); #裏面包含跟保護製作權有關的功能
|
|
|
131 |
require_once("soap.php"); #webService建構、存取的相關功能
|
|
|
132 |
require_once("sock.php"); #unix domain socket
|
|
|
133 |
require_once("sound.php"); #裏面包含嵌入音樂、聲音、語音到網頁的功能
|
|
|
134 |
require_once("stop.php"); #跟程式中止有關的功能
|
|
|
135 |
require_once("stringProcess.php"); #裏面包含字串處理的功能
|
|
|
136 |
require_once("tab.php"); #提供建立tab的功能
|
|
|
137 |
require_once("text.php"); #提供文字顯示的功能
|
|
|
138 |
require_once("table.php"); #裏面包含建立表格的功能
|
|
|
139 |
require_once("threads.php"); #提供多執行序功能
|
|
|
140 |
require_once("time.php"); #裏面包含關於跟時鐘、期間限定有關的功能
|
|
|
141 |
require_once("variableCheck.php"); #變數檢查
|
|
|
142 |
require_once("video.php"); #裏面包含跟嵌入影片到網頁有關的功能
|
|
|
143 |
require_once("webSock.php"); #裡面包含web socket的應用
|
|
|
144 |
require_once("xml.php"); #裏面包含xml資料的截取功能
|
|
|
145 |
require_once("zerossl.php"); #裡面包含應用zerossl提供的服務
|
|
|
146 |
|
|
|
147 |
#匯入全域的設定檔
|
| 226 |
liveuser |
148 |
require_once(pathinfo(__FILE__)["dirname"]."/../../../etc/qbpwcf/allInOneConfig.php");
|
| 3 |
liveuser |
149 |
|
|
|
150 |
#覆蓋資料庫連結用的資訊
|
|
|
151 |
#$dbAddress="localhost";#資料庫的位置
|
|
|
152 |
#$dbPort="3306";#資料庫的 tcp port
|
|
|
153 |
#$dbAccount="root";#資料庫帳號
|
|
|
154 |
#$dbPassword="";#資料庫密碼
|
|
|
155 |
#$dbName="test";#資料庫名稱
|
|
|
156 |
|
|
|
157 |
#定義常數變數,bbb service url
|
|
|
158 |
define("bbbUrl",$bbbUrl);
|
|
|
159 |
|
|
|
160 |
#定義常數變數,bbb service secret
|
|
|
161 |
define("bbbSecret",$bbbSecret);
|
|
|
162 |
|
| 182 |
liveuser |
163 |
#定義資料庫系統加解密用的GnuPG ID
|
| 3 |
liveuser |
164 |
define("dbSecret",$dbSecret);
|
|
|
165 |
|
|
|
166 |
#定義 qbpwcf unix domain socket path
|
|
|
167 |
define("qbpwcf_usock_path",$qbpwcf_usock_path);
|
|
|
168 |
|
|
|
169 |
#定義 Zero SSL API access key
|
|
|
170 |
define("zeroSSLapiKey",$zeroSSLapiKey);
|
|
|
171 |
|
| 77 |
liveuser |
172 |
#定義運行web服務的賬戶
|
|
|
173 |
define("webUser",$webUser);
|
|
|
174 |
|
|
|
175 |
#定義系統的domain
|
|
|
176 |
define("domain",$domain);
|
|
|
177 |
|
| 63 |
liveuser |
178 |
#定義用於gpg加解密的預設id
|
|
|
179 |
define("gnupgId",$gnupgId);
|
|
|
180 |
|
| 30 |
liveuser |
181 |
#定義供系統寄送信件的email帳號
|
|
|
182 |
define("systemMailAcct",$systemMailAcct);
|
|
|
183 |
|
|
|
184 |
#定義供系統寄送信件的email密碼
|
|
|
185 |
define("systemMailPass",$systemMailPass);
|
|
|
186 |
|
| 47 |
liveuser |
187 |
#定義環境模式
|
|
|
188 |
define("mode",$mode);
|
|
|
189 |
|
| 53 |
liveuser |
190 |
#定義 web socket server 預設的 listen address
|
|
|
191 |
define("webSocketServerDefaultListenAddr",$webSocketServerDefaultListenAddr);
|
|
|
192 |
|
|
|
193 |
#定義 web soscket server 預設的 listen port
|
|
|
194 |
define("webSocketServerDefaultListenPort",$webSocketServerDefaultListenPort);
|
|
|
195 |
|
|
|
196 |
|
| 47 |
liveuser |
197 |
#函式說明:
|
|
|
198 |
#將php設定檔常用的設定進行調整使之變成適用於開發模式、釋出模式、或自訂要調整哪些設定值
|
|
|
199 |
#回傳結果:
|
|
|
200 |
#$result["status"],執行是否正常,"true"為正常,"false"為不正常.
|
|
|
201 |
#$result["error"],錯誤訊息陣列.
|
|
|
202 |
#$result["function"],當前執行的函數名稱.
|
|
|
203 |
#必填參數:
|
|
|
204 |
#$conf["mode"],參數設定的模式,"release"代表是指共一般使用所需;"develop"代表是在開發狀態下所需;"custom"代表自訂參數設定內容
|
|
|
205 |
$conf["mode"]="release";
|
|
|
206 |
#可省略參數:
|
|
|
207 |
#$conf["customSettings"],要自訂的參數與其數值,例如array("display_errors=On").
|
|
|
208 |
$conf["customSettings"]=array();
|
|
|
209 |
#參考資料:
|
|
|
210 |
#ini_set=>http://www.php.net/manual/en/function.ini-set.php
|
|
|
211 |
#各個參數適用的修改方式=>http://www.php.net/manual/en/ini.list.php
|
|
|
212 |
#各個參數適用的修改方式的解說=>http://hi.baidu.com/richardali/item/d28104083c70c638a2332a60
|
|
|
213 |
#備註:
|
|
|
214 |
#使用該函式後,網頁會無法顯示。
|
|
|
215 |
$changeSettings=config::changeSettings($conf);
|
|
|
216 |
unset($conf);
|
|
|
217 |
|
|
|
218 |
#如果變更設定失敗
|
|
|
219 |
if($changeSettings["status"]==="false"){
|
|
|
220 |
|
|
|
221 |
#debug
|
|
|
222 |
var_dump($changeSettings);exit(1);
|
|
|
223 |
|
|
|
224 |
}#if end
|
|
|
225 |
|
| 226 |
liveuser |
226 |
?>
|