Subversion Repositories php-qbpwcf

Rev

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

Rev 350 Rev 374
Line 1156... Line 1156...
1156
	#函式說明:
1156
	#函式說明:
1157
	#依據行號分隔抓取檔案的內容,結果會回傳一個陣列
1157
	#依據行號分隔抓取檔案的內容,結果會回傳一個陣列
1158
	#回傳的變數說明:
1158
	#回傳的變數說明:
1159
	#$result["status"],執行是否成功,"true"代表成功;"fasle"代表失敗.
1159
	#$result["status"],執行是否成功,"true"代表成功;"fasle"代表失敗.
1160
	#$result["error"],錯誤訊息提示.
1160
	#$result["error"],錯誤訊息提示.
1161
	#$result["warning"],警告訊息.
1161
	#$result["fileNotExist"],字串,"true"代表目標檔案不存在;"false"代表目標檔案存在.
-
 
1162
	#$result["fileCreated"],字串,"true"代表目標檔案被本函式建立;"false"代表檔案不是透過本函式建立.
1162
	#$result["function"],當前執行的函數名稱.
1163
	#$result["function"],當前執行的函數名稱.
1163
	#$result["fileContent"],爲檔案的內容陣列.
1164
	#$result["fileContent"],爲檔案的內容陣列.
1164
	#$result["lineCount"],爲檔案內容總共的行數.
1165
	#$result["lineCount"],爲檔案內容總共的行數.
1165
	#$result["fullContent"],為檔案的完整內容.
1166
	#$result["fullContent"],為檔案的完整內容.
1166
	#$result["base64dataOnly"],檔案的base64data.
1167
	#$result["base64dataOnly"],檔案的base64data.
Line 1193... Line 1194...
1193
		#初始化要回傳的內容
1194
		#初始化要回傳的內容
1194
		$result=array();
1195
		$result=array();
1195
 
1196
 
1196
		#取得當前執行函數名稱
1197
		#取得當前執行函數名稱
1197
		$result["function"]=__FUNCTION__;
1198
		$result["function"]=__FUNCTION__;
-
 
1199
		
-
 
1200
		#設置預設檔案不存在的識別
-
 
1201
		$result["fileNotExist"]="false";
-
 
1202
		
-
 
1203
		#設置預設檔案不為本函式所建立
-
 
1204
		$result["fileCreated"]="false";
1198
 
1205
 
1199
		#如果 $conf 不為陣列
1206
		#如果 $conf 不為陣列
1200
		if(gettype($conf)!="array"){
1207
		if(gettype($conf)!="array"){
1201
 
1208
 
1202
			#設置執行失敗
1209
			#設置執行失敗
Line 1348... Line 1355...
1348
			}#if end
1355
			}#if end
1349
 
1356
 
1350
		#如果該檔案不存在
1357
		#如果該檔案不存在
1351
		if($fileCheckResult["varExist"][0]=="false"){
1358
		if($fileCheckResult["varExist"][0]=="false"){
1352
 
1359
 
-
 
1360
			#設置檔案不存在的識別
-
 
1361
			$result["fileNotExist"]="false";
-
 
1362
 
1353
			#如果也不要自動建立檔案
1363
			#如果也不要自動建立檔案
1354
			if($conf["createIfnotExist"]==="false"){
1364
			if($conf["createIfnotExist"]==="false"){
1355
 
1365
 
1356
				#設置執行錯誤識別
1366
				#設置執行錯誤識別
1357
				$result["status"]="false";
1367
				$result["status"]="false";
Line 1420... Line 1430...
1420
 
1430
 
1421
				#回傳結果
1431
				#回傳結果
1422
				return $result;
1432
				return $result;
1423
 
1433
 
1424
				}#if end
1434
				}#if end
-
 
1435
				
-
 
1436
			#設置檔案存在的識別
-
 
1437
			$result["fileNotExist"]="true";
-
 
1438
			
-
 
1439
			#設置檔案為本函式所建立
-
 
1440
			$result["fileCreated"]="true";
1425
 
1441
 
1426
			}#if end
1442
			}#if end
-
 
1443
		
-
 
1444
		#反之
-
 
1445
		else{
-
 
1446
		
-
 
1447
			#設置檔案存在的識別
-
 
1448
			$result["fileNotExist"]="true";
-
 
1449
			
-
 
1450
			}#else end
1427
 
1451
 
1428
		#file absolute addr
1452
		#file absolute addr
1429
		$fileAbAddr=$fileCheckResult["varNameFullPath"][0];
1453
		$fileAbAddr=$fileCheckResult["varNameFullPath"][0];
1430
 
1454
 
1431
		#將檔案的內容放進變數裡面(會得到陣列)
1455
		#將檔案的內容放進變數裡面(會得到陣列)