Subversion Repositories qbpwcf-lib(archive)

Rev

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

Rev 550 Rev 553
Line 1021... Line 1021...
1021
		}#if end
1021
		}#if end
1022
 
1022
 
1023
	#要覆寫的內容
1023
	#要覆寫的內容
1024
	$overWriteWith=array("<?php".PHP_EOL);
1024
	$overWriteWith=array("<?php".PHP_EOL);
1025
 
1025
 
-
 
1026
	#debug
-
 
1027
	#$overWriteWith[]="\$reportOnly=\"true\";";
-
 
1028
	
-
 
1029
	#get some verbose info
-
 
1030
	$overWriteWith[]="\$verbose=\"true\";";
-
 
1031
 
1026
	#針對每個為了確保ssh服務有運行的設定
1032
	#針對每個為了確保ssh服務有運行的設定
1027
	foreach($sshAddrAndPort as $ipAndPort){
1033
	foreach($sshAddrAndPort as $ipAndPort){
1028
 
1034
 
1029
		#串接設定
1035
		#串接設定
1030
		$overWriteWith[]="\$ipAndPort="$ipAndPort.";";
1036
		$overWriteWith[]="\$ipAndPort=\"".$ipAndPort."\";";
1031
 
1037
 
1032
		}#foreach end
1038
		}#foreach end
1033
		
1039
		
1034
	#要覆寫的內容
1040
	#要覆寫的內容
1035
	$overWriteWith=array(PHP_EOL."?>");
1041
	$overWriteWith[]=PHP_EOL."?>";
1036
 
1042
 
1037
	#函式說明:
1043
	#函式說明:
1038
	#更新檔案的內容.
1044
	#更新檔案的內容.
1039
	#回傳結果:
1045
	#回傳結果:
1040
	#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
1046
	#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
Line 1043... Line 1049...
1043
	#$result["content"],軟連結的資訊.
1049
	#$result["content"],軟連結的資訊.
1044
	#必填參數:
1050
	#必填參數:
1045
	#$conf["fileArgu"],字串,變數__FILE__的內容.
1051
	#$conf["fileArgu"],字串,變數__FILE__的內容.
1046
	$conf["fileArgu"]=__FILE__;
1052
	$conf["fileArgu"]=__FILE__;
1047
	#$conf["file"],字串,要更新的檔案位置與名稱.
1053
	#$conf["file"],字串,要更新的檔案位置與名稱.
1048
	$conf["file"]="";
1054
	$conf["file"]=$defaultSshdConfigAddr;
1049
	#可省略參數:
1055
	#可省略參數:
1050
	#$conf["overWriteWith"],字串陣列,要置換成什麼樣的內容,每個元素代表一行內容.
1056
	#$conf["overWriteWith"],字串陣列,要置換成什麼樣的內容,每個元素代表一行內容.
1051
	$conf["overWriteWith"]=$overWriteWith;
1057
	$conf["overWriteWith"]=$overWriteWith;
1052
	#$conf["replaceWith"],字串陣列,要將什麼內容置換成什麼內容.
1058
	#$conf["replaceWith"],字串陣列,要將什麼內容置換成什麼內容.
1053
	#$conf["replaceWith"]=array(array("ori content","new content"),array("ori content","new content"),...);
1059
	#$conf["replaceWith"]=array(array("ori content","new content"),array("ori content","new content"),...);
Line 1057... Line 1063...
1057
	#$conf["addToTailBeforeThat"]="?\>";
1063
	#$conf["addToTailBeforeThat"]="?\>";
1058
	#參考資料:
1064
	#參考資料:
1059
	#無.
1065
	#無.
1060
	#備註:
1066
	#備註:
1061
	#無.
1067
	#無.
1062
	$updateFile=fileAccess::updateFile(&$conf);
1068
	$updateFile=fileAccess::updateFile($conf);
1063
	unset($conf);
1069
	unset($conf);
1064
 
1070
 
1065
	#如果執行失敗
1071
	#如果執行失敗
1066
	if($updateFile["status"]==="false"){
1072
	if($updateFile["status"]==="false"){
1067
	
1073