Subversion Repositories php-qbpwcf

Rev

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

Rev 60 Rev 66
Line 203... Line 203...
203
			#設置錯誤識別
203
			#設置錯誤識別
204
			$result["status"]="false";
204
			$result["status"]="false";
205
			
205
			
206
			#設置錯誤訊息
206
			#設置錯誤訊息
207
			$result["error"]=$callShell;
207
			$result["error"]=$callShell;
208
										
208
			
209
			#回傳結果
209
			#回傳結果
210
			return $result;
210
			return $result;
211
			
211
			
212
			}#if end
212
			}#if end
213
			
213
			
Line 507... Line 507...
507
	#$result["tmpFileOutput"],儲存輸出的暫存檔案名稱,若 $conf["inBackGround"] 為 "true" 則會回傳該值.
507
	#$result["tmpFileOutput"],儲存輸出的暫存檔案名稱,若 $conf["inBackGround"] 為 "true" 則會回傳該值.
508
	#$result["running"],是否還在執行.
508
	#$result["running"],是否還在執行.
509
	#$result["pid"],pid.
509
	#$result["pid"],pid.
510
	#$result["statusCode"],執行結束後的代碼.
510
	#$result["statusCode"],執行結束後的代碼.
511
	#$result["escape"],陣列,儲存重新排序過且已經escape過的指令(key為"cmd")與參數(key為"argu")與兩者組合的一維陣列(key為"array").
511
	#$result["escape"],陣列,儲存重新排序過且已經escape過的指令(key為"cmd")與參數(key為"argu")與兩者組合的一維陣列(key為"array").
-
 
512
	#$result["noEcaped"],陣列,儲存重新排序過未經過escape過的指令(key為"cmd")與參數(key為"argu")與兩者組合的一維陣列(key為"array").
512
	#必填參數:
513
	#必填參數:
513
	#$conf["command"],字串,要執行的指令.
514
	#$conf["command"],字串,要執行的指令.
514
	$conf["command"]="";
515
	$conf["command"]="";
515
	#$conf["fileArgu"],字串,變數__FILE__的內容.
516
	#$conf["fileArgu"],字串,變數__FILE__的內容.
516
	$conf["fileArgu"]=__FILE__;
517
	$conf["fileArgu"]=__FILE__;
Line 531... Line 532...
531
	#$conf["thereIsShellVar"],陣列字串,指令搭配的參數"argu",若含有「\'」,則取代為「"」.每個argu參數都要有對應的元素."true"代表要置換.
532
	#$conf["thereIsShellVar"],陣列字串,指令搭配的參數"argu",若含有「\'」,則取代為「"」.每個argu參數都要有對應的元素."true"代表要置換.
532
	#$conf["thereIsShellVar"]=array();
533
	#$conf["thereIsShellVar"]=array();
533
	#$conf["username"],字串,要用什麼使用者來執行,預設為執行php的使用者,該參數不適用於apache環境.
534
	#$conf["username"],字串,要用什麼使用者來執行,預設為執行php的使用者,該參數不適用於apache環境.
534
	#$conf["username"]="";
535
	#$conf["username"]="";
535
	#$conf["password"],字串,root的使用者密碼,預設不使用密碼,該參數不適用於apache環境.
536
	#$conf["password"],字串,root的使用者密碼,預設不使用密碼,該參數不適用於apache環境.
536
	#$conf["password"]="";
537
	#$conf["password"]="";	
537
	#$conf["useScript"],字串,是否要啟用Linux的script指令來記錄輸出,"true"代表要,Fedora的selinux會擋住該操作;"false"代表不要,預設為"false".
538
	#$conf["useScript"],字串,是否要啟用Linux的script指令來記錄輸出,"true"代表要,Fedora的selinux會擋住該操作;"false"代表不要,預設為"false".
538
	#$conf["useScript"]="";
539
	#$conf["useScript"]="";
539
	#$conf["logFilePath"],字串,當 $conf["useScript"] 為 "true" 時,輸出的內容要暫存到哪裡,預設為 "/tmp/.qbpwcf_tmp/external/callShell/".
540
	#$conf["logFilePath"],字串,當 $conf["useScript"] 為 "true" 時,輸出的內容要暫存到哪裡,預設為 "/tmp/.qbpwcf_tmp/external/callShell/".
540
	#$conf["logFilePath"]=".qbpwcf_tmp/external/callShell/";
541
	#$conf["logFilePath"]=".qbpwcf_tmp/external/callShell/";
541
	#$conf["inBackGround"],字串,是否要在背景執行,且不會等待程式執行結束再執行下一個指令,"true"代表是,"false"代表不要,預設為"false",如果$conf["command"]有用「;」區隔的多個指令將會出錯.
542
	#$conf["inBackGround"],字串,是否要在背景執行,且不會等待程式執行結束再執行下一個指令,"true"代表是,"false"代表不要,預設為"false",如果$conf["command"]有用「;」區隔的多個指令將會出錯.
Line 606... Line 607...
606
		$conf["variableCheck::checkArguments"]["referenceVarKey"]="variableCheck::checkArguments";
607
		$conf["variableCheck::checkArguments"]["referenceVarKey"]="variableCheck::checkArguments";
607
		#可以省略的參數:
608
		#可以省略的參數:
608
		#$conf["variableCheck::checkArguments"]["canBeEmptyString"],必填變數內容如果是空字串就不能算是有設置的話,請設為"false",預設爲"true"。
609
		#$conf["variableCheck::checkArguments"]["canBeEmptyString"],必填變數內容如果是空字串就不能算是有設置的話,請設為"false",預設爲"true"。
609
		#$conf["variableCheck::checkArguments"]["canBeEmptyString"]="false";
610
		#$conf["variableCheck::checkArguments"]["canBeEmptyString"]="false";
610
		#$conf["variableCheck::checkArguments"]["skipableVariableName"],爲可省略參數的變數名稱陣列,形態爲陣列變數,例如: $conf["skipableVariableName"] = array("id","account","password");
611
		#$conf["variableCheck::checkArguments"]["skipableVariableName"],爲可省略參數的變數名稱陣列,形態爲陣列變數,例如: $conf["skipableVariableName"] = array("id","account","password");
611
		$conf["variableCheck::checkArguments"]["skipableVariableName"]=array("pre","enablePrintDescription","printDescription","argu","escapeshellarg","username","password","useScript","logFilePath","inBackGround","arguIsAddr","getErr","plainArgu","useApostrophe","doNotRun","thereIsShellVar");
-
 
612
		$conf["variableCheck::checkArguments"]["skipableVariableName"]=array("pre","enablePrintDescription","printDescription","argu","escapeshellarg","username","password","useScript","logFilePath","inBackGround","arguIsAddr","getErr","doNotRun","thereIsShellVar");
612
		$conf["variableCheck::checkArguments"]["skipableVariableName"]=array("pre","enablePrintDescription","printDescription","argu","escapeshellarg","username","password","useScript","logFilePath","inBackGround","arguIsAddr","getErr","doNotRun","thereIsShellVar");
613
		#$conf["variableCheck::checkArguments"]["skipableVariableType"],爲可省略參數的變數名稱陣列,形態爲陣列變數,例如: $conf["skipableVariableType"] = array("string",integer,"double"); 
613
		#$conf["variableCheck::checkArguments"]["skipableVariableType"],爲可省略參數的變數名稱陣列,形態爲陣列變數,例如: $conf["skipableVariableType"] = array("string",integer,"double"); 
614
		$conf["variableCheck::checkArguments"]["skipableVariableType"]=array("array","string","string","array","string","string","string","string","string","string","array","string","array","array","string","array");
-
 
615
		$conf["variableCheck::checkArguments"]["skipableVariableType"]=array("array","string","string","array","string","string","string","string","string","string","array","string","string","array");
614
		$conf["variableCheck::checkArguments"]["skipableVariableType"]=array("array","string","string","array","string","string","string","string","string","string","array","string","string","array");
616
		#$conf["variableCheck::checkArguments"]["skipableVarDefaultValue"],字串陣列,每個不存在的可省略變數要初始化為什麼,"null"代表不指定,若預設值是必填參數之一,請將$conf["mustBeFilledVar"]改成"\$conf["\mustBeFilledVar\"]".
615
		#$conf["variableCheck::checkArguments"]["skipableVarDefaultValue"],字串陣列,每個不存在的可省略變數要初始化為什麼,"null"代表不指定,若預設值是必填參數之一,請將$conf["mustBeFilledVar"]改成"\$conf["\mustBeFilledVar\"]".
617
		$conf["variableCheck::checkArguments"]["skipableVarDefaultValue"]=array(null,"false",null,null,"false",null,null,"false",".qbpwcf_tmp/external/callShell/","false",null,"false",null,null,"false",null);
-
 
618
		$conf["variableCheck::checkArguments"]["skipableVarDefaultValue"]=array(null,"false",null,null,"false",null,null,"false",".qbpwcf_tmp/external/callShell/","false",null,"false","false",null);
616
		$conf["variableCheck::checkArguments"]["skipableVarDefaultValue"]=array(null,"false",null,null,"false",null,null,"false",".qbpwcf_tmp/external/callShell/","false",null,"false","false",null);
619
		#$conf["variableCheck::checkArguments"]["arrayCountEqualCheck"],字串陣列,為檢查哪些陣列參數的元素數量要一樣,$conf["arrayCountEqualCheck"][$i]=array()為第$i組key為哪些的變數其元素數量要相等.
617
		#$conf["variableCheck::checkArguments"]["arrayCountEqualCheck"],字串陣列,為檢查哪些陣列參數的元素數量要一樣,$conf["arrayCountEqualCheck"][$i]=array()為第$i組key為哪些的變數其元素數量要相等.
620
		$conf["variableCheck::checkArguments"]["arrayCountEqualCheck"][]=array("argu","arguIsAddr");
618
		$conf["variableCheck::checkArguments"]["arrayCountEqualCheck"][]=array("argu","arguIsAddr");
621
		$checkResult=variableCheck::checkArguments($conf["variableCheck::checkArguments"]);
619
		$checkResult=variableCheck::checkArguments($conf["variableCheck::checkArguments"]);
622
		unset($conf["variableCheck::checkArguments"]);
620
		unset($conf["variableCheck::checkArguments"]);
Line 975... Line 973...
975
						
973
						
976
						#如果是位置參數
974
						#如果是位置參數
977
						if($conf["arguIsAddr"][$i]==="true"){
975
						if($conf["arguIsAddr"][$i]==="true"){
978
							
976
							
979
							#如果相對路徑就要轉換路徑
977
							#如果相對路徑就要轉換路徑
980
							if(strpos($conf["argu"][$i],"/")!==0)
978
							if(strpos($conf["argu"][$i],"/")!==0){
981
							{
979
								
982
								#函數說明:
980
								#函數說明:
983
								#將多個路徑字串變成相對於當前路徑的相對路徑字串
981
								#將多個路徑字串變成相對於當前路徑的相對路徑字串
984
								#回傳結果:
982
								#回傳結果:
985
								#$result["status"],"true"爲建立成功,"false"爲建立失敗.
983
								#$result["status"],"true"爲建立成功,"false"爲建立失敗.
986
								#$result["error"],錯誤訊息陣列.
984
								#$result["error"],錯誤訊息陣列.
Line 990... Line 988...
990
								#$conf["path"],陣列字串,要轉換成相對路徑的字串.;
988
								#$conf["path"],陣列字串,要轉換成相對路徑的字串.;
991
								$conf["fileAccess::getRelativePath"]["path"]=array($conf["argu"][$i]);
989
								$conf["fileAccess::getRelativePath"]["path"]=array($conf["argu"][$i]);
992
								#$conf["fileArgu"],字串,當前路徑.
990
								#$conf["fileArgu"],字串,當前路徑.
993
								$conf["fileAccess::getRelativePath"]["fileArgu"]=$conf["fileArgu"];
991
								$conf["fileAccess::getRelativePath"]["fileArgu"]=$conf["fileArgu"];
994
								$getRelativePath=fileAccess::getRelativePath($conf["fileAccess::getRelativePath"]);
992
								$getRelativePath=fileAccess::getRelativePath($conf["fileAccess::getRelativePath"]);
995
								unset($conf["fileAccess::getRelativePath"]);	
993
								unset($conf["fileAccess::getRelativePath"]);
996
										
994
								
997
								#var_dump($getRelativePath);		
995
								#var_dump($getRelativePath);
998
											
996
								
999
								#如果轉換路徑失敗
997
								#如果轉換路徑失敗
1000
								if($getRelativePath["status"]==="false"){
998
								if($getRelativePath["status"]==="false"){
1001
									
999
									
1002
									#設置執行失敗的識別
1000
									#設置執行失敗的識別
1003
									$result["status"]="false";
1001
									$result["status"]="false";
Line 1006... Line 1004...
1006
									$result["error"]=$getRelativePath;
1004
									$result["error"]=$getRelativePath;
1007
									
1005
									
1008
									#回傳結果
1006
									#回傳結果
1009
									return $result;
1007
									return $result;
1010
									
1008
									
1011
									}#if end	
1009
									}#if end
1012
									
1010
									
1013
								#取得相對路徑					
1011
								#取得相對路徑
1014
								$conf["argu"][$i]=$getRelativePath["content"][0];
1012
								$conf["argu"][$i]=$getRelativePath["content"][0];
1015
							
1013
							
1016
								#取得相對路徑
1014
								#取得相對路徑
1017
								$relativePath=$getRelativePath["content"][0];
1015
								$relativePath=$getRelativePath["content"][0];
1018
								
1016
								
1019
								#保存其相對路徑				
1017
								#保存其相對路徑
1020
								$conf["argu"][$i]=$relativePath;
1018
								$conf["argu"][$i]=$relativePath;
1021
							
1019
							
1022
								}#if end
1020
								}#if end
1023
							
1021
							
1024
							}#if end
1022
							}#if end
Line 1258... Line 1256...
1258
							
1256
							
1259
							#儲存真正的參數
1257
							#儲存真正的參數
1260
							$result["escape"]["argu"][]=$escapeArgu;
1258
							$result["escape"]["argu"][]=$escapeArgu;
1261
							
1259
							
1262
							}#else 
1260
							}#else 
1263
											
1261
						
1264
						}#else end
1262
						}#else end
1265
										
1263
					
1266
					}#for end
1264
					}#for end
1267
				
1265
				
1268
				}#if end
1266
				}#if end
1269
						
1267
			
1270
			}#if end
1268
			}#if end
1271
			
1269
			
1272
		#反之 $conf["escapeshellarg"] 為 "false"
1270
		#反之 $conf["escapeshellarg"] 為 "false"
1273
		else{
1271
		else{
1274
			
1272
			
-
 
1273
			#初始化儲存未escaped後的指令與參數資訊
-
 
1274
			$result["noEscaped"]=array();
-
 
1275
			
-
 
1276
			#儲存執行的指令
-
 
1277
			$result["noEscaped"]["cmd"]=$conf["command"];
-
 
1278
			
-
 
1279
			#初始化儲存執行的參數
-
 
1280
			$result["noEscaped"]["argu"]=array();
-
 
1281
			
1275
			#如果有參數存在
1282
			#如果有參數存在
1276
			if(isset($conf["argu"])){
1283
			if(isset($conf["argu"])){
1277
				
1284
				
-
 
1285
				#儲存執行的參數
-
 
1286
				$result["noEscaped"]["argu"]=$conf["argu"];
-
 
1287
				
1278
				#有幾個參數就執行幾次
1288
				#有幾個參數就執行幾次
1279
				for($i=0;$i<count($conf["argu"]);$i++){
1289
				for($i=0;$i<count($conf["argu"]);$i++){
1280
					
1290
					
1281
					#如果有指定位置參數
1291
					#如果有指定位置參數
1282
					if(isset($conf["arguIsAddr"])){
1292
					if(isset($conf["arguIsAddr"])){
1283
						
1293
						
1284
						#如果是位置參數
1294
						#如果是位置參數
1285
						if($conf["arguIsAddr"][$i]==="true"){
1295
						if($conf["arguIsAddr"][$i]==="true"){
1286
							
1296
							
1287
							#如果是相對路徑就要轉換路徑
1297
							#如果是相對路徑就要轉換路徑
1288
							if(strpos($conf["argu"][$i],"/")!==0)
1298
							if(strpos($conf["argu"][$i],"/")!==0){
1289
							{
1299
							
1290
								#函數說明:
1300
								#函數說明:
1291
								#將多個路徑字串變成相對於當前路徑的相對路徑字串
1301
								#將多個路徑字串變成相對於當前路徑的相對路徑字串
1292
								#回傳結果:
1302
								#回傳結果:
1293
								#$result["status"],"true"爲建立成功,"false"爲建立失敗.
1303
								#$result["status"],"true"爲建立成功,"false"爲建立失敗.
1294
								#$result["error"],錯誤訊息陣列.
1304
								#$result["error"],錯誤訊息陣列.
Line 1299... Line 1309...
1299
								$conf["fileAccess::getRelativePath"]["path"]=array($conf["argu"][$i]);
1309
								$conf["fileAccess::getRelativePath"]["path"]=array($conf["argu"][$i]);
1300
								#$conf["fileArgu"],字串,當前路徑.
1310
								#$conf["fileArgu"],字串,當前路徑.
1301
								$conf["fileAccess::getRelativePath"]["fileArgu"]=$conf["fileArgu"];
1311
								$conf["fileAccess::getRelativePath"]["fileArgu"]=$conf["fileArgu"];
1302
								$getRelativePath=fileAccess::getRelativePath($conf["fileAccess::getRelativePath"]);
1312
								$getRelativePath=fileAccess::getRelativePath($conf["fileAccess::getRelativePath"]);
1303
								unset($conf["fileAccess::getRelativePath"]);	
1313
								unset($conf["fileAccess::getRelativePath"]);	
1304
											
1314
								
1305
								#如果轉換路徑失敗
1315
								#如果轉換路徑失敗
1306
								if($getRelativePath["status"]==="false"){
1316
								if($getRelativePath["status"]==="false"){
1307
									
1317
									
1308
									#設置執行失敗的識別
1318
									#設置執行失敗的識別
1309
									$result["status"]="false";
1319
									$result["status"]="false";
Line 1437... Line 1447...
1437
					
1447
					
1438
					#透過指定的使用者來執行指令
1448
					#透過指定的使用者來執行指令
1439
					$result["cmd"]="su ".$conf["username"]." -c '".$result["cmd"]."'";
1449
					$result["cmd"]="su ".$conf["username"]." -c '".$result["cmd"]."'";
1440
					
1450
					
1441
					}#else end
1451
					}#else end
1442
				
1452
			
1443
				}#if end
1453
				}#if end
1444
			
1454
			
1445
			}#if end
1455
			}#if end
1446
		
1456
		
1447
		#如果 $conf["useScript"] 為 "true"
1457
		#如果 $conf["useScript"] 為 "true"
Line 1468... Line 1478...
1468
			#$conf["fileAccess::getInternetAddress"]["userDir"]="true";
1478
			#$conf["fileAccess::getInternetAddress"]["userDir"]="true";
1469
			#備註:
1479
			#備註:
1470
			#在命令列執行,所得的路徑是錯誤的。
1480
			#在命令列執行,所得的路徑是錯誤的。
1471
			$getInternetAddress=fileAccess::getInternetAddress($conf["fileAccess::getInternetAddress"]);
1481
			$getInternetAddress=fileAccess::getInternetAddress($conf["fileAccess::getInternetAddress"]);
1472
			unset($conf["fileAccess::getInternetAddress"]);
1482
			unset($conf["fileAccess::getInternetAddress"]);
1473
						
1483
			
1474
			#如果轉換路徑失敗
1484
			#如果轉換路徑失敗
1475
			if($getInternetAddress["status"]=="false"){
1485
			if($getInternetAddress["status"]=="false"){
1476
				
1486
				
1477
				#設置執行失敗
1487
				#設置執行失敗
1478
				$result["status"]="false";
1488
				$result["status"]="false";
Line 1482... Line 1492...
1482
				
1492
				
1483
				#回傳結果
1493
				#回傳結果
1484
				return $result;
1494
				return $result;
1485
				
1495
				
1486
				}#if end
1496
				}#if end
1487
				
1497
			
1488
			#取得轉換後的絕對路徑
1498
			#取得轉換後的絕對路徑
1489
			$conf["logFilePath"]=$getInternetAddress["fileSystemAbsoulutePosition"];
1499
			$conf["logFilePath"]=$getInternetAddress["fileSystemAbsoulutePosition"];
1490
				
1500
			
1491
			#確保logFile的路徑
1501
			#確保logFile的路徑
1492
			#涵式說明:
1502
			#涵式說明:
1493
			#確保路徑存在.
1503
			#確保路徑存在.
1494
			#回傳的結果:
1504
			#回傳的結果:
1495
			#$result["status"],執行正常與否,"true"代表正常,"false"代表不正常.
1505
			#$result["status"],執行正常與否,"true"代表正常,"false"代表不正常.
Line 1521... Line 1531...
1521
				
1531
				
1522
				#回傳結果
1532
				#回傳結果
1523
				return $result;
1533
				return $result;
1524
				
1534
				
1525
				}#if end
1535
				}#if end
1526
					
1536
			
1527
			#初始化 $conf["logFileName"]
1537
			#初始化 $conf["logFileName"]
1528
			$conf["logFileName"]="";
1538
			$conf["logFileName"]="";
1529
			
1539
			
1530
			#無窮迴圈
1540
			#無窮迴圈
1531
			for($i=0;$i<1;){
1541
			for($i=0;$i<1;){
Line 1611... Line 1621...
1611
				
1621
				
1612
					#跳出迴圈
1622
					#跳出迴圈
1613
					break;
1623
					break;
1614
					
1624
					
1615
					}#else end
1625
					}#else end
1616
							
1626
				
1617
				}#for end
1627
				}#for end
1618
			
1628
			
1619
			#用script指令抓取輸出,並存到 $conf["logFilePath"]."/".$conf["logFileName"].
1629
			#用script指令抓取輸出,並存到 $conf["logFilePath"]."/".$conf["logFileName"].
1620
			$result["cmd"]="script -q -c \"".$result["cmd"]."\" \"".$conf["logFilePath"]."/".$conf["logFileName"]."\"";
1630
			$result["cmd"]="script -q -c \"".$result["cmd"]."\" \"".$conf["logFilePath"]."/".$conf["logFileName"]."\"";
1621
			
1631
			
Line 1695... Line 1705...
1695
			
1705
			
1696
			}#if end
1706
			}#if end
1697
			
1707
			
1698
		#反之沒有要在背景中執行
1708
		#反之沒有要在背景中執行
1699
		else{
1709
		else{
1700
		
1710
			
1701
			#如果要將錯誤輸出導到標準輸出
1711
			#如果要將錯誤輸出導到標準輸出
1702
			if($conf["getErr"]==="true"){
1712
			if($conf["getErr"]==="true"){
1703
			
1713
			
1704
				#指令加上 "2>&1"
1714
				#指令加上 "2>&1"
1705
				$result["cmd"]=$result["cmd"]." 2>&1";
1715
				$result["cmd"]=$result["cmd"]." 2>&1";
Line 1846... Line 1856...
1846
				
1856
				
1847
			#設置 cmd & argu 合併為一維陣列後的結果
1857
			#設置 cmd & argu 合併為一維陣列後的結果
1848
			$result["escape"]["array"]=&$cmdAndArguArray;
1858
			$result["escape"]["array"]=&$cmdAndArguArray;
1849
			
1859
			
1850
			}#if end
1860
			}#if end
-
 
1861
		
-
 
1862
		#如果有不 Escaped 的指令資訊結果
-
 
1863
		if(isset($result["noEscaped"])){
-
 
1864
		
-
 
1865
			#從 $result["noEscaped"]["cmd"] 跟 $result["noEscaped"]["argu"] 產生 $result["noEscaped"]["array"]
-
 
1866
			#函式說明:
-
 
1867
			#將多個一維陣列串聯起來,key從0開始排序.
-
 
1868
			#回傳的結果:
-
 
1869
			#$result["status"],"true"表執行正常,"false"代表執行不正常.
-
 
1870
			#$result["error"],錯誤訊息陣列.
-
 
1871
			#$result["function"],當前執行的函數.
-
 
1872
			#$result["argu"],字串陣列,目前輸入的參數名稱陣列.
-
 
1873
			#$result["content"],合併好的一維陣列.
-
 
1874
			#必填參數
-
 
1875
			#$conf["inputArray"],陣列,要合併的一維陣列變數,例如:=array($array1,$array2);
-
 
1876
			$conf["arrays::mergeArray"]["inputArray"]=array(array($result["noEscaped"]["cmd"]),$result["noEscaped"]["argu"]);
-
 
1877
			#可省略參數:
-
 
1878
			#$conf["allowRepeat"],字串,預設為"true",允許重複的結果;若為"false"則不會出現重複的元素內容.
-
 
1879
			#$conf["allowRepeat"]="true";
-
 
1880
			#$conf["looseDiff"],字串,預設為"false",代表要嚴謹判斷為有相異,例如陣列中元素的key順序不同(整數)就代表有相異;反之為"true",例如陣列中元素的key順序不同(非整數),但value有相同,則視為無相異.
-
 
1881
			#$conf["looseDiff"]="false";
-
 
1882
			#參考資料:
-
 
1883
			#無.
-
 
1884
			#備註:
-
 
1885
			#無.
-
 
1886
			$mergeArray=arrays::mergeArray($conf["arrays::mergeArray"]);
-
 
1887
			unset($conf["arrays::mergeArray"]);
1851
 
1888
 
-
 
1889
			#如果異常
-
 
1890
			if($mergeArray["status"]=="false"){
-
 
1891
				
-
 
1892
				#設置執行不正常
-
 
1893
				$result["status"]="false";
-
 
1894
				
-
 
1895
				#設置執行錯誤
-
 
1896
				$result["error"]=$mergeArray;
-
 
1897
				
-
 
1898
				#回傳結果
-
 
1899
				return $result;
-
 
1900
				
-
 
1901
				}#if end
-
 
1902
			
-
 
1903
			#取得未escape的指令與參數陣列
-
 
1904
			$result["noEscaped"]["array"]=$mergeArray["content"];
-
 
1905
		
-
 
1906
			}#if end
-
 
1907
		
1852
		#若執行外部式回傳的狀態不為0
1908
		#若執行外部式回傳的狀態不為0
1853
		if($execStatus!==0){
1909
		if($execStatus!==0){
1854
			
1910
			
1855
			#代表執行外部程式不正常.
1911
			#代表執行外部程式不正常.
1856
			
1912
			
Line 2574... Line 2630...
2574
		$result["status"]="true";
2630
		$result["status"]="true";
2575
		
2631
		
2576
		#回傳結果
2632
		#回傳結果
2577
		return $result;
2633
		return $result;
2578
		
2634
		
2579
		}#function callShellExecInBg end	
2635
		}#function callShellExecInBg end
2580
		
2636
		
2581
	/*
2637
	/*
2582
	#函式說明:
2638
	#函式說明:
2583
	#檢查程序是否還在執行 
2639
	#檢查程序是否還在執行 
2584
	#回傳結果:
2640
	#回傳結果: