| 1 |
liveuser |
1 |
#!/usr/bin/php
|
|
|
2 |
<?php
|
|
|
3 |
|
|
|
4 |
#使用命名空間qbpwcf
|
|
|
5 |
namespace qbpwcf;
|
|
|
6 |
|
|
|
7 |
#匯入外部套件
|
|
|
8 |
include("../../allInOne.php");
|
|
|
9 |
|
|
|
10 |
#初始化 $i 等於 -1
|
|
|
11 |
$i=-1;
|
|
|
12 |
|
|
|
13 |
$array=array();
|
|
|
14 |
$array[0]=base64_encode(urlencode(json_encode(array("lines"=>3,"content"=>array("a","b","c")))));
|
|
|
15 |
$array[1]=base64_encode(urlencode(json_encode(array("lines"=>3,"content"=>array("d","e","e")))));
|
|
|
16 |
$array[2]=base64_encode(urlencode(json_encode(array("lines"=>3,"content"=>array("f","g","h")))));
|
|
|
17 |
$array[3]=base64_encode(urlencode(json_encode(array("lines"=>3,"content"=>array("i","j","k")))));
|
|
|
18 |
$array[4]=base64_encode(urlencode(json_encode(array("lines"=>3,"content"=>array("l","m","n")))));
|
|
|
19 |
$array[5]=base64_encode(urlencode(json_encode(array("lines"=>3,"content"=>array("o","p","q")))));
|
|
|
20 |
$array[6]=base64_encode(urlencode(json_encode(array("lines"=>3,"content"=>array("r","s","t")))));
|
|
|
21 |
$array[7]=base64_encode(urlencode(json_encode(array("lines"=>3,"content"=>array("v","u","w")))));
|
|
|
22 |
$array[8]=base64_encode(urlencode(json_encode(array("lines"=>3,"content"=>array("x","y","z")))));
|
|
|
23 |
$array[9]=base64_encode(urlencode(json_encode(array("lines"=>3,"content"=>array("A","B","C")))));
|
|
|
24 |
|
|
|
25 |
#無窮迴圈
|
|
|
26 |
while(true){
|
|
|
27 |
|
|
|
28 |
#i加1
|
|
|
29 |
$i++;
|
|
|
30 |
|
|
|
31 |
#如果 i 等於 0
|
|
|
32 |
if($i>8){
|
|
|
33 |
|
|
|
34 |
$i=0;
|
|
|
35 |
|
|
|
36 |
}#if end
|
|
|
37 |
|
|
|
38 |
#涵式說明:
|
|
|
39 |
#將字串寫入到檔案
|
|
|
40 |
#回傳的結果:
|
|
|
41 |
#$result["status"],"true"表示檔案寫入成功,"false"表示檔案寫入失敗.
|
|
|
42 |
#$result["error"],錯誤訊息陣列.
|
|
|
43 |
#$result["function"],當前執行的函數名稱.
|
|
|
44 |
#$result["fileInfo"],實際上寫入的檔案資訊陣列.
|
|
|
45 |
#$result["fileInfo"]["createdFileName"],建立好的檔案名稱.
|
|
|
46 |
#$result["fileInfo"]["createdFilePath"],檔案建立的路徑.
|
|
|
47 |
#$result["fileInfo"]["createdFilePathAndName"].建立好的檔案名稱與路徑.
|
|
|
48 |
#$result["argu"],使用的參數.
|
|
|
49 |
#必填的參數:
|
|
|
50 |
#$conf["fileArgu"],字串,php變數__FILE__的內容,亦即該檔案在檔案系統的絕對路徑
|
|
|
51 |
$conf["fileArgu"]=__FILE__;
|
|
|
52 |
#可省略的參數:
|
|
|
53 |
#$conf["fileName"],字串,爲要編輯的檔案名稱,預設為隨機產生的檔案名稱.
|
|
|
54 |
$conf["fileName"]="window.qbpwcf.tail.php.log";
|
|
|
55 |
#$conf["inputString"],字串,爲要寫入到裏面的內容,若要每筆資料寫入後換行,則可以在字串內容後面加上 \r\n 即可,預設為"".
|
|
|
56 |
$conf["inputString"]=$array[$i].",".$array[$i+1].",".PHP_EOL;
|
|
|
57 |
#$conf["writeMethod"],字串,爲檔案撰寫的方式,可省略,是複寫'a'還是,重新寫入'w',預設爲'w',重新寫入.
|
|
|
58 |
$conf["writeMethod"]="a";
|
|
|
59 |
#$conf["checkRepeat"],字串,"true"代表建立檔案之前要先檢查檔案是否存在,若存在則在原名稱後面加上從(1)開始的編號.
|
|
|
60 |
#$conf["checkRepeat"]="";
|
|
|
61 |
#$conf["filenameExtensionStartPoint"],字串,檔案的副檔名是從倒數第幾個小數點(dot)開始,預設為"1",最後一個小數點,必須與$conf["checkRepeat"]搭配才會生效.
|
|
|
62 |
#$conf["filenameExtensionStartPoint"]="";
|
|
|
63 |
#$conf["repeatNameRule"],字串,遇到相同名稱的檔案要如何加上識別的編號,編號用「\$i」表示,預設為"(\$i)",必須與$conf["checkRepeat"]搭配才會生效.
|
|
|
64 |
#$conf["repeatNameRule"]="";
|
|
|
65 |
fileAccess::writeTextIntoFile($conf);
|
|
|
66 |
unset($conf);
|
|
|
67 |
|
|
|
68 |
}#while end
|
|
|
69 |
?>
|