Subversion Repositories php-qbpwcf

Rev

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

Rev 374 Rev 376
Line 1196... Line 1196...
1196
 
1196
 
1197
		#取得當前執行函數名稱
1197
		#取得當前執行函數名稱
1198
		$result["function"]=__FUNCTION__;
1198
		$result["function"]=__FUNCTION__;
1199
		
1199
		
1200
		#設置預設檔案不存在的識別
1200
		#設置預設檔案不存在的識別
1201
		$result["fileNotExist"]="false";
1201
		$result["fileNotExist"]="true";
1202
		
1202
		
1203
		#設置預設檔案不為本函式所建立
1203
		#設置預設檔案不為本函式所建立
1204
		$result["fileCreated"]="false";
1204
		$result["fileCreated"]="false";
1205
 
1205
 
1206
		#如果 $conf 不為陣列
1206
		#如果 $conf 不為陣列
Line 1355... Line 1355...
1355
			}#if end
1355
			}#if end
1356
 
1356
 
1357
		#如果該檔案不存在
1357
		#如果該檔案不存在
1358
		if($fileCheckResult["varExist"][0]=="false"){
1358
		if($fileCheckResult["varExist"][0]=="false"){
1359
 
1359
 
1360
			#設置檔案不存在的識別
-
 
1361
			$result["fileNotExist"]="false";
-
 
1362
 
-
 
1363
			#如果也不要自動建立檔案
1360
			#如果也不要自動建立檔案
1364
			if($conf["createIfnotExist"]==="false"){
1361
			if($conf["createIfnotExist"]==="false"){
1365
 
1362
 
1366
				#設置執行錯誤識別
1363
				#設置執行錯誤識別
1367
				$result["status"]="false";
1364
				$result["status"]="false";
Line 1432... Line 1429...
1432
				return $result;
1429
				return $result;
1433
 
1430
 
1434
				}#if end
1431
				}#if end
1435
				
1432
				
1436
			#設置檔案存在的識別
1433
			#設置檔案存在的識別
1437
			$result["fileNotExist"]="true";
1434
			$result["fileNotExist"]="false";
1438
			
1435
			
1439
			#設置檔案為本函式所建立
1436
			#設置檔案為本函式所建立
1440
			$result["fileCreated"]="true";
1437
			$result["fileCreated"]="true";
1441
 
1438
 
1442
			}#if end
1439
			}#if end
1443
		
1440
		
1444
		#反之
1441
		#反之
1445
		else{
1442
		else{
1446
		
1443
		
1447
			#設置檔案存在的識別
1444
			#設置檔案存在的識別
1448
			$result["fileNotExist"]="true";
1445
			$result["fileNotExist"]="false";
1449
			
1446
			
1450
			}#else end
1447
			}#else end
1451
 
1448
 
1452
		#file absolute addr
1449
		#file absolute addr
1453
		$fileAbAddr=$fileCheckResult["varNameFullPath"][0];
1450
		$fileAbAddr=$fileCheckResult["varNameFullPath"][0];
1454
 
1451
 
1455
		#將檔案的內容放進變數裡面(會得到陣列)
1452
		#將檔案的內容放進變數裡面(會得到陣列)
1456
		$fileContent=file($fileAbAddr);
1453
		$fileContent=file($fileAbAddr);
1457
 
1454
 
1458
		#如果 $fileContent 等於
1455
		#如果 $fileContent 等於
1459
		if($fileContent==FALSE){
1456
		if($fileContent===FALSE){
1460
 
-
 
1461
			#如果檔案大小為0bytes
-
 
1462
			if(filesize($fileAbAddr)==0){
-
 
1463
 
-
 
1464
				#設置錯誤識別
-
 
1465
				$result["warning"][]="執行結果沒有輸出內容";
-
 
1466
 
-
 
1467
				}#if end
-
 
1468
 
1457
 
1469
			#反之檔案有內容
-
 
1470
			else{
-
 
1471
 
-
 
1472
				#設置錯誤識別
1458
			#設置錯誤識別
1473
				$result["status"]="false";
1459
			$result["status"]="false";
1474
 
-
 
1475
				#設置錯誤訊息
-
 
1476
				$result["error"][]="讀取檔案失敗";
-
 
1477
 
1460
 
1478
				#取得詳細的錯誤訊息
1461
			#設置錯誤訊息
1479
				$result["error"][]=$fileCheckResult;
1462
			$result["error"][]="讀取檔案失敗";
1480
 
1463
 
1481
				#回傳結果
1464
			#取得詳細的錯誤訊息
1482
				return $result;
1465
			$result["error"][]=$fileCheckResult;
1483
 
1466
 
1484
				}#else end
1467
			#回傳結果
-
 
1468
			return $result;
1485
 
1469
 
1486
			}#if end
1470
			}#if end
1487
 
1471
 
1488
		#針對每行內容
1472
		#針對每行內容
1489
		for($i=0;$i<count($fileContent);$i++){
1473
		for($i=0;$i<count($fileContent);$i++){