Subversion Repositories qbpwcf-lib(archive)

Rev

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

Rev 935 Rev 937
Line 57... Line 57...
57
	echo "--dbName MariaDb service database name, default is test".PHP_EOL;
57
	echo "--dbName MariaDb service database name, default is test".PHP_EOL;
58
	echo "--dbPort MariaDb service port, default is 3306".PHP_EOL;
58
	echo "--dbPort MariaDb service port, default is 3306".PHP_EOL;
59
	echo "--sshAddrAndPort ssh service address, example: 0.0.0.0:22".PHP_EOL;
59
	echo "--sshAddrAndPort ssh service address, example: 0.0.0.0:22".PHP_EOL;
60
	echo "--headless true/false, default is false. If true, it means link allInOneForCI.php to allInOne.php".PHP_EOL;
60
	echo "--headless true/false, default is false. If true, it means link allInOneForCI.php to allInOne.php".PHP_EOL;
61
	echo "--whiteIp, outsite ip which will not auto block forever".PHP_EOL;
61
	echo "--whiteIp, outsite ip which will not auto block forever".PHP_EOL;
62
	echo "--libonly, install library only, neither service file nor executable file".PHP_EOL;
-
 
63
	exit;
62
	exit;
64
 
63
 
65
	}#function help end
64
	}#function help end
66
 
65
 
67
#debug
66
#debug
Line 226... Line 225...
226
$headless="false";
225
$headless="false";
227
 
226
 
228
#預設的白名單ip清單
227
#預設的白名單ip清單
229
$whiteIp=array();
228
$whiteIp=array();
230
 
229
 
231
#預設除了函式庫,服務跟可執行檔都要安裝.
-
 
232
$libonly="false";
-
 
233
 
-
 
234
#檢查參數
230
#檢查參數
235
#函式說明:
231
#函式說明:
236
#檢查必填與可省略的參數,可省略參數可指定預設要給與什麼數值內容.
232
#檢查必填與可省略的參數,可省略參數可指定預設要給與什麼數值內容.
237
#回傳結果:
233
#回傳結果:
238
#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
234
#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
Line 262... Line 258...
262
#$conf["canNotBeEmpty"],字串陣列,哪些必填參數的內容不得為空字串或空陣列,僅當$conf["canBeEmptyString"]為"true"時會生效.
258
#$conf["canNotBeEmpty"],字串陣列,哪些必填參數的內容不得為空字串或空陣列,僅當$conf["canBeEmptyString"]為"true"時會生效.
263
#$conf["canNotBeEmpty"]=array();
259
#$conf["canNotBeEmpty"]=array();
264
#$conf["canBeEmpty"],字串陣列,哪些必填參數的內容可為空字串或空陣列,僅當$conf["canBeEmptyString"]為"false"時會生效.
260
#$conf["canBeEmpty"],字串陣列,哪些必填參數的內容可為空字串或空陣列,僅當$conf["canBeEmptyString"]為"false"時會生效.
265
#$conf["canBeEmpty"]=array();
261
#$conf["canBeEmpty"]=array();
266
#$conf["skipableVariableCanNotBeEmpty"],字串陣列,哪些可省略參數不可以為空字串或空陣列.
262
#$conf["skipableVariableCanNotBeEmpty"],字串陣列,哪些可省略參數不可以為空字串或空陣列.
267
$conf["skipableVariableCanNotBeEmpty"]=array("libOfRootPath","name","mode","configUrl","getIpUrl","ip","dbAcct","dbPass","dbName","dbAddr","dbPort","sshAddrAndPort","headless","whiteIp","libonly");
263
$conf["skipableVariableCanNotBeEmpty"]=array("libOfRootPath","name","mode","configUrl","getIpUrl","ip","dbAcct","dbPass","dbName","dbAddr","dbPort","sshAddrAndPort","headless","whiteIp");
268
#$conf["skipableVariableName"],陣列字串,爲可省略參數的變數名稱陣列,形態爲陣列變數,例如: $conf["skipableVariableName"] = array("id","account","password");
264
#$conf["skipableVariableName"],陣列字串,爲可省略參數的變數名稱陣列,形態爲陣列變數,例如: $conf["skipableVariableName"] = array("id","account","password");
269
$conf["skipableVariableName"]=array("libOfRootPath","name","mode","configUrl","getIpUrl","ip","dbAcct","dbPass","dbName","dbAddr","dbPort","sshAddrAndPort","headless","whiteIp","libonly");
265
$conf["skipableVariableName"]=array("libOfRootPath","name","mode","configUrl","getIpUrl","ip","dbAcct","dbPass","dbName","dbAddr","dbPort","sshAddrAndPort","headless","whiteIp");
270
#$conf["skipableVariableType"],陣列字串,爲可省略參數的變數名稱陣列,形態爲陣列變數,例如: $conf["skipableVariableType"] = array("string",integer,"double");
266
#$conf["skipableVariableType"],陣列字串,爲可省略參數的變數名稱陣列,形態爲陣列變數,例如: $conf["skipableVariableType"] = array("string",integer,"double");
271
$conf["skipableVariableType"]=array("array","array","array","array","array","array","array","array","array","array","array","array","array","array","array");
267
$conf["skipableVariableType"]=array("array","array","array","array","array","array","array","array","array","array","array","array","array","array");
272
#$conf["skipableVarDefaultValue"],字串陣列,每個不存在的可省略變數要初始化為什麼,null與代表不指定,若預設值是參數之一,請將$conf["mustBeFilledVar"]改成"\$conf["\mustBeFilledVar\"]".
268
#$conf["skipableVarDefaultValue"],字串陣列,每個不存在的可省略變數要初始化為什麼,null與代表不指定,若預設值是參數之一,請將$conf["mustBeFilledVar"]改成"\$conf["\mustBeFilledVar\"]".
273
$conf["skipableVarDefaultValue"]=array(null,null,null,null,null,null,null,null,null,null,null,null,null);
269
$conf["skipableVarDefaultValue"]=array(null,null,null,null,null,null,null,null,null,null,null,null);
274
#$conf["disallowAllSkipableVarIsEmpty"],字串,是否允許每個可省略參數都為空字串,預設為"true"允許,反之為"false".
270
#$conf["disallowAllSkipableVarIsEmpty"],字串,是否允許每個可省略參數都為空字串,預設為"true"允許,反之為"false".
275
#$conf["disallowAllSkipableVarIsEmpty"]="";
271
#$conf["disallowAllSkipableVarIsEmpty"]="";
276
#$conf["disallowAllSkipableVarIsEmptyArray"],字串,是否允許每個可省略參數都為空陣列,預設為"true"允許,反之為"false".
272
#$conf["disallowAllSkipableVarIsEmptyArray"],字串,是否允許每個可省略參數都為空陣列,預設為"true"允許,反之為"false".
277
#$conf["disallowAllSkipableVarIsEmptyArray"]="";
273
#$conf["disallowAllSkipableVarIsEmptyArray"]="";
278
#$conf["arrayCountEqualCheck"],字串陣列,為檢查哪些陣列參數的元素數量要一樣,$conf["arrayCountEqualCheck"][$i]=array()為第$i組key為哪些的變數其元素數量要相等.
274
#$conf["arrayCountEqualCheck"],字串陣列,為檢查哪些陣列參數的元素數量要一樣,$conf["arrayCountEqualCheck"][$i]=array()為第$i組key為哪些的變數其元素數量要相等.
Line 286... Line 282...
286
 
282
 
287
#如果有設置參數
283
#如果有設置參數
288
if(count($parseArgu["content"])>0){
284
if(count($parseArgu["content"])>0){
289
 
285
 
290
	#如果有 rootPath 參數
286
	#如果有 rootPath 參數
291
	if(isset($parseArgu["content"]["libOfRootPath"])){
287
	if(isset($parseArgu["content"]["rootPath"])){
292
	
288
	
293
		#如果有 rootPath 參數存在
289
		#如果有 rootPath 參數存在
294
		if(isset($parseArgu["content"]["libOfRootPath"][0])){
290
		if(isset($parseArgu["content"]["rootPath"][0])){
295
		
291
		
296
			#更新套件的安裝位置
292
			#更新套件的安裝位置
297
			$libOfRootPath=$parseArgu["content"]["libOfRootPath"][0];
293
			$libOfRootPath=$parseArgu["content"]["rootPath"][0];
298
			
294
			
299
			#如果路徑不為 "/" 結束
295
			#如果路徑不為 "/" 結束
300
			if($libOfRootPath[strlen($libOfRootPath)-1]!=="/"){
296
			if($libOfRootPath[strlen($libOfRootPath)-1]!=="/"){
301
			
297
			
302
				#補上 "/"
298
				#補上 "/"
Line 474... Line 470...
474
			$whiteIp[]=$ip;
470
			$whiteIp[]=$ip;
475
		
471
		
476
			}#foreach end
472
			}#foreach end
477
	
473
	
478
		}#if end
474
		}#if end
479
		
-
 
480
	#如果有 libonly 參數
-
 
481
	if(isset($parseArgu["content"]["libonly"])){
-
 
482
	
-
 
483
		#如果有 libonly 參數存在
-
 
484
		if(isset($parseArgu["content"]["libonly"][0])){
-
 
485
		
-
 
486
			#如果等於 "yes"
-
 
487
			if($parseArgu["content"]["libonly"][0]==="yes"){
-
 
488
			
-
 
489
				#更新 libonly
-
 
490
				$libonly="true";
-
 
491
			
-
 
492
				}#if end
-
 
493
		
-
 
494
			}#if end
-
 
495
	
-
 
496
		}#if end
-
 
497
 
475
 
498
	}#if end
476
	}#if end
499
 
477
 
500
#如果要使用不自動輸出內容的 allInOneForCI.php 檔案
478
#如果要使用不自動輸出內容的 allInOneForCI.php 檔案
501
if($headless==="true"){
479
if($headless==="true"){