Subversion Repositories php-qbpwcf

Rev

Rev 239 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 239 Rev 240
Line 4678... Line 4678...
4678
					$result["scannedFile"][]=$NodePathAndName;
4678
					$result["scannedFile"][]=$NodePathAndName;
4679
 
4679
 
4680
					#debug
4680
					#debug
4681
					#var_dump(__LINE__,"found file:".$NodePathAndName." mimeType:".$node["mimeType"]);
4681
					#var_dump(__LINE__,"found file:".$NodePathAndName." mimeType:".$node["mimeType"]);
4682
 
4682
 
4683
					#如果沒有用多執行序
4683
					#設置起始年份
4684
					if($conf["multiThread"]==="false"){
4684
					$replaceTo[1]["yearFrom"]=$conf["yearFrom"];
4685
 
4685
 
4686
						#設置起始年份
4686
					#設置到的年份
4687
						$replaceTo[1]["yearFrom"]=$conf["yearFrom"];
4687
					$replaceTo[1]["yearTo"]=$conf["yearTo"];
4688
 
4688
 
-
 
4689
					#將作者陣列變成字串.
-
 
4690
					#函式說明:
-
 
4691
					#將一維陣列轉換為用特定符號間隔的字串,ex:array("1","2","3") to "a;b;c;".
4689
						#設置到的年份
4692
					#回傳的結果:
-
 
4693
					#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
-
 
4694
					#$result["function"],當前執行的function名稱
-
 
4695
					#$result["error"],錯誤訊息陣列.
-
 
4696
					#$result["content"],處理好的字串.
-
 
4697
					#$result["argu"],使用的參數.
-
 
4698
					#必填參數:
-
 
4699
					#$conf["inputArray"],字串陣列,要轉成字串的一維陣列.
-
 
4700
					$conf["arrays::arrayToString"]["inputArray"]=$conf["Authors"];
-
 
4701
					#可省略參數:
-
 
4702
					#$conf["spiltSymbol"],字串,用來區隔字串的符號,預設為;
-
 
4703
					$conf["arrays::arrayToString"]["spiltSymbol"]=", ";
-
 
4704
					#$conf["skipEnd"],字串,結尾是否不要加上符號,預設為"false",要加上符號,"true"代表不要加上符號.
-
 
4705
					$conf["arrays::arrayToString"]["skipEnd"]="true";
-
 
4706
					#$conf["spiltSymbolAtStart"],字串,是否要在開頭加上spiltSymbol,預設為"false",代表不要;反之為“true”.
-
 
4707
					#$conf["spiltSymbolAtStart"]="";
-
 
4708
					#參考資料:
-
 
4709
					#無.
-
 
4710
					#備註:
-
 
4711
					#無.
-
 
4712
					$arrayToString=arrays::arrayToString($conf["arrays::arrayToString"]);
4690
						$replaceTo[1]["yearTo"]=$conf["yearTo"];
4713
					unset($conf["arrays::arrayToString"]);
4691
 
4714
 
4692
						#將作者陣列變成字串.
-
 
4693
						#函式說明:
-
 
4694
						#將一維陣列轉換為用特定符號間隔的字串,ex:array("1","2","3") to "a;b;c;".
-
 
4695
						#回傳的結果:
-
 
4696
						#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
-
 
4697
						#$result["function"],當前執行的function名稱
-
 
4698
						#$result["error"],錯誤訊息陣列.
-
 
4699
						#$result["content"],處理好的字串.
-
 
4700
						#$result["argu"],使用的參數.
-
 
4701
						#必填參數:
4715
					#如果執行異常
4702
						#$conf["inputArray"],字串陣列,要轉成字串的一維陣列.
-
 
4703
						$conf["arrays::arrayToString"]["inputArray"]=$conf["Authors"];
-
 
4704
						#可省略參數:
-
 
4705
						#$conf["spiltSymbol"],字串,用來區隔字串的符號,預設為;
-
 
4706
						$conf["arrays::arrayToString"]["spiltSymbol"]=", ";
-
 
4707
						#$conf["skipEnd"],字串,結尾是否不要加上符號,預設為"false",要加上符號,"true"代表不要加上符號.
-
 
4708
						$conf["arrays::arrayToString"]["skipEnd"]="true";
4716
					if($arrayToString["status"]==="false"){
4709
						#$conf["spiltSymbolAtStart"],字串,是否要在開頭加上spiltSymbol,預設為"false",代表不要;反之為“true”.
-
 
4710
						#$conf["spiltSymbolAtStart"]="";
-
 
4711
						#參考資料:
-
 
4712
						#無.
-
 
4713
						#備註:
-
 
4714
						#無.
-
 
4715
						$arrayToString=arrays::arrayToString($conf["arrays::arrayToString"]);
-
 
4716
						unset($conf["arrays::arrayToString"]);
-
 
4717
 
4717
 
4718
						#如果執行異常
4718
						#設置執行異常的識別
4719
						if($arrayToString["status"]==="false"){
4719
						$result["status"]="false";
4720
 
4720
 
4721
							#設置執行異常的識別
4721
						#設置執行錯誤訊息
4722
							$result["status"]="false";
4722
						$result["error"]=$arrayToString;
4723
 
4723
 
4724
							#設置執行錯誤訊息
4724
						#回傳結果
4725
							$result["error"]=$arrayToString;
4725
						return $result;
4726
 
4726
 
4727
							#回傳結果
4727
						}#if end
4728
							return $result;
-
 
4729
 
4728
 
4730
							}#if end
4729
					#設置作者清單字串
-
 
4730
					$replaceTo[1]["Authors"]=$arrayToString["content"];
4731
 
4731
 
4732
						#設置作者清單字串
4732
					#如果沒有用多執行序
4733
						$replaceTo[1]["Authors"]=$arrayToString["content"];
4733
					if($conf["multiThread"]==="false"){
4734
 
4734
 
4735
						#函式說明:
4735
						#函式說明:
4736
						#置換檔案內容中符合的內容.
4736
						#置換檔案內容中符合的內容.
4737
						#回傳結果:
4737
						#回傳結果:
4738
						#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
4738
						#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
Line 4867... Line 4867...
4867
						}#if end
4867
						}#if end
4868
 
4868
 
4869
					#反之為多執行序
4869
					#反之為多執行序
4870
					else{
4870
					else{
4871
 
4871
 
4872
						#...
4872
						#要執行的php程式內容
4873
						#待實作
4873
						$cmdString=<<<'PHP'
-
 
4874
/*
4874
 
4875
 
-
 
4876
        QBPWCF, Quick Build PHP website Component base on Fedora Linux.
4875
						}#else end
4877
    Copyright (C) 2014~2026 MIN ZHI, CHEN
4876
 
4878
 
4877
					}#if end
4879
    This file is part of QBPWCF.
4878
 
4880
 
-
 
4881
    QBPWCF is free software: you can redistribute it and/or modify
-
 
4882
    it under the terms of the GNU General Public License as published by
-
 
4883
    the Free Software Foundation, either version 3 of the License, or
4879
				}#foreach end
4884
    (at your option) any later version.
4880
 
4885
 
-
 
4886
    QBPWCF is distributed in the hope that it will be useful,
-
 
4887
    but WITHOUT ANY WARRANTY; without even the implied warranty of
-
 
4888
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
4881
			}#foreach end
4889
    GNU General Public License for more details.
4882
 
4890
 
4883
		#debug
-
 
-
 
4891
    You should have received a copy of the GNU General Public License
4884
		#var_dump(__FUNCTION__,__LINE__,print_r($conf,true));exit;
4892
    along with QBPWCF.  If not, see <http://www.gnu.org/licenses/>.
4885
 
4893
 
4886
		#如果有啟用多執行序
-
 
4887
		if($conf["multiThread"]==="true"){
-
 
-
 
4894
*/
4888
 
4895
 
4889
			#debug
4896
#使用命名空間qbpwcf
4890
			#var_dump($conf);exit;
4897
namespace qbpwcf;
4891
 
4898
 
4892
			#如果有執行的程序要確認回饋
-
 
4893
			if(isset($procs)){
4899
#匯入套件
-
 
4900
PHP;
4894
 
4901
 
4895
				#debug
4902
						#匯入套件的路徑
4896
				#var_dump($procs);exit;
4903
						$cmdString=$cmdString.PHP_EOL."require_once(\"".$libPath."/qbpwcf/allInOne.php\");";
4897
 
4904
 
4898
				#如果有要log
4905
						#要執行的php程式內容,設定建議的 log 位置.
4899
				if(isset($conf["log"])){
4906
						$cmdString=$cmdString.PHP_EOL.<<<'PHP'
4900
 
4907
 
4901
					#log for run time of start and end info
4908
#建議的log位置
4902
					$logPathForRunTimeOfStartAndEnd="/tmp/".basename($conf["log"]).":".$uuid."-runTimeOfStartAndEnd.log";
4909
$logFile=$_SERVER["DOCUMENT_ROOT"].$_SERVER["PHP_SELF"].".log";
4903
 
4910
 
4904
					#函式說明:
-
 
4905
					#撰寫log
-
 
4906
					#回傳結果:
-
 
4907
					#$result["status"],狀態,"true"或"false".
-
 
4908
					#$result["error"],錯誤訊息陣列.
-
 
4909
					#$result["function"],當前函式的名稱.
-
 
4910
					#$result["argu"],使用的參數.
-
 
4911
					#必填參數:
-
 
4912
					#$conf["path"],字串,log檔案的路徑與名稱.
-
 
4913
					$conf["logs::record"]["path"]=$logPathForRunTimeOfStartAndEnd;
-
 
4914
					#$conf["content"],any,要寫的內容,若內容不為字串則會用var_dump的格式寫入.
-
 
4915
					$conf["logs::record"]["content"]="start at ".gmdate("Y-m-d H:i:s");
-
 
4916
					#$conf["fileArgu"],字串,php變數__FILE__的內容,亦即該檔案在檔案系統的絕對路徑
-
 
4917
					$conf["logs::record"]["fileArgu"]=__FILE__;
-
 
4918
					#可省略參數:
-
 
4919
					#$conf["rewrite"],預設為"false",接續寫入;反之"true"代表重新寫入.
-
 
4920
					#$conf["rewrite"]="false";
-
 
4921
					#參考資料:
-
 
4922
					#無.
-
 
4923
					#備註:
-
 
4924
					#無.
4911
PHP;
4925
					$record=logs::record($conf["logs::record"]);
-
 
4926
					unset($conf["logs::record"]);
-
 
4927
 
4912
 
4928
					#如果出錯
4913
#$NodePathAndName
4929
					if($record["status"]==="false"){
4914
$cmdString=$cmdString.PHP_EOL."\$NodePathAndName=".$NodePathAndName.";";
4930
 
4915
 
4931
						#設置錯誤識別
4916
#$replaceFrom
4932
						$result["status"]="false";
4917
$cmdString=$cmdString.PHP_EOL."\$replaceFrom=".$conf["replaceFrom"].";";
4933
 
4918
 
4934
						#設置錯誤訊息
4919
#replaceTo
4935
						$result["error"]=$record;
4920
$cmdString=$cmdString.PHP_EOL."\$replaceTo=".$replaceTo.";";
4936
 
4921
 
4937
						#印出json
4922
#要執行的php程式內容
4938
						echo json_encode($result);
4923
$cmdString=$cmdString.PHP_EOL.<<<'PHP'
4939
 
4924
 
-
 
4925
#函式說明:
-
 
4926
#置換檔案內容中符合的內容.
-
 
4927
#回傳結果:
-
 
4928
#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
4940
						#結束執行,回傳1給shell,代表異常,
4929
#$reuslt["error"],執行不正常結束的錯訊息陣列.
-
 
4930
#$result["function"],當前執行的函式名稱.
-
 
4931
#$result["argu"],本函式使用的參數.
-
 
4932
#$result["content"],更新後的檔案內容陣列.每個元素代表一行的內容.
-
 
4933
#$result["found"],字串,是否有找到符合條件需要置換的內容.
-
 
4934
#$result["relaceInfo"],陣列,記錄需要置換的行資訊,元素的key為需要置換的行號,第 $i 行用 $i+1 表示.
-
 
4935
#$result["relaceInfo"][$i]["ori"],字串,第 $i+1 行原始的內容.
-
 
4936
#$result["relaceInfo"][$i]["new"],字串,第 $i+1 行要置換成的內容.
-
 
4937
#$result["content"],陣列,替換完後的每行內容.
-
 
4938
#必填參數:
-
 
4939
#$conf["fileArgu"],字串,php變數__FILE__的內容,亦即該檔案在檔案系統的絕對路徑
-
 
4940
$conf["phpLib::replaceMatchContent"]["fileArgu"]=__FILE__;
-
 
4941
#$conf["file"],字串,要置換內容的檔案路徑與名稱.
-
 
4942
$conf["phpLib::replaceMatchContent"]["file"]=$NodePathAndName;
-
 
4943
#$conf["formats"],陣列,連續的關鍵字字串.
-
 
4944
$conf["phpLib::replaceMatchContent"]["formats"]=$replaceFrom;
-
 
4945
#$conf["replaceTo"],陣列,原始內容要如何置換,每個元素的索引對應到formats參數的每個元素,若其索引不存在則代表對應的行不異動.
-
 
4946
$conf["phpLib::replaceMatchContent"]["replaceTo"]=$replaceTo;
-
 
4947
#可省略參數:
-
 
4948
#無.
4941
						exit(1);
4949
#參考資料:
-
 
4950
#無.
-
 
4951
#備註:
-
 
4952
#參數設定 $conf["replaceTo"][$i]=$replaceStr; 代表符合格式的連續字串中的 $i+1 行內容要置換成 $replaceStr.
-
 
4953
#參數設定 $conf["replaceTo"][$i]=array("varName1"=>$replaceStr1,"varName2"=>$replaceStr2); 代表符合格式的連續字串中的 $i+1 行內容中的變數 varName1 要置換成 $replaceStr1;變數 varName2 要置換成 $replaceStr2.
-
 
4954
$replaceMatchContent=phpLib::replaceMatchContent($conf["phpLib::replaceMatchContent"]);
-
 
4955
unset($conf["phpLib::replaceMatchContent"]);
4942
 
4956
 
-
 
4957
#如果執行異常
-
 
4958
if($replaceMatchContent["status"]==="false"){
-
 
4959
 
-
 
4960
	#設置執行異常的識別
-
 
4961
	$result["status"]="false";
-
 
4962
 
-
 
4963
	#設置執行錯誤訊息
-
 
4964
	$result["error"]=$replaceMatchContent;
-
 
4965
 
-
 
4966
	#回傳結果
-
 
4967
	return $result;
-
 
4968
 
-
 
4969
	}#if end
-
 
4970
 
-
 
4971
PHP;
-
 
4972
 
-
 
4973
#$outputPath
-
 
4974
$cmdString=$cmdString.PHP_EOL."\$outputPath\"=".$conf["outputPath"].";";
-
 
4975
 
-
 
4976
<<<'PHP'
-
 
4977
 
-
 
4978
#如果有需要更新檔案內容的識別
-
 
4979
if($replaceMatchContent["found"]==="true"){
-
 
4980
 
-
 
4981
	#$replaceMatchContent["relaceInfo"][$i]["new"],第 $i+1 行的新內容.
-
 
4982
 
-
 
4983
	#初始化給予 fileAccess::updateFile 的參數
-
 
4984
	$replaceSpecifyLine=array();
-
 
4985
 
-
 
4986
	#針對每個要更新的行
-
 
4987
	foreach($replaceMatchContent["relaceInfo"] as $lineIndex => $info){
-
 
4988
 
-
 
4989
		#設置給予 fileAccess::updateFile 的參數
-
 
4990
		$replaceSpecifyLine[$lineIndex]=$info["new"];
-
 
4991
 
-
 
4992
		}#foreach end
-
 
4993
 
-
 
4994
	#更新檔案內容
-
 
4995
	#函式說明:
-
 
4996
	#更新檔案的內容.
-
 
4997
	#回傳結果:
-
 
4998
	#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
-
 
4999
	#$result["error"],錯誤訊息.
-
 
5000
	#$result["function"],當前執行的函數名稱.
-
 
5001
	#$result["content"],更新的資訊.
-
 
5002
	#必填參數:
-
 
5003
	#$conf["fileArgu"],字串,變數__FILE__的內容.
-
 
5004
	$conf["fileAccess::updateFile"]["fileArgu"]=__FILE__;
-
 
5005
	#$conf["file"],字串,要更新的檔案位置與名稱.
-
 
5006
	$conf["fileAccess::updateFile"]["file"]=$NodePathAndName;
-
 
5007
	#可省略參數:
-
 
5008
	#$conf["overWriteWith"],字串陣列,要置換成什麼樣的內容,每個元素代表一行內容.
-
 
5009
	$conf["fileAccess::updateFile"]["overWriteWith"]=$replaceMatchContent["content"];
-
 
5010
	#$conf["replaceWith"],字串陣列,要將什麼內容置換成什麼內容.
-
 
5011
	#$conf["replaceWith"]=array(array("ori content","new content"),array("ori content","new content"),...);
-
 
5012
	#$conf["replaceLike"],字串,預設為"false",代表要完全符合關鍵字才能進行整行替換;反之為"true".
-
 
5013
	#$conf["replaceLike"]="false";
-
 
5014
	#$conf["addToTailWhenNoMatch"],字串,預設為"false"不做事;若為"true",則代表若使用 "replaceWith" 參數但沒有符合條件的內容出現,則新增到檔案的尾端.
-
 
5015
	#$conf["addToTailWhenNoMatch"]="false";
-
 
5016
	#$conf["addToTailBeforeThat"],字串,當 "replaceWith" 參數有使用,且 "addToTailWhenNoMatch" 為 "true" 時,若有使用該參數,則會從尾端尋找符合條件的行內容,然後將 沒有符合 "replaceWith" 條件的內容新增在此之前.
-
 
5017
	#$conf["addToTailBeforeThat"]="?\>";
-
 
5018
	#$conf["replaceSpecifyLine"],字串陣列,將指定的行取代成指定的內容,元素的key為原始檔案的行索引,若key為$i+1,則代表第$i行;元素的數值就為該行的新內容.
-
 
5019
	#$conf["fileAccess::updateFile"]["replaceSpecifyLine"]=$replaceSpecifyLine;
-
 
5020
	#$conf["outputPath"],字串,檔案要輸出到哪個位置,預設不指定,直接取代原始檔案的內容.
-
 
5021
	$conf["fileAccess::updateFile"]["outputPath"]=$outputPath;
-
 
5022
	#參考資料:
-
 
5023
	#無.
-
 
5024
	#備註:
-
 
5025
	#無.
-
 
5026
	$updateFile=fileAccess::updateFile($conf["fileAccess::updateFile"]);
-
 
5027
	unset($conf["fileAccess::updateFile"]);
-
 
5028
 
-
 
5029
	#如果出錯
-
 
5030
	if($updateFile["status"]==="false"){
-
 
5031
 
-
 
5032
		#設置錯誤識別
-
 
5033
		$result["status"]="false";
-
 
5034
 
-
 
5035
		#設置錯誤訊息
-
 
5036
		$result["error"]=$updateFile;
-
 
5037
 
-
 
5038
		#回傳結果
-
 
5039
		return $result;
-
 
5040
 
-
 
5041
		}#if end
-
 
5042
 
-
 
5043
	#輸出json結果
-
 
5044
	echo json_encode($updateFile["content"]);
-
 
5045
 
-
 
5046
	}#if end
-
 
5047
 
-
 
5048
PHP;
-
 
5049
 
-
 
5050
						#要多執行序執行的程式
-
 
5051
						#$cmdString
-
 
5052
						
-
 
5053
						#函式說明:
-
 
5054
						#透過 unix socket 來多執行序運作.
-
 
5055
						#回傳結果:
-
 
5056
						#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
-
 
5057
						#$reuslt["error"],執行不正常結束的錯訊息陣列.
-
 
5058
						#$result["function"],當前執行的函式名稱.
-
 
5059
						#$result["argu"],使用的參數.
-
 
5060
						#$result["content"],陣列,每個元素為cmds參數中個別元素其指令傳送後得到的uuid,可透過sock::getProcInfo來查詢結果.
-
 
5061
						#必填參數:
-
 
5062
						#$conf["cmds"],字串陣列,每個元素代表要執行的指令與參數.
-
 
5063
						$conf["threads::socket"]["cmds"][]=array("php","-r",$cmdString);
-
 
5064
						#可省略參數:
-
 
5065
						#$conf["sock"],字串,要連線的 usr/bin/qbpwcf-sock.php 所產生的 unix domain socket 路徑與名稱,預設為 qbpwcf_usock_path.
-
 
5066
						#$conf["sock"]=qbpwcf_usock_path;
-
 
5067
						#參考資料:
-
 
5068
						#無
-
 
5069
						#備註:
-
 
5070
						#需要透過sock::unixDomainSockServer來運行.
-
 
5071
						$socket=threads::socket($conf["threads::socket"]);
-
 
5072
						unset($conf["threads::socket"]);
-
 
5073
 
-
 
5074
						#如果出錯
-
 
5075
						if($socket["status"]==="false"){
-
 
5076
 
-
 
5077
							#設置錯誤識別
-
 
5078
							$result["status"]="false";
-
 
5079
 
-
 
5080
							#設置錯誤訊息
-
 
5081
							$result["error"]=$socket;
-
 
5082
 
-
 
5083
							#印出json
-
 
5084
							echo json_encode($result);
-
 
5085
 
-
 
5086
							#結束執行,回傳1給shell,代表異常,
-
 
5087
							exit(1);
-
 
5088
 
4943
						}#if end
5089
							}#if end
-
 
5090
 
-
 
5091
						#儲存要查看運行狀況的程序
-
 
5092
						$procs[]=$socket["content"][0];
-
 
5093
 
-
 
5094
						}#else end
4944
 
5095
 
4945
					}#if end
5096
					}#if end
4946
 
5097
 
-
 
5098
				}#foreach end
-
 
5099
 
-
 
5100
			}#foreach end
-
 
5101
 
-
 
5102
		#debug
-
 
5103
		#var_dump(__FUNCTION__,__LINE__,print_r($conf,true));exit;
-
 
5104
 
-
 
5105
		#如果有啟用多執行序
-
 
5106
		if($conf["multiThread"]==="true"){
-
 
5107
 
-
 
5108
			#如果有執行的程序要確認回饋
-
 
5109
			if(isset($procs)){
-
 
5110
 
4947
				#無窮迴圈
5111
				#無窮迴圈
4948
				while(true){
5112
				while(true){
4949
 
5113
 
4950
					#如果有開啟 log
5114
					#如果有開啟 log
4951
					if(isset($conf["log"])){
5115
					if(isset($conf["log"])){
Line 5527... Line 5691...
5527
 
5691
 
5528
							#如果是透過socket
5692
							#如果是透過socket
5529
							case "socket":
5693
							case "socket":
5530
 
5694
 
5531
								#取得 proc 的 uuid
5695
								#取得 proc 的 uuid
5532
								$procUuid=$procValue["content"][0]["content"];
5696
								$procUuid=$procValue;
5533
 
5697
 
5534
								#函式說明:
5698
								#函式說明:
5535
								#詢問透過 sock::unixDomainSockServer 執行的程序狀況
5699
								#詢問透過 sock::unixDomainSockServer 執行的程序狀況
5536
								#回傳結果:
5700
								#回傳結果:
5537
								#$result["status"],"true"代表執行正常;"false"代表執行不正常.
5701
								#$result["status"],"true"代表執行正常;"false"代表執行不正常.
Line 5851... Line 6015...
5851
	#回傳結果:
6015
	#回傳結果:
5852
	#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
6016
	#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
5853
	#$reuslt["error"],執行不正常結束的錯訊息陣列.
6017
	#$reuslt["error"],執行不正常結束的錯訊息陣列.
5854
	#$result["function"],當前執行的函式名稱.
6018
	#$result["function"],當前執行的函式名稱.
5855
	#$result["argu"],本函式使用的參數.
6019
	#$result["argu"],本函式使用的參數.
5856
	#$result["content"],更新後的檔案內容陣列.每個元素代表一行的內容.
6020
	#$result["content"],更新後的檔案內容陣列,每個元素代表一行的內容.
5857
	#$result["found"],字串,是否有找到符合條件需要置換的內容.
6021
	#$result["found"],字串,是否有找到符合條件需要置換的內容.
5858
	#$result["relaceInfo"],陣列,記錄需要置換的行資訊,元素的key為需要置換的行號,第 $i 行用 $i+1 表示.
6022
	#$result["relaceInfo"],陣列,記錄需要置換的行資訊,元素的key為需要置換的行號,第 $i 行用 $i+1 表示.
5859
	#$result["relaceInfo"][$i]["deletedOriHead"],字串,第 $i+1 行原始的內容,前面的空白或tab.
6023
	#$result["relaceInfo"][$i]["deletedOriHead"],字串,第 $i+1 行原始的內容,前面的空白或tab.
5860
	#$result["relaceInfo"][$i]["ori"],字串,第 $i+1 行剔除前面的空白或tab後的原始內容.
6024
	#$result["relaceInfo"][$i]["ori"],字串,第 $i+1 行剔除前面的空白或tab後的原始內容.
5861
	#$result["relaceInfo"][$i]["new"],字串,第 $i+1 行剔除前面的空白或tab後的要置換成的內容.
6025
	#$result["relaceInfo"][$i]["new"],字串,第 $i+1 行剔除前面的空白或tab後的要置換成的內容.
5862
	#$result["content"],陣列,替換完後的每行內容.
-
 
5863
	#必填參數:
6026
	#必填參數:
5864
	#$conf["fileArgu"],字串,php變數__FILE__的內容,亦即該檔案在檔案系統的絕對路徑
6027
	#$conf["fileArgu"],字串,php變數__FILE__的內容,亦即該檔案在檔案系統的絕對路徑
5865
	$conf["fileArgu"]=__FILE__;
6028
	$conf["fileArgu"]=__FILE__;
5866
	#$conf["file"],字串,要置換內容的檔案路徑與名稱.
6029
	#$conf["file"],字串,要置換內容的檔案路徑與名稱.
5867
	$conf["file"]="";
6030
	$conf["file"]="";