Subversion Repositories php-qbpwcf

Rev

Rev 249 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 249 Rev 284
Line 6174... Line 6174...
6174
				#回傳結果
6174
				#回傳結果
6175
				return $result;
6175
				return $result;
6176
 
6176
 
6177
				}#if end
6177
				}#if end
6178
 
6178
 
-
 
6179
			#針對每行輸出
-
 
6180
			foreach($output as $index=>$line){
-
 
6181
			
-
 
6182
				#如果有內容
-
 
6183
				if(!empty(trim($line))){
-
 
6184
				
6179
			#如果輸出不是 json
6185
					#如果輸出不是 json
6180
			if(json_validate($output[0])===false){
6186
					if(json_validate(trim($line))===false){
6181
 
6187
 
6182
				#設置執行失敗
6188
						#設置執行失敗
6183
				$result["status"]="false";
6189
						$result["status"]="false";
6184
 
6190
 
6185
				#設置錯誤訊息陣列
6191
						#設置錯誤訊息陣列
6186
				$result["error"][]="output from command(".$cmd.") is not json";
6192
						$result["error"][]="output(".trim($line).") from command(".$cmd.") is not json";
6187
 
6193
 
6188
				#回傳結果
6194
						#回傳結果
6189
				return $result;
6195
						return $result;
6190
 
6196
 
-
 
6197
						}#if end
-
 
6198
				
6191
				}#if end
6199
					}#if end
-
 
6200
			
-
 
6201
				}#foreach end
6192
 
6202
 
6193
			#array of json decode
6203
			#array of json decode
6194
			$resArray=(array)(json_decode($output[0]));
6204
			$resArray=(array)(json_decode(trim($line)));
6195
 
6205
 
6196
			#如果解析出來的元素數量不為2
6206
			#如果解析出來的元素數量不為2
6197
			if(count($resArray)!==2){
6207
			if(count($resArray)!==2){
6198
 
6208
 
6199
				#設置需要 escape
6209
				#設置需要 escape