Subversion Repositories php-qbpwcf

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
316 liveuser 1
<?php
2
 
3
/*
4
 
5
	QBPWCF, Quick Build PHP website Component base on Fedora Linux.
6
    Copyright (C) 2014~2026 MIN ZHI, CHEN
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_phpLib::updateCopyRightYear_20260330";
30
 
31
#函式說明:
32
#更新程式檔案開頭版權宣告的年份,以及作者清單,取得更新過後的檔案路徑.
33
#回傳結果:
34
#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
35
#$reuslt["error"],執行不正常結束的錯訊息陣列.
36
#$result["function"],當前執行的函式名稱.
37
#$result["argu"],本函式使用的參數.
38
#$result["content"],有更新的檔案清單,其元素有被取代的檔案路徑與名稱跟replacedInfo,其中replacedInfo為陣列,其key為要變動的行號(從0開始算),其數值有"from"代表要被取代的原始內容,"to"代表要置換成的新內容.
39
#$result["scannedFile"],陣列,有檢查過的檔案清單其完整路徑與檔案名稱.
40
#必填參數:
41
#$conf["fileArgu"],字串,php變數__FILE__的內容,亦即該檔案在檔案系統的絕對路徑
42
$conf["fileArgu"]=__FILE__;
43
#可省略參數:
44
#$conf["replaceFrom"],陣列,目標關鍵字,每個元素代表一行的內容,預設內容可參照本檔案開頭的版權宣告文字.
45
#$conf["replaceFrom"]=array();
46
#$conf["yearFrom],字串,起始年份,預設為西元"2014"年.
47
#$conf["yearFrom"]="2014";
48
#$conf["yearTo],字串,結束年份,預設為西元"gmdate('Y')"年.
49
#$conf["yearTo"]=gmdate('Y');
50
#$conf["Authors"],陣列,該套件的參與者,預設為array("MIN-ZHI, CHEN");
51
#$conf["Authors"]=array("MIN-ZHI, CHEN");
52
#$conf["searchPath"],陣列,要搜尋哪些地方的檔案要更新版權宣告年份,預設為使用中的本套件位置.
53
$conf["searchPath"]=array("assets_of_phpLib::updateCopyRightYear_20260330");
54
#$conf["skipHiddenFolder"],字串,要略過隱藏的資料夾,預設為"true";反之為"false";
55
#$conf["skipHiddenFolder"]="true";
56
#$conf["includeHiddenFolder"],陣列,符合名稱的隱藏資料夾會存取,預設不指定;
57
#$conf["includeHiddenFolder"]=array("");
58
#$conf["excludeDirName"],陣列,哪些目錄名稱要忽略,預設有"free-lib"、"no-free-lib"、"composer".
59
#$conf["excludeDirName"]=array("free-lib","no-free-lib","composer");
60
#$conf["excludeMineType"],陣列,哪些檔案類型要忽略,預設有"image/*"、"video/*"、"audio/*"、"media/*"、"application/*".
61
#$conf["excludeMineType"]=array("image/*","video/*","audio/*","media/*","application/*");
62
#$conf["excludeSecondName"],陣列,哪些附檔名的檔案要忽略,預設有"log"、"csv"、"sql"、"js"、"css"、"html"、"key"、"crt"、"pem".
63
#$conf["excludeSecondName"]=array("log"、,"csv","sql","js","css","html");
64
#$conf["multiThread"],字串,是否要啟用多執行序,預設為"false",反之為"true",目前尚未支援.
65
#$conf["multiThread"]="false";
66
#$conf["threadType"],字串,當"multiThread"參數為"true"時,要使用的threas類型,預設為"socket",其他可能有"proc".
67
#$conf["threadType"]="socket";
68
#$conf["socket"],字串,unix domain socket 的位置與名稱,預設為 qbpwcf_usock_path;
69
#$conf["socket"]=qbpwcf_usock_path;
70
#$conf["log"],字串,log的檔案位置與名稱,預設不使用.
71
$conf["log"]=$logFile;
72
#$conf["outputPath"],字串,更新後的檔案內容要存放到哪個路徑低下,預設為 /tmp 底下.
73
#$conf["outputPath"]="";
74
#參考資料:
75
#無.
76
#備註:
77
#目前尚未支援參數 multiThread 為 true 的設置.
78
$updateCopyRightYear=phpLib::updateCopyRightYear($conf);
79
unset($conf);
80
 
81
#debug
82
var_dump($updateCopyRightYear);