Subversion Repositories php-qbpwcf

Rev

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

Rev 159 Rev 162
Line 27327... Line 27327...
27327
								return $result;
27327
								return $result;
27328
 
27328
 
27329
								}#if end
27329
								}#if end
27330
							
27330
							
27331
							#如果程序結束代碼為0
27331
							#如果程序結束代碼為0
27332
							if($proc["content"][0]["statusCode"]==="0"){
27332
							if($proc["content"][0]["statusCode"]===0){
27333
							
27333
							
27334
								#設置檢查通過
27334
								#設置檢查通過
27335
								$pass="true";
27335
								$pass="true";
27336
							
27336
							
27337
								}#if end
27337
								}#if end
Line 27340... Line 27340...
27340
							if($pass==="false"){
27340
							if($pass==="false"){
27341
							
27341
							
27342
								#提示問題
27342
								#提示問題
27343
								echo "service ".$conf["name"]." not pass test by commamd(".$checkListen["cmd"]["cmd"].")!".PHP_EOL;
27343
								echo "service ".$conf["name"]." not pass test by commamd(".$checkListen["cmd"]["cmd"].")!".PHP_EOL;
27344
							
27344
							
-
 
27345
								#如果要 verbose
-
 
27346
								if($conf["verbose"]==="true"){
-
 
27347
									
-
 
27348
									#debug
-
 
27349
									var_dump($proc);
-
 
27350
								
-
 
27351
									}#if end
-
 
27352
							
27345
								#如果只要 Report
27353
								#如果只要 Report
27346
								if($conf["reportOnly"]==="true"){
27354
								if($conf["reportOnly"]==="true"){
27347
								
27355
								
27348
									#輸出
27356
									#輸出
27349
									echo "service ".$conf["name"]." need to restart!".PHP_EOL;;
27357
									echo "service ".$conf["name"]." need to restart!".PHP_EOL;;
Line 27407... Line 27415...
27407
							echo " condition "; 
27415
							echo " condition "; 
27408
							
27416
							
27409
							#針對每個條件
27417
							#針對每個條件
27410
							foreach($checkListen as $name => $value){
27418
							foreach($checkListen as $name => $value){
27411
							
27419
							
-
 
27420
								#函式說明:
-
 
27421
								#回傳變數的解析結果.
-
 
27422
								#回傳結果:
-
 
27423
								#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
-
 
27424
								#$result["content"],變數的解析結果.
-
 
27425
								#$result["function"],當前執行的函數
-
 
27426
								#$result["error"],涵式錯誤訊息陣列
-
 
27427
								#必填參數:
-
 
27428
								#$conf["var"],any,任意內容,通常為變數.
-
 
27429
								$conf["variableCheck::toSource"]["var"]=$value;
-
 
27430
								#可省略參數:
-
 
27431
								#無.
-
 
27432
								#參考資料:
-
 
27433
								#無.
-
 
27434
								#備註:
-
 
27435
								#無.
-
 
27436
								$toSource=variableCheck::toSource($conf["variableCheck::toSource"]);
-
 
27437
								unset($conf["variableCheck::toSource"]);
-
 
27438
							
-
 
27439
								#若運行出錯
-
 
27440
								if($toSource["status"]==="false"){
-
 
27441
								
-
 
27442
									#設置執行失敗
-
 
27443
									$result["status"]="false";
-
 
27444
 
-
 
27445
									#設置錯誤訊息
-
 
27446
									$result["error"]=$toSource;
-
 
27447
 
-
 
27448
									#回傳結果
-
 
27449
									return $result;
-
 
27450
								
-
 
27451
									}#if end
-
 
27452
							
27412
								#印出條件
27453
								#印出條件
27413
								echo $name." = ".$value;
27454
								echo $name." = ".$toSource["content"];
27414
							
27455
							
27415
								}#for end
27456
								}#for end
27416
							
27457
							
27417
							#印出結果
27458
							#印出結果
27418
							echo " passed".PHP_EOL;
27459
							echo " passed".PHP_EOL;