| 1 |
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
|
| 1 |
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 |
#使用命名空間qbpwcf
|
|
|
26 |
namespace qbpwcf;
|
|
|
27 |
|
|
|
28 |
#assets dir
|
|
|
29 |
$assetsDir="assets of fileAccess::validatePath_20250429";
|
|
|
30 |
|
|
|
31 |
#函式說明:
|
|
|
32 |
#確保路徑存在.
|
|
|
33 |
#回傳結果:
|
|
|
34 |
#$result["status"],執行正常與否,"true"代表正常,"false"代表不正常.
|
|
|
35 |
#$result["error"],錯誤訊息陣列.
|
|
|
36 |
#$resutl["function"],當前執行的涵式名稱.
|
|
|
37 |
#$result["path"],建立好的路徑字串.
|
|
|
38 |
#$result["fileName"],檔案名稱,若 $conf["haveFileName"] 為 "true" 則會回傳.
|
|
|
39 |
#$result["argu"],使用的參數.
|
|
|
40 |
#必填參數:
|
|
|
41 |
#$conf["path"],要檢查的路徑
|
|
|
42 |
$conf["path"]="'".$assetsDir."/qbpwcf-usock.sock'";
|
|
|
43 |
#$conf["fileArgu"],字串,php變數__FILE__的內容,亦即該檔案在檔案系統的絕對路徑
|
|
|
44 |
$conf["fileArgu"]=__FILE__;
|
|
|
45 |
#可省略參數:
|
|
|
46 |
#$conf["haveFileName"],字串,"true"代表有$conf["path"]檔案名稱,"false"代表$conf["path"]為純路徑,預設為"false".
|
|
|
47 |
#$conf["haveFileName"]="false";
|
|
|
48 |
#$conf["dirPermission"],字串,新建資料夾的權限設定,預設爲0770,亦即擁有者,同群組者可以讀,寫,存取,其他人無法使用.
|
|
|
49 |
#$conf["dirPermission"]="";
|
|
|
50 |
#$conf["web"],是否為檔案系統,"true"為網頁路徑,"false"為網頁系統,預設為"false".
|
|
|
51 |
#$conf["web"]="";
|
|
|
52 |
#參考資料:
|
|
|
53 |
#無.
|
|
|
54 |
#備註:
|
|
|
55 |
#無.
|
|
|
56 |
$validatePath=fileAccess::validatePath($conf);
|
|
|
57 |
unset($conf);
|
|
|
58 |
|
|
|
59 |
#debug
|
| 226 |
liveuser |
60 |
var_dump($validatePath);
|