Subversion Repositories php-qbpwcf

Rev

Rev 218 | Rev 221 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 218 Rev 220
Line 3608... Line 3608...
3608
		
3608
		
3609
		}#function classDiagramsMaker end
3609
		}#function classDiagramsMaker end
3610
		
3610
		
3611
	/*
3611
	/*
3612
	#函式說明:
3612
	#函式說明:
3613
	#更新程式檔案開頭版權宣告的年份,以及作者清單.
3613
	#更新程式檔案開頭版權宣告的年份,以及作者清單,取得更新過後的檔案路徑.
3614
	#回傳結果:
3614
	#回傳結果:
3615
	#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
3615
	#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
3616
	#$reuslt["error"],執行不正常結束的錯訊息陣列.
3616
	#$reuslt["error"],執行不正常結束的錯訊息陣列.
3617
	#$result["function"],當前執行的函式名稱.
3617
	#$result["function"],當前執行的函式名稱.
3618
	#$result["argu"],本函式使用的參數.
3618
	#$result["argu"],本函式使用的參數.
Line 3648... Line 3648...
3648
	#$conf["threadType"]="socket";
3648
	#$conf["threadType"]="socket";
3649
	#$conf["socket"],字串,unix domain socket 的位置與名稱,預設為 qbpwcf_usock_path;
3649
	#$conf["socket"],字串,unix domain socket 的位置與名稱,預設為 qbpwcf_usock_path;
3650
	#$conf["socket"]=qbpwcf_usock_path;
3650
	#$conf["socket"]=qbpwcf_usock_path;
3651
	#$conf["log"],字串,log的檔案位置與名稱,預設不使用.
3651
	#$conf["log"],字串,log的檔案位置與名稱,預設不使用.
3652
	#$conf["log"]="";
3652
	#$conf["log"]="";
-
 
3653
	#$conf["outputPath"],字串,更新後的檔案內容要存放到哪個路徑低下,預設為 /tmp 底下.
-
 
3654
	#$conf["outputPath"]="";
3653
	#參考資料:
3655
	#參考資料:
3654
	#無.
3656
	#無.
3655
	#備註:
3657
	#備註:
3656
	#建構中...
3658
	#建構中...
3657
	*/
3659
	*/
Line 3703... Line 3705...
3703
			#回傳結果
3705
			#回傳結果
3704
			return $result;
3706
			return $result;
3705
 
3707
 
3706
			}#if end
3708
			}#if end
3707
		
3709
		
-
 
3710
		#設置要取代的內容關鍵字陣列 - start
-
 
3711
		
-
 
3712
		$replaceFromArray=array();
-
 
3713
		
-
 
3714
		$replaceFromArray[]="        QBPWCF, Quick Build PHP website Component base on Fedora Linux.";
-
 
3715
		
-
 
3716
		$replaceFromArray[]="    Copyright (C) \${yearFrom}~\${yearTo} \${Authors}";
-
 
3717
		
-
 
3718
		$replaceFromArray[]="";
-
 
3719
		
-
 
3720
		$replaceFromArray[]="    This file is part of QBPWCF.";
-
 
3721
		
-
 
3722
		$replaceFromArray[]="";
-
 
3723
		
-
 
3724
		$replaceFromArray[]="    QBPWCF is free software: you can redistribute it and/or modify";
-
 
3725
		
-
 
3726
		$replaceFromArray[]="    it under the terms of the GNU General Public License as published by";
-
 
3727
		
-
 
3728
		$replaceFromArray[]="    the Free Software Foundation, either version 3 of the License, or";
-
 
3729
		
-
 
3730
		$replaceFromArray[]="    (at your option) any later version.";
-
 
3731
 
-
 
3732
		$replaceFromArray[]="";
-
 
3733
		
-
 
3734
		$replaceFromArray[]="    QBPWCF is distributed in the hope that it will be useful,";
-
 
3735
		
-
 
3736
		$replaceFromArray[]="    but WITHOUT ANY WARRANTY; without even the implied warranty of";
-
 
3737
		
-
 
3738
		$replaceFromArray[]="    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the";
-
 
3739
 
-
 
3740
		$replaceFromArray[]="    GNU General Public License for more details.";
-
 
3741
		
-
 
3742
		$replaceFromArray[]="";
-
 
3743
		
-
 
3744
		$replaceFromArray[]="    You should have received a copy of the GNU General Public License";
-
 
3745
		
-
 
3746
		$replaceFromArray[]="    along with QBPWCF.  If not, see <http://www.gnu.org/licenses/>.";
-
 
3747
		
-
 
3748
		#設置要取代的內容關鍵字陣列 - end
-
 
3749
		
3708
		#函式說明:
3750
		#函式說明:
3709
		#取得檔案路徑字串的路徑與檔案的名稱與檔案副檔名
3751
		#取得檔案路徑字串的路徑與檔案的名稱與檔案副檔名
3710
		#回傳的結果:
3752
		#回傳的結果:
3711
		#$result["status"],執行是否正常,"true"正常,"false"代表不正常.
3753
		#$result["status"],執行是否正常,"true"正常,"false"代表不正常.
3712
		#$result["error"],錯誤訊息.
3754
		#$result["error"],錯誤訊息.
Line 3726... Line 3768...
3726
		#備註:
3768
		#備註:
3727
		#無.
3769
		#無.
3728
		$getFileAddressAndNameAndFileExtention=fileAccess::getFileAddressAndNameAndFileExtention($conf["fileAccess::getFileAddressAndNameAndFileExtention"]);
3770
		$getFileAddressAndNameAndFileExtention=fileAccess::getFileAddressAndNameAndFileExtention($conf["fileAccess::getFileAddressAndNameAndFileExtention"]);
3729
		unset($conf["fileAccess::getFileAddressAndNameAndFileExtention"]);
3771
		unset($conf["fileAccess::getFileAddressAndNameAndFileExtention"]);
3730
		
3772
		
3731
		#debug,break point.
-
 
3732
		#var_dump(__LINE__,$getFileAddressAndNameAndFileExtention);exit;
-
 
3733
		
-
 
3734
		#如果執行失敗
3773
		#如果執行失敗
3735
		if($getFileAddressAndNameAndFileExtention["status"]==="false"){
3774
		if($getFileAddressAndNameAndFileExtention["status"]==="false"){
3736
			
3775
			
3737
			#設置錯誤識別
3776
			#設置錯誤識別
3738
			$result["status"]="false";
3777
			$result["status"]="false";
Line 3743... Line 3782...
3743
			#回傳結果
3782
			#回傳結果
3744
			return $result;
3783
			return $result;
3745
			
3784
			
3746
			}#if end
3785
			}#if end
3747
		
3786
		
3748
		#初始化有異動的檔案清單
-
 
3749
		$result["content"]=array();
-
 
3750
		
-
 
3751
		#取得當前使用套件的路徑
3787
		#取得當前使用套件的路徑
3752
		$libPath=$getFileAddressAndNameAndFileExtention["filePath"]."../../../";
3788
		$libPath=$getFileAddressAndNameAndFileExtention["filePath"]."../../../";
3753
		
3789
		
3754
		#debug,break point.
3790
		#debug,break point.
3755
		#var_dump(__LINE__,$libPath);exit(1);
3791
		#var_dump(__LINE__,$libPath);exit(1);
Line 3788... Line 3824...
3788
			return $result;
3824
			return $result;
3789
			
3825
			
3790
			}#if end
3826
			}#if end
3791
		
3827
		
3792
		#取得直觀的絕對路徑
3828
		#取得直觀的絕對路徑
3793
		$libPath=$changeDirByDotDotSolidus["changedPath"];
3829
		$libRootPath=$changeDirByDotDotSolidus["changedPath"];
3794
		
-
 
3795
		#debug
-
 
3796
		#var_dump(__LINE__,$libPath);exit(1);
-
 
3797
		
-
 
3798
		#設置要取代的內容關鍵字陣列 - start
-
 
3799
		
-
 
3800
		$replaceFromArray=array();
-
 
3801
		
-
 
3802
		$replaceFromArray[]="        QBPWCF, Quick Build PHP website Component base on Fedora Linux.";
-
 
3803
		
-
 
3804
		$replaceFromArray[]="    Copyright (C) \${yearFrom}~\${yearTo} \${Authors}";
-
 
3805
		
-
 
3806
		$replaceFromArray[]="";
-
 
3807
		
-
 
3808
		$replaceFromArray[]="    This file is part of QBPWCF.";
-
 
3809
		
-
 
3810
		$replaceFromArray[]="";
-
 
3811
		
-
 
3812
		$replaceFromArray[]="    QBPWCF is free software: you can redistribute it and/or modify";
-
 
3813
		
-
 
3814
		$replaceFromArray[]="    it under the terms of the GNU General Public License as published by";
-
 
3815
		
-
 
3816
		$replaceFromArray[]="    the Free Software Foundation, either version 3 of the License, or";
-
 
3817
		
3830
		
-
 
3831
		#取得 lib folder
3818
		$replaceFromArray[]="    (at your option) any later version.";
3832
		exec("php -f ".escapeshellarg(pathinfo(__FILE__)["dirname"]."/../../bin/libexec/folderOfUsrLib.php"),$output,$status);
3819
 
3833
 
3820
		$replaceFromArray[]="";
3834
		#如果執行失敗
3821
		
3835
		if($status!==0){
3822
		$replaceFromArray[]="    QBPWCF is distributed in the hope that it will be useful,";
-
 
3823
		
-
 
3824
		$replaceFromArray[]="    but WITHOUT ANY WARRANTY; without even the implied warranty of";
-
 
3825
		
-
 
3826
		$replaceFromArray[]="    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the";
-
 
3827
 
3836
 
-
 
3837
			#debug
-
 
3838
			var_dump(__LINE__,$output);
-
 
3839
 
-
 
3840
			#結束執行,回傳shell 1.
-
 
3841
			exit(1);
-
 
3842
 
-
 
3843
			}#if end
-
 
3844
 
-
 
3845
		#儲存 lib folder
3828
		$replaceFromArray[]="    GNU General Public License for more details.";
3846
		$folderOfUsrLib=$output[0];
3829
		
3847
		
3830
		$replaceFromArray[]="";
3848
		#儲存 lib path
-
 
3849
		$libPath=$libRootPath."/usr/".$folderOfUsrLib;
3831
		
3850
		
-
 
3851
		#debug
3832
		$replaceFromArray[]="    You should have received a copy of the GNU General Public License";
3852
		#var_dump(__LINE__,$libPath);exit(1);
3833
		
3853
		
-
 
3854
		#函式說明:
-
 
3855
		#使用 linux 的 uuid 指令來產生 uuid 字串
-
 
3856
		#回傳結果:
3834
		$replaceFromArray[]="    along with QBPWCF.  If not, see <http://www.gnu.org/licenses/>.";
3857
		#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
-
 
3858
		#$result["error"],錯誤訊息.
-
 
3859
		#$result["function"],當前執行的函式名稱.
-
 
3860
		#$result["content"],uuid.
-
 
3861
		#必填參數:
-
 
3862
		#無.
-
 
3863
		#可省略參數:
-
 
3864
		#無.
-
 
3865
		#參考資料:
-
 
3866
		#無.
-
 
3867
		#備註:
-
 
3868
		#無.
-
 
3869
		$uuid=cmd::uuid();
-
 
3870
 
-
 
3871
		#如果執行失敗
-
 
3872
		if($uuid["status"]==="false"){
-
 
3873
 
-
 
3874
			#debug
-
 
3875
			var_dump($uuid);
-
 
3876
			
-
 
3877
			#結束執行回傳代碼1給shell
-
 
3878
			exit(1);
-
 
3879
 
-
 
3880
			}#if end
3835
		
3881
		
3836
		#設置要取代的內容關鍵字陣列 - end
3882
		#預設的輸出目錄
-
 
3883
		$outputPath="/tmp/".$uuid["content"]."-phpLib::updateCopyRightYear/";
3837
		
3884
		
-
 
3885
		#檢查參數
3838
		#函式說明:
3886
		#函式說明:
3839
		#檢查必填與可省略的參數,可省略參數可指定預設要給與什麼數值內容.
3887
		#檢查必填與可省略的參數,可省略參數可指定預設要給與什麼數值內容.
3840
		#回傳結果:
3888
		#回傳結果:
3841
		#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
3889
		#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
3842
		#$result["error"],執行不正常結束的錯訊息陣列.
3890
		#$result["error"],執行不正常結束的錯訊息陣列.
Line 3860... Line 3908...
3860
		#$conf["mustBeFilledVariableName"],爲必填參數的變數名稱陣列,形態爲陣列變數,元素數量需要跟"mustBeFilledVariableType"參數的元素數量一致,例如: $conf["mustBeFilledVariableName"] = array("id","account","password");
3908
		#$conf["mustBeFilledVariableName"],爲必填參數的變數名稱陣列,形態爲陣列變數,元素數量需要跟"mustBeFilledVariableType"參數的元素數量一致,例如: $conf["mustBeFilledVariableName"] = array("id","account","password");
3861
		$conf["variableCheck::checkArguments"]["mustBeFilledVariableName"]=array("fileArgu");
3909
		$conf["variableCheck::checkArguments"]["mustBeFilledVariableName"]=array("fileArgu");
3862
		#$conf["mustBeFilledVariableType"],爲必填參數的變數陣列應該爲何種變數形態,形態爲陣列,元素數量需要跟"mustBeFilledVariableName"參數的元素數量一致,例如: $conf["mustBeFilledVariableType"] = array("string",integer,"double","resource","object"); , null、any代表不指定變數形態.其中 resource也包含"resource (closed)".
3910
		#$conf["mustBeFilledVariableType"],爲必填參數的變數陣列應該爲何種變數形態,形態爲陣列,元素數量需要跟"mustBeFilledVariableName"參數的元素數量一致,例如: $conf["mustBeFilledVariableType"] = array("string",integer,"double","resource","object"); , null、any代表不指定變數形態.其中 resource也包含"resource (closed)".
3863
		$conf["variableCheck::checkArguments"]["mustBeFilledVariableType"]=array("string");
3911
		$conf["variableCheck::checkArguments"]["mustBeFilledVariableType"]=array("string");
3864
		#$conf["canBeEmptyString"],字串,必填變數內容如果是空字串就不能算是有設置的話,請設為"false",預設爲"true",可以為空字串.
3912
		#$conf["canBeEmptyString"],字串,必填變數內容如果是空字串就不能算是有設置的話,請設為"false",預設爲"true",可以為空字串.
3865
		#$conf["canBeEmptyString"]="false";
3913
		$conf["variableCheck::checkArguments"]["canBeEmptyString"]="false";
3866
		#$conf["canNotBeEmpty"],字串陣列,哪些必填參數的內容不得為空字串或空陣列,僅當$conf["canBeEmptyString"]為"true"時會生效.
3914
		#$conf["canNotBeEmpty"],字串陣列,哪些必填參數的內容不得為空字串或空陣列,僅當$conf["canBeEmptyString"]為"true"時會生效.
3867
		#$conf["canNotBeEmpty"]=array();
3915
		#$conf["canNotBeEmpty"]=array();
3868
		#$conf["canBeEmpty"],字串陣列,哪些必填參數的內容可為空字串或空陣列,僅當$conf["canBeEmptyString"]為"false"時會生效.
3916
		#$conf["canBeEmpty"],字串陣列,哪些必填參數的內容可為空字串或空陣列,僅當$conf["canBeEmptyString"]為"false"時會生效.
3869
		#$conf["canBeEmpty"]=array();
3917
		#$conf["canBeEmpty"]=array();
3870
		#$conf["skipableVariableCanNotBeEmpty"],字串陣列,哪些可省略參數不可以為空字串或空陣列.
3918
		#$conf["skipableVariableCanNotBeEmpty"],字串陣列,哪些可省略參數不可以為空字串或空陣列.
3871
		#$conf["variableCheck::checkArguments"]["skipableVariableCanNotBeEmpty"]=array();
3919
		#$conf["skipableVariableCanNotBeEmpty"]=array();
3872
		#$conf["skipableVariableName"],陣列字串,爲可省略參數的變數名稱陣列,形態爲陣列變數,例如: $conf["skipableVariableName"] = array("id","account","password");
3920
		#$conf["skipableVariableName"],陣列字串,爲可省略參數的變數名稱陣列,形態爲陣列變數,例如: $conf["skipableVariableName"] = array("id","account","password");
3873
		$conf["variableCheck::checkArguments"]["skipableVariableName"]=array("replaceFrom","yearFrom","yearTo","Authors","searchPath","skipHiddenFolder","includeHiddenFolder","excludeDirName","excludeMineType","excludeSecondName","multiThread","log","threadType","socket");
3921
		$conf["variableCheck::checkArguments"]["skipableVariableName"]=array("replaceFrom","yearFrom","yearTo","Authors","searchPath","skipHiddenFolder","includeHiddenFolder","excludeDirName","excludeMineType","excludeSecondName","multiThread","threadType","socket","log","outputPath");
3874
		#$conf["skipableVariableType"],陣列字串,爲可省略參數的變數名稱陣列,形態爲陣列變數,例如: $conf["skipableVariableType"] = array("string",integer,"double");
3922
		#$conf["skipableVariableType"],陣列字串,爲可省略參數的變數名稱陣列,形態爲陣列變數,例如: $conf["skipableVariableType"] = array("string",integer,"double");
3875
		$conf["variableCheck::checkArguments"]["skipableVariableType"]=array("array","string","string","array","array","string","array","array","array","array","string","string","string","string");
3923
		$conf["variableCheck::checkArguments"]["skipableVariableType"]=array("array","string","string","array","array","string","array","array","array","array","string","string","string","string","string");
3876
		#$conf["skipableVarDefaultValue"],字串陣列,每個不存在的可省略變數要初始化為什麼,null與代表不指定,若預設值是參數之一,請將$conf["mustBeFilledVar"]改成"\$conf["\mustBeFilledVar\"]".
3924
		#$conf["skipableVarDefaultValue"],字串陣列,每個不存在的可省略變數要初始化為什麼,null與代表不指定,若預設值是參數之一,請將$conf["mustBeFilledVar"]改成"\$conf["\mustBeFilledVar\"]".
3877
		$conf["variableCheck::checkArguments"]["skipableVarDefaultValue"]=array($replaceFromArray,"2014",gmdate("Y"),array("MIN-ZHI, CHEN"),array($libPath),"true",null,array("free-lib","non-free-lib","composer"),array("image/*","video/*","audio/*","media/*","application/*"),array("log","csv","sql","js","css","html"),"false",null,"socket",qbpwcf_usock_path);
3925
		$conf["variableCheck::checkArguments"]["skipableVarDefaultValue"]=array($replaceFromArray,"2014",gmdate("Y"),array("MIN ZHI, CHEN"),array($libPath),"true",null,array("free-lib","no-free-lib","composer"),array("image/*","video/*","audio/*","media/*","application/*"),array("log","csv","sql","js","css","html"),"false","socket",qbpwcf_usock_path,null,$outputPath);
3878
		#$conf["disallowAllSkipableVarIsEmpty"],字串,是否允許每個可省略參數都為空字串,預設為"true"允許,反之為"false".
3926
		#$conf["disallowAllSkipableVarIsEmpty"],字串,是否允許每個可省略參數都為空字串,預設為"true"允許,反之為"false".
3879
		#$conf["variableCheck::checkArguments"]["disallowAllSkipableVarIsEmpty"]="true";
3927
		#$conf["disallowAllSkipableVarIsEmpty"]="";
3880
		#$conf["disallowAllSkipableVarIsEmptyArray"],字串,是否允許每個可省略參數都為空陣列,預設為"true"允許,反之為"false".
3928
		#$conf["disallowAllSkipableVarIsEmptyArray"],字串,是否允許每個可省略參數都為空陣列,預設為"true"允許,反之為"false".
3881
		#$conf["variableCheck::checkArguments"]["disallowAllSkipableVarIsEmptyArray"]="true";
3929
		#$conf["disallowAllSkipableVarIsEmptyArray"]="";
3882
		#$conf["disallowAllSkipableVarNotExist"],字串,是否不允許每個可省略參數都不存在,預設為"false"代表允許,反之為"true".
3930
		#$conf["disallowAllSkipableVarNotExist"],字串,是否不允許每個可省略參數都不存在,預設為"false"代表允許,反之為"true".
3883
		#$conf["disallowAllSkipableVarNotExist"]="";
3931
		#$conf["disallowAllSkipableVarNotExist"]="";
3884
		#$conf["arrayCountEqualCheck"],字串陣列,為檢查哪些陣列參數的元素數量要一樣,$conf["arrayCountEqualCheck"][$i]=array()為第$i組key為哪些的變數其元素數量要相等.
3932
		#$conf["arrayCountEqualCheck"],字串陣列,為檢查哪些陣列參數的元素數量要一樣,$conf["arrayCountEqualCheck"][$i]=array()為第$i組key為哪些的變數其元素數量要相等.
3885
		#$conf["arrayCountEqualCheck"][]=array();
3933
		#$conf["arrayCountEqualCheck"][]=array();
3886
		#參考資料:
3934
		#參考資料:
Line 3888... Line 3936...
3888
		#備註:
3936
		#備註:
3889
		#無.
3937
		#無.
3890
		$checkArguments=variableCheck::checkArguments($conf["variableCheck::checkArguments"]);
3938
		$checkArguments=variableCheck::checkArguments($conf["variableCheck::checkArguments"]);
3891
		unset($conf["variableCheck::checkArguments"]);
3939
		unset($conf["variableCheck::checkArguments"]);
3892
		
3940
		
3893
		#如果執行失敗
3941
		#如果執行異常
3894
		if($checkArguments["status"]==="false"){
3942
		if($checkArguments["status"]==="false"){
3895
			
3943
		
3896
			#設置錯誤識別
3944
			#設置錯誤識別
3897
			$result["status"]="false";
3945
			$result["status"]="false";
3898
			
3946
			
3899
			#設置錯誤訊息
3947
			#設置錯誤訊息
3900
			$result["error"]=$checkArguments;
3948
			$result["error"]=$checkArguments;
3901
			
3949
			
3902
			#回傳結果
3950
			#回傳結果
3903
			return $result;
3951
			return $result;
3904
			
3952
		
3905
			}#if end
3953
			}#if end
3906
			
3954
			
3907
		#如果檢查不通過
3955
		#如果參數檢查不通過
3908
		if($checkArguments["passed"]==="false"){
3956
		if($checkArguments["passed"]==="false"){
3909
			
3957
		
3910
			#設置錯誤識別
3958
			#設置錯誤識別
3911
			$result["status"]="false";
3959
			$result["status"]="false";
3912
			
3960
			
3913
			#設置錯誤訊息
3961
			#設置錯誤訊息
3914
			$result["error"]=$checkArguments;
3962
			$result["error"]=$checkArguments;
3915
			
3963
			
3916
			#回傳結果
3964
			#回傳結果
3917
			return $result;
3965
			return $result;
-
 
3966
		
-
 
3967
			}#if end
-
 
3968
		
-
 
3969
		#函式說明:
-
 
3970
		#取得檔案路徑字串的路徑與檔案的名稱與檔案副檔名
-
 
3971
		#回傳的結果:
-
 
3972
		#$result["status"],執行是否正常,"true"正常,"false"代表不正常.
-
 
3973
		#$result["error"],錯誤訊息.
-
 
3974
		#$result["function"],當前執行的函式名稱.
-
 
3975
		#$result["filePath"],路徑字串.
-
 
3976
		#$result["fileName"],檔案名稱字串.
-
 
3977
		#$result["fileExtention"],檔案的副檔名.
-
 
3978
		#$result["fullFileName"],含副檔名的檔案名稱.
-
 
3979
		#$result["fullFilePathAndName"],完整的檔案路徑(含副檔名).
-
 
3980
		#必填參數:
-
 
3981
		#$conf["fileAddressAndName"],字串,檔案名稱與其路徑.
-
 
3982
		$conf["fileAccess::getFileAddressAndNameAndFileExtention"]["fileAddressAndName"]=__FILE__;
-
 
3983
		#可省略參數:
-
 
3984
		#無.
-
 
3985
		#參考資料:
-
 
3986
		#無.
-
 
3987
		#備註:
-
 
3988
		#無.
-
 
3989
		$getFileAddressAndNameAndFileExtention=fileAccess::getFileAddressAndNameAndFileExtention($conf["fileAccess::getFileAddressAndNameAndFileExtention"]);
-
 
3990
		unset($conf["fileAccess::getFileAddressAndNameAndFileExtention"]);
-
 
3991
		
-
 
3992
		#debug,break point.
-
 
3993
		#var_dump(__LINE__,$getFileAddressAndNameAndFileExtention);exit;
-
 
3994
		
-
 
3995
		#如果執行失敗
-
 
3996
		if($getFileAddressAndNameAndFileExtention["status"]==="false"){
-
 
3997
			
-
 
3998
			#設置錯誤識別
-
 
3999
			$result["status"]="false";
-
 
4000
			
-
 
4001
			#設置錯誤訊息
-
 
4002
			$result["error"]=$getFileAddressAndNameAndFileExtention;
-
 
4003
			
-
 
4004
			#回傳結果
-
 
4005
			return $result;
3918
			
4006
			
3919
			}#if end
4007
			}#if end
3920
		
4008
		
-
 
4009
		#初始化有異動的檔案清單
-
 
4010
		$result["content"]=array();
-
 
4011
		
3921
		#函式說明:
4012
		#函式說明:
3922
		#使用 linux 的 uuid 指令來產生 uuid 字串
4013
		#使用 linux 的 uuid 指令來產生 uuid 字串
3923
		#回傳結果:
4014
		#回傳結果:
3924
		#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
4015
		#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
3925
		#$result["error"],錯誤訊息.
4016
		#$result["error"],錯誤訊息.
Line 3951... Line 4042...
3951
		
4042
		
3952
		#針對 $conf["searchPath"] 的每個路徑
4043
		#針對 $conf["searchPath"] 的每個路徑
3953
		foreach($conf["searchPath"] as $path){
4044
		foreach($conf["searchPath"] as $path){
3954
		
4045
		
3955
			#debug
4046
			#debug
3956
			var_dump(__LINE__,"searching path:".$path);
4047
			#var_dump(__LINE__,"searching path:".$path);
3957
		
4048
		
3958
			#取得 $path 底下的所有檔案.
4049
			#取得 $path 底下的所有檔案.
3959
			#函式說明:
4050
			#函式說明:
3960
			#取得目錄底下的詳細資訊.
4051
			#取得目錄底下的詳細資訊.
3961
			#回傳結果:
4052
			#回傳結果:
Line 4103... Line 4194...
4103
							
4194
							
4104
						#記錄有掃描的資料夾路徑與名稱 
4195
						#記錄有掃描的資料夾路徑與名稱 
4105
						$result["scannedFile"][]=$NodePathAndName;
4196
						$result["scannedFile"][]=$NodePathAndName;
4106
						
4197
						
4107
						#debug
4198
						#debug
4108
						var_dump(__LINE__,"seartched node:".$NodePathAndName);
4199
						#var_dump(__LINE__,"seartched node:".$NodePathAndName);
4109
						
4200
						
4110
						#合併 content - start
4201
						#合併 content - start
4111
						
4202
						
4112
						#函式說明:
4203
						#函式說明:
4113
						#將多個一維陣列串聯起來,key從0開始排序.
4204
						#將多個一維陣列串聯起來,key從0開始排序.
Line 4218... Line 4309...
4218
						#要執行的php程式內容
4309
						#要執行的php程式內容
4219
						$cmdString=<<<'PHP'
4310
						$cmdString=<<<'PHP'
4220
/*
4311
/*
4221
 
4312
 
4222
        QBPWCF, Quick Build PHP website Component base on Fedora Linux.
4313
        QBPWCF, Quick Build PHP website Component base on Fedora Linux.
4223
    Copyright (C) 2014~2025 Min-Jhin,Chen
4314
    Copyright (C) 2014~2025 MIN-ZHI, CHEN
4224
 
4315
 
4225
    This file is part of QBPWCF.
4316
    This file is part of QBPWCF.
4226
 
4317
 
4227
    QBPWCF is free software: you can redistribute it and/or modify
4318
    QBPWCF is free software: you can redistribute it and/or modify
4228
    it under the terms of the GNU General Public License as published by
4319
    it under the terms of the GNU General Public License as published by
Line 4281... Line 4372...
4281
#$conf["replaceFrom"]=array();
4372
#$conf["replaceFrom"]=array();
4282
#$conf["yearFrom],字串,起始年份,預設為西元"2014"年.
4373
#$conf["yearFrom],字串,起始年份,預設為西元"2014"年.
4283
#$conf["yearFrom"]="2014";
4374
#$conf["yearFrom"]="2014";
4284
#$conf["yearTo],字串,結束年份,預設為西元"gmdate('Y')"年.
4375
#$conf["yearTo],字串,結束年份,預設為西元"gmdate('Y')"年.
4285
#$conf["yearTo"]=gmdate('Y');
4376
#$conf["yearTo"]=gmdate('Y');
4286
#$conf["Authors"],陣列,該套件的參與者,預設為array("Min-Jhin,Chen");
4377
#$conf["Authors"],陣列,該套件的參與者,預設為array("MIN-ZHI, CHEN");
4287
#$conf["Authors"]=array("Min-Jhin,Chen");
4378
#$conf["Authors"]=array("MIN-ZHI, CHEN");
4288
#$conf["searchPath"],陣列,要搜尋哪些地方的檔案要更新版權宣告年份,預設為使用中的本套件位置.
4379
#$conf["searchPath"],陣列,要搜尋哪些地方的檔案要更新版權宣告年份,預設為使用中的本套件位置.
4289
#$conf["searchPath"]=array("");
4380
#$conf["searchPath"]=array("");
4290
#$conf["skipHiddenFolder"],字串,要略過隱藏的資料夾,預設為"true";反之為"false";
4381
#$conf["skipHiddenFolder"],字串,要略過隱藏的資料夾,預設為"true";反之為"false";
4291
#$conf["skipHiddenFolder"]="true";
4382
#$conf["skipHiddenFolder"]="true";
4292
#$conf["includeHiddenFolder"],陣列,符合名稱的隱藏資料夾會存取,預設不指定;
4383
#$conf["includeHiddenFolder"],陣列,符合名稱的隱藏資料夾會存取,預設不指定;
Line 4312... Line 4403...
4312
					
4403
					
4313
						#設置多執行序的類型
4404
						#設置多執行序的類型
4314
						$threadType=$conf["threadType"];
4405
						$threadType=$conf["threadType"];
4315
						
4406
						
4316
						#debug,break point
4407
						#debug,break point
4317
						var_dump(__LINE__,$threadType);exit(1);
4408
						#var_dump(__LINE__,$threadType);exit(1);
4318
						
4409
						
4319
						#判斷多執行序的類型
4410
						#判斷多執行序的類型
4320
						switch($threadType){
4411
						switch($threadType){
4321
						
4412
						
4322
							#若是直接用 proc
4413
							#若是直接用 proc
Line 4585... Line 4676...
4585
					
4676
					
4586
					#記錄有掃描的檔案路徑與名稱 
4677
					#記錄有掃描的檔案路徑與名稱 
4587
					$result["scannedFile"][]=$NodePathAndName;
4678
					$result["scannedFile"][]=$NodePathAndName;
4588
					
4679
					
4589
					#debug
4680
					#debug
4590
					var_dump(__LINE__,"found file:".$NodePathAndName." mimeType:".$node["mimeType"]);
4681
					#var_dump(__LINE__,"found file:".$NodePathAndName." mimeType:".$node["mimeType"]);
4591
				
4682
				
4592
					#如果沒有用多執行序
4683
					#如果沒有用多執行序
4593
					if($conf["multiThread"]==="false"){
4684
					if($conf["multiThread"]==="false"){
4594
					
4685
					
-
 
4686
						#設置起始年份
-
 
4687
						$replaceTo[1]["yearFrom"]=$conf["yearFrom"];
-
 
4688
						
-
 
4689
						#設置到的年份
-
 
4690
						$replaceTo[1]["yearTo"]=$conf["yearTo"];
-
 
4691
						
-
 
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
						#必填參數:
-
 
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";
-
 
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
						
-
 
4718
						#如果執行異常
-
 
4719
						if($arrayToString["status"]==="false"){
-
 
4720
						
-
 
4721
							#設置執行異常的識別
-
 
4722
							$result["status"]="false";
-
 
4723
						
-
 
4724
							#設置執行錯誤訊息
-
 
4725
							$result["error"]=$arrayToString;
-
 
4726
							
-
 
4727
							#回傳結果
-
 
4728
							return $result;
-
 
4729
						
-
 
4730
							}#if end
-
 
4731
						
-
 
4732
						#設置作者清單字串
-
 
4733
						$replaceTo[1]["Authors"]=$arrayToString["content"];
-
 
4734
					
-
 
4735
						#函式說明:
-
 
4736
						#置換檔案內容中符合的內容.
-
 
4737
						#回傳結果:
-
 
4738
						#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
-
 
4739
						#$reuslt["error"],執行不正常結束的錯訊息陣列.
-
 
4740
						#$result["function"],當前執行的函式名稱.
-
 
4741
						#$result["argu"],本函式使用的參數.
-
 
4742
						#$result["content"],更新後的檔案內容陣列.每個元素代表一行的內容.
-
 
4743
						#$result["found"],字串,是否有找到符合條件需要置換的內容.
-
 
4744
						#$result["relaceInfo"],陣列,記錄需要置換的行資訊,元素的key為需要置換的行號,第 $i 行用 $i+1 表示.
-
 
4745
						#$result["relaceInfo"][$i]["ori"],字串,第 $i+1 行原始的內容.
-
 
4746
						#$result["relaceInfo"][$i]["new"],字串,第 $i+1 行要置換成的內容.
-
 
4747
						#$result["content"],陣列,替換完後的每行內容.
-
 
4748
						#必填參數:
-
 
4749
						#$conf["fileArgu"],字串,php變數__FILE__的內容,亦即該檔案在檔案系統的絕對路徑
-
 
4750
						$conf["phpLib::replaceMatchContent"]["fileArgu"]=__FILE__;
-
 
4751
						#$conf["file"],字串,要置換內容的檔案路徑與名稱.
-
 
4752
						$conf["phpLib::replaceMatchContent"]["file"]=$NodePathAndName;
-
 
4753
						#$conf["formats"],陣列,連續的關鍵字字串.
-
 
4754
						$conf["phpLib::replaceMatchContent"]["formats"]=$conf["replaceFrom"];
-
 
4755
						#$conf["replaceTo"],陣列,原始內容要如何置換,每個元素的索引對應到formats參數的每個元素,若其索引不存在則代表對應的行不異動.
-
 
4756
						$conf["phpLib::replaceMatchContent"]["replaceTo"]=$replaceTo;
-
 
4757
						#可省略參數:
-
 
4758
						#無.
-
 
4759
						#參考資料:
-
 
4760
						#無.
-
 
4761
						#備註:
-
 
4762
						#參數設定 $conf["replaceTo"][$i]=$replaceStr; 代表符合格式的連續字串中的 $i+1 行內容要置換成 $replaceStr.
-
 
4763
						#參數設定 $conf["replaceTo"][$i]=array("varName1"=>$replaceStr1,"varName2"=>$replaceStr2); 代表符合格式的連續字串中的 $i+1 行內容中的變數 varName1 要置換成 $replaceStr1;變數 varName2 要置換成 $replaceStr2.
-
 
4764
						$replaceMatchContent=phpLib::replaceMatchContent($conf["phpLib::replaceMatchContent"]);
-
 
4765
						unset($conf["phpLib::replaceMatchContent"]);
-
 
4766
					
-
 
4767
						#如果執行異常
-
 
4768
						if($replaceMatchContent["status"]==="false"){
-
 
4769
						
-
 
4770
							#設置執行異常的識別
-
 
4771
							$result["status"]="false";
-
 
4772
						
-
 
4773
							#設置執行錯誤訊息
-
 
4774
							$result["error"]=$replaceMatchContent;
-
 
4775
							
-
 
4776
							#回傳結果
-
 
4777
							return $result;
-
 
4778
						
-
 
4779
							}#if end
-
 
4780
					
-
 
4781
						/*
-
 
4782
					
4595
						#取得檔案的內容
4783
						#取得檔案的內容
4596
						#函式說明:
4784
						#函式說明:
4597
						#依據行號分隔抓取檔案的內容,結果會回傳一個陣列
4785
						#依據行號分隔抓取檔案的內容,結果會回傳一個陣列
4598
						#回傳的變數說明:
4786
						#回傳的變數說明:
4599
						#$result["status"],執行是否成功,"true"代表成功;"fasle"代表失敗.
4787
						#$result["status"],執行是否成功,"true"代表成功;"fasle"代表失敗.
Line 5719... Line 5907...
5719
									
5907
									
5720
										}#else end
5908
										}#else end
5721
									
5909
									
5722
									#換找下個行內容有無符合關鍵字
5910
									#換找下個行內容有無符合關鍵字
5723
									continue 2;
5911
									continue 2;
5724
										
5912
									
5725
									}#else end
5913
									}#else end
5726
								
5914
								
5727
								}#for end
5915
								}#for end
5728
						
5916
						
5729
							}#for end
5917
							}#for end
-
 
5918
						
-
 
5919
						*/
-
 
5920
						
-
 
5921
						#如果有需要更新檔案內容的識別
-
 
5922
						if($replaceMatchContent["found"]==="true"){
-
 
5923
						
-
 
5924
							#$replaceMatchContent["relaceInfo"][$i]["new"],第 $i+1 行的新內容.
-
 
5925
						
-
 
5926
							#初始化給予 fileAccess::updateFile 的參數
-
 
5927
							$replaceSpecifyLine=array();
-
 
5928
						
-
 
5929
							#針對每個要更新的行
-
 
5930
							foreach($replaceMatchContent["relaceInfo"] as $lineIndex => $info){
5730
							
5931
							
-
 
5932
								#設置給予 fileAccess::updateFile 的參數
-
 
5933
								$replaceSpecifyLine[$lineIndex]=$info["new"];
-
 
5934
							
5731
						}#if end
5935
								}#foreach end
5732
						
5936
						
-
 
5937
							#更新檔案內容
-
 
5938
							#函式說明:
-
 
5939
							#更新檔案的內容.
-
 
5940
							#回傳結果:
-
 
5941
							#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
-
 
5942
							#$result["error"],錯誤訊息.
-
 
5943
							#$result["function"],當前執行的函數名稱.
-
 
5944
							#$result["content"],更新的資訊.
-
 
5945
							#必填參數:
-
 
5946
							#$conf["fileArgu"],字串,變數__FILE__的內容.
-
 
5947
							$conf["fileAccess::updateFile"]["fileArgu"]=__FILE__;
-
 
5948
							#$conf["file"],字串,要更新的檔案位置與名稱.
-
 
5949
							$conf["fileAccess::updateFile"]["file"]=$NodePathAndName;
-
 
5950
							#可省略參數:
-
 
5951
							#$conf["overWriteWith"],字串陣列,要置換成什麼樣的內容,每個元素代表一行內容.
-
 
5952
							$conf["fileAccess::updateFile"]["overWriteWith"]=$replaceMatchContent["content"];
-
 
5953
							#$conf["replaceWith"],字串陣列,要將什麼內容置換成什麼內容.
-
 
5954
							#$conf["replaceWith"]=array(array("ori content","new content"),array("ori content","new content"),...);
-
 
5955
							#$conf["replaceLike"],字串,預設為"false",代表要完全符合關鍵字才能進行整行替換;反之為"true".
-
 
5956
							#$conf["replaceLike"]="false";
-
 
5957
							#$conf["addToTailWhenNoMatch"],字串,預設為"false"不做事;若為"true",則代表若使用 "replaceWith" 參數但沒有符合條件的內容出現,則新增到檔案的尾端.
-
 
5958
							#$conf["addToTailWhenNoMatch"]="false";
5733
					#如果有需要更新檔案內容的識別
5959
							#$conf["addToTailBeforeThat"],字串,當 "replaceWith" 參數有使用,且 "addToTailWhenNoMatch" 為 "true" 時,若有使用該參數,則會從尾端尋找符合條件的行內容,然後將 沒有符合 "replaceWith" 條件的內容新增在此之前.
-
 
5960
							#$conf["addToTailBeforeThat"]="?\>";
-
 
5961
							#$conf["replaceSpecifyLine"],字串陣列,將指定的行取代成指定的內容,元素的key為原始檔案的行索引,若key為$i+1,則代表第$i行;元素的數值就為該行的新內容.
-
 
5962
							#$conf["fileAccess::updateFile"]["replaceSpecifyLine"]=$replaceSpecifyLine;
-
 
5963
							#$conf["outputPath"],字串,檔案要輸出到哪個位置,預設不指定,直接取代原始檔案的內容.
-
 
5964
							$conf["fileAccess::updateFile"]["outputPath"]=$outputPath;
-
 
5965
							#參考資料:
-
 
5966
							#無.
-
 
5967
							#備註:
-
 
5968
							#無.
-
 
5969
							$updateFile=fileAccess::updateFile($conf["fileAccess::updateFile"]);
-
 
5970
							unset($conf["fileAccess::updateFile"]);
-
 
5971
						
-
 
5972
							#如果出錯
5734
					if($shouldReplace==="true"){
5973
							if($updateFile["status"]==="false"){
5735
					
5974
						
5736
						#更新檔案內容
5975
								#設置錯誤識別
-
 
5976
								$result["status"]="false";
-
 
5977
								
-
 
5978
								#設置錯誤訊息
-
 
5979
								$result["error"]=$updateFile;
5737
						#...
5980
								
-
 
5981
								#回傳結果
-
 
5982
								return $result;
-
 
5983
						
-
 
5984
								}#if end
-
 
5985
								
-
 
5986
							#如果沒有既有的記錄
-
 
5987
							if(!isset($result["content"][$NodePathAndName])){
-
 
5988
							
-
 
5989
								#記錄有更新的檔案路徑與名稱與其次數為1
-
 
5990
								$result["content"][$NodePathAndName]["time"]=1;
-
 
5991
							
-
 
5992
								}#if end
-
 
5993
							
-
 
5994
							#反之
-
 
5995
							else{
-
 
5996
							
-
 
5997
								#記錄有更新的檔案路徑與名稱與的次數+1
-
 
5998
								$result["content"][$NodePathAndName]["time"]++;
-
 
5999
							
-
 
6000
								}#else end
-
 
6001
							
-
 
6002
							#記錄更新的相關資訊,用太多記憶體.
-
 
6003
							#$result["content"][$NodePathAndName]["replacedInfo"]=$updateFile["content"];
5738
					
6004
						
5739
						}#if end
6005
							}#if end
5740
					
6006
					
5741
						}#if end
6007
						}#if end
5742
						
6008
						
5743
					#反之為多執行序
6009
					#反之為多執行序
5744
					else{
6010
					else{
5745
					
6011
					
5746
						#...
6012
						#...
5747
						#待實作
6013
						#待實作
5748
					
6014
					
5749
						}#else end
6015
						}#else end
-
 
6016
						
-
 
6017
					}#if end
5750
					
6018
					
5751
				}#foreach end
6019
				}#foreach end
5752
			
6020
			
5753
			}#foreach end
6021
			}#foreach end
5754
		
6022
		
Line 6398... Line 6666...
6398
								break;
6666
								break;
6399
								
6667
								
6400
							#如果是透過socket
6668
							#如果是透過socket
6401
							case "socket":
6669
							case "socket":
6402
							
6670
							
6403
								#取得  proc 的 uuid
6671
								#取得 proc 的 uuid
6404
								$procUuid=$procValue["content"][0]["content"];
6672
								$procUuid=$procValue["content"][0]["content"];
6405
								
6673
								
6406
								#函式說明:
6674
								#函式說明:
6407
								#詢問透過 sock::unixDomainSockServer 執行的程序狀況
6675
								#詢問透過 sock::unixDomainSockServer 執行的程序狀況
6408
								#回傳結果:
6676
								#回傳結果:
Line 6534... Line 6802...
6534
										echo json_encode($result);
6802
										echo json_encode($result);
6535
										
6803
										
6536
										#卸除異常的程序
6804
										#卸除異常的程序
6537
										unset($procs[$procIndex]);
6805
										unset($procs[$procIndex]);
6538
										
6806
										
6539
										#結束執行,回傳1給shell,代表異常,
6807
										#結束執行,回傳1給shell,代表異常.
6540
										exit(1);
6808
										exit(1);
6541
									
6809
									
6542
										}#if end
6810
										}#if end
6543
										
6811
									
6544
									#取得合併好的有異動檔案結果
6812
									#取得合併好的有異動檔案結果
6545
									$result["content"]=$mergeArray["content"];
6813
									$result["content"]=$mergeArray["content"];
6546
									
6814
									
6547
									#合併 content - end
6815
									#合併 content - end
6548
									
6816
									
Line 6726... Line 6994...
6726
	#$result["function"],當前執行的函式名稱.
6994
	#$result["function"],當前執行的函式名稱.
6727
	#$result["argu"],本函式使用的參數.
6995
	#$result["argu"],本函式使用的參數.
6728
	#$result["content"],更新後的檔案內容陣列.每個元素代表一行的內容.
6996
	#$result["content"],更新後的檔案內容陣列.每個元素代表一行的內容.
6729
	#$result["found"],字串,是否有找到符合條件需要置換的內容.
6997
	#$result["found"],字串,是否有找到符合條件需要置換的內容.
6730
	#$result["relaceInfo"],陣列,記錄需要置換的行資訊,元素的key為需要置換的行號,第 $i 行用 $i+1 表示.
6998
	#$result["relaceInfo"],陣列,記錄需要置換的行資訊,元素的key為需要置換的行號,第 $i 行用 $i+1 表示.
6731
	#$result["relaceInfo"][$i]["ori"],字串,第 $i+1 行原始的內容.
6999
	#$result["relaceInfo"][$i]["deletedOriHead"],字串,第 $i+1 行原始的內容,前面的空白或tab.
-
 
7000
	#$result["relaceInfo"][$i]["ori"],字串,第 $i+1 行剔除前面的空白或tab後的原始內容.
6732
	#$result["relaceInfo"][$i]["new"],字串,第 $i+1 行要置換成的內容.
7001
	#$result["relaceInfo"][$i]["new"],字串,第 $i+1 行剔除前面的空白或tab後的要置換成的內容.
6733
	#$result["content"],陣列,替換完後的每行內容.
7002
	#$result["content"],陣列,替換完後的每行內容.
6734
	#必填參數:
7003
	#必填參數:
6735
	#$conf["fileArgu"],字串,php變數__FILE__的內容,亦即該檔案在檔案系統的絕對路徑
7004
	#$conf["fileArgu"],字串,php變數__FILE__的內容,亦即該檔案在檔案系統的絕對路徑
6736
	$conf["fileArgu"]=__FILE__;
7005
	$conf["fileArgu"]=__FILE__;
6737
	#$conf["file"],字串,要置換內容的檔案路徑與名稱.
7006
	#$conf["file"],字串,要置換內容的檔案路徑與名稱.
Line 7141... Line 7410...
7141
			$newLine=$info["new"];
7410
			$newLine=$info["new"];
7142
			
7411
			
7143
			#儲存被剔除的開頭字串
7412
			#儲存被剔除的開頭字串
7144
			$deletedOriHead=$info["deletedOriHead"];
7413
			$deletedOriHead=$info["deletedOriHead"];
7145
		
7414
		
-
 
7415
			#debug
-
 
7416
			#var_dump(__FILE__,__LINE__,$lineIndex,$deletedOriHead,$newLine);
-
 
7417
		
7146
			#儲存置換好的行
7418
			#儲存置換好的行
7147
			$result["content"][$lineIndex]=$deletedOriHead.$newLine;
7419
			$result["content"][$lineIndex]=$deletedOriHead.$newLine;
7148
		
7420
		
7149
			}#foreach end
7421
			}#foreach end
7150
		
7422
		
-
 
7423
		#設置有找到要取代的內容
-
 
7424
		$result["found"]="true";
-
 
7425
		
7151
		#設置執行正常
7426
		#設置執行正常
7152
		$result["status"]="true";
7427
		$result["status"]="true";
7153
		
7428
		
7154
		#回傳結果
7429
		#回傳結果
7155
		return $result;
7430
		return $result;