| Line 55... |
Line 55... |
| 55 |
exit(1);
|
55 |
exit(1);
|
| 56 |
|
56 |
|
| 57 |
}#if end
|
57 |
}#if end
|
| 58 |
|
58 |
|
| 59 |
#函式說明:
|
59 |
#函式說明:
|
| 60 |
#更新程式檔案開頭版權宣告的年份
|
60 |
#更新程式檔案開頭版權宣告的年份,以及作者清單,取得更新過後的檔案路徑.
|
| 61 |
#回傳結果:
|
61 |
#回傳結果:
|
| 62 |
#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
|
62 |
#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
|
| 63 |
#$reuslt["error"],執行不正常結束的錯訊息陣列.
|
63 |
#$reuslt["error"],執行不正常結束的錯訊息陣列.
|
| 64 |
#$result["function"],當前執行的函式名稱.
|
64 |
#$result["function"],當前執行的函式名稱.
|
| - |
|
65 |
#$result["argu"],本函式使用的參數.
|
| 65 |
#$result["content"],有更新的檔案清單,其元素有被取代的檔案路徑與名稱跟replacedInfo,其中replacedInfo為陣列,其key為要變動的行號(從0開始算),其數值有"from"代表要被取代的原始內容,"to"代表要置換成的新內容.
|
66 |
#$result["content"],有更新的檔案清單,其元素有被取代的檔案路徑與名稱跟replacedInfo,其中replacedInfo為陣列,其key為要變動的行號(從0開始算),其數值有"from"代表要被取代的原始內容,"to"代表要置換成的新內容.
|
| - |
|
67 |
#$result["scannedFile"],陣列,有檢查過的檔案清單其完整路徑與檔案名稱.
|
| 66 |
#必填參數:
|
68 |
#必填參數:
|
| 67 |
#$conf["fileArgu"],字串,php變數__FILE__的內容,亦即該檔案在檔案系統的絕對路徑
|
69 |
#$conf["fileArgu"],字串,php變數__FILE__的內容,亦即該檔案在檔案系統的絕對路徑
|
| 68 |
$conf["fileArgu"]=__FILE__;
|
70 |
$conf["fileArgu"]=__FILE__;
|
| 69 |
#可省略參數:
|
71 |
#可省略參數:
|
| 70 |
#$conf["replaceFrom"],陣列,目標關鍵字,每個元素代表一行的內容,預設內容可參照本檔案開頭的版權宣告文字.
|
72 |
#$conf["replaceFrom"],陣列,目標關鍵字,每個元素代表一行的內容,預設內容可參照本檔案開頭的版權宣告文字.
|
| 71 |
#$conf["replaceFrom"]=array();
|
73 |
#$conf["replaceFrom"]=array();
|
| 72 |
#$conf["yearFrom],字串,起始年份,預設為西元"2014"年.
|
74 |
#$conf["yearFrom],字串,起始年份,預設為西元"2014"年.
|
| 73 |
#$conf["yearFrom"]="2014";
|
75 |
#$conf["yearFrom"]="2014";
|
| 74 |
#$conf["yearTo],字串,結束年份,預設為西元"gmdate('Y')"年.
|
76 |
#$conf["yearTo],字串,結束年份,預設為西元"gmdate('Y')"年.
|
| 75 |
#$conf["yearTo"]=gmdate('Y');
|
77 |
#$conf["yearTo"]=gmdate('Y');
|
| 76 |
#$conf["Authors"],陣列,該套件的參與者,預設為array("Min-Jhin,Chen");
|
78 |
#$conf["Authors"],陣列,該套件的參與者,預設為array("MIN-ZHI, CHEN");
|
| 77 |
#$conf["Authors"]=array("Min-Jhin,Chen");
|
79 |
#$conf["Authors"]=array("MIN-ZHI, CHEN");
|
| 78 |
#$conf["searchPath"],陣列,要搜尋哪些地方的檔案要更新版權宣告年份,預設為使用中的本套件位置.
|
80 |
#$conf["searchPath"],陣列,要搜尋哪些地方的檔案要更新版權宣告年份,預設為使用中的本套件位置.
|
| 79 |
#$conf["searchParh"]=array("");
|
81 |
#$conf["searchPath"]=array("");
|
| 80 |
#$conf["skipHiddenFolder"],字串,要略過隱藏的資料夾,預設為"true";反之為"false";
|
82 |
#$conf["skipHiddenFolder"],字串,要略過隱藏的資料夾,預設為"true";反之為"false";
|
| 81 |
#$conf["skipHiddenFolder"]="true";
|
83 |
#$conf["skipHiddenFolder"]="true";
|
| 82 |
#$conf["includeHiddenFolder"],陣列,符合名稱的隱藏資料夾會存取,預設不指定;
|
84 |
#$conf["includeHiddenFolder"],陣列,符合名稱的隱藏資料夾會存取,預設不指定;
|
| 83 |
#$conf["includeHiddenFolder"]=array("");
|
85 |
#$conf["includeHiddenFolder"]=array("");
|
| 84 |
#$conf["excludeDirName"],陣列,哪些目錄名稱要忽略,預設有"free-lib"、"no-free-lib"、"composer".
|
86 |
#$conf["excludeDirName"],陣列,哪些目錄名稱要忽略,預設有"free-lib"、"no-free-lib"、"composer".
|
| 85 |
#$conf["excludeDirName"]=array("free-lib","no-free-lib","composer");
|
87 |
#$conf["excludeDirName"]=array("free-lib","no-free-lib","composer");
|
| 86 |
#$conf["excludeMineType"],陣列,哪些檔案類型要忽略,預設有"image/*"、"video/*"、"audio/*"、"media/*"、"application/*".
|
88 |
#$conf["excludeMineType"],陣列,哪些檔案類型要忽略,預設有"image/*"、"video/*"、"audio/*"、"media/*"、"application/*".
|
| 87 |
#$conf["excludeMineType"]=array("image/*","video/*","audio/*","media/*","application/*");
|
89 |
#$conf["excludeMineType"]=array("image/*","video/*","audio/*","media/*","application/*");
|
| 88 |
#$conf["excludeSecondName"],陣列,哪些附檔名的檔案要忽略,預設有"log"、"csv"、"sql"、"js"、"css"、"html".
|
90 |
#$conf["excludeSecondName"],陣列,哪些附檔名的檔案要忽略,預設有"log"、"csv"、"sql"、"js"、"css"、"html".
|
| 89 |
#$conf["excludeSecondName"]=array("log"、,"csv","sql","js","css","html");
|
91 |
#$conf["excludeSecondName"]=array("log"、,"csv","sql","js","css","html");
|
| 90 |
#$conf["multiThread"],字串,是否要啟用多執行序,預設為"false",反之為"true".
|
92 |
#$conf["multiThread"],字串,是否要啟用多執行序,預設為"false",反之為"true",目前尚未支援.
|
| 91 |
#$conf["multiThread"]="";
|
93 |
#$conf["multiThread"]="false";
|
| 92 |
#$conf["threadType"],字串,當"multiThread"參數為"true"時,要使用的threas類型,預設為"socket",其他可能有"proc".
|
94 |
#$conf["threadType"],字串,當"multiThread"參數為"true"時,要使用的threas類型,預設為"socket",其他可能有"proc".
|
| 93 |
#$conf["threadType"]="socket";
|
95 |
#$conf["threadType"]="socket";
|
| 94 |
#$conf["socket"],字串,unix domain socket 的位置與名稱,預設為 qbpwcf_usock_path;
|
96 |
#$conf["socket"],字串,unix domain socket 的位置與名稱,預設為 qbpwcf_usock_path;
|
| 95 |
$conf["socket"]="assets of sock::unixDomainSockServer_20250228/unixDomainSockServer.sock";
|
97 |
$conf["socket"]="assets of sock::unixDomainSockServer_20250228/unixDomainSockServer.sock";
|
| 96 |
#$conf["log"],字串,log的檔案位置與名稱,預設不使用.
|
98 |
#$conf["log"],字串,log的檔案位置與名稱,預設不使用.
|
| 97 |
$conf["log"]="/tmp/phpLib::updateCopyRightYear:20250122-".$uuid["content"].".log";
|
99 |
#$conf["log"]="";
|
| 98 |
#$conf["outputPath"],字串,更新後的檔案內容要存放到哪個路徑低下,預設為 /tmp 底下.
|
100 |
#$conf["outputPath"],字串,更新後的檔案內容要存放到哪個路徑低下,預設為 /tmp 底下.
|
| 99 |
#$conf["outputPath"]="";
|
101 |
#$conf["outputPath"]="";
|
| 100 |
#參考資料:
|
102 |
#參考資料:
|
| 101 |
#無.
|
103 |
#無.
|
| 102 |
#備註:
|
104 |
#備註:
|
| 103 |
#無.
|
- |
|
| - |
|
105 |
#目前尚未支援參數 multiThread 為 true 的設置.
|
| 104 |
$updateCopyRightYear=phpLib::updateCopyRightYear($conf);
|
106 |
$updateCopyRightYear=phpLib::updateCopyRightYear($conf);
|
| 105 |
unset($conf);
|
107 |
unset($conf);
|
| 106 |
|
108 |
|
| 107 |
#debug
|
109 |
#debug
|
| 108 |
var_dump($updateCopyRightYear);
|
110 |
var_dump($updateCopyRightYear);
|