Subversion Repositories php-qbpwcf

Rev

Rev 220 | Rev 226 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

<?php

/*

        QBPWCF, Quick Build PHP website Component base on Fedora Linux.
    Copyright (C) 2014~2025 Min-Jhin,Chen

    This file is part of QBPWCF.

    QBPWCF is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    QBPWCF is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with QBPWCF.  If not, see <http://www.gnu.org/licenses/>.

*/
namespace qbpwcf;

/*
類別說明:
管理QBPWCFW套件的類別.
備註:
待所有函數類別與函數都標準化後,再來修改該函數會比較恰當. 
*/
class phpLib{

        /*
        #函式說明:
        #當前類別被呼叫的靜態方法不存在時,將會執行該函數,回報該方法不存在.
        #回傳結果:
        #$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
        #$reuslt["error"],執行不正常結束的錯訊息陣列.
        #$result["function"],當前執行的函式名稱.
        #必填參數:
        #$method,物件,為物件實體或類別名稱,會自動置入該參數.
        #$arguments,陣列,為呼叫方法時所用的參數.
        #可省略參數:
        #無.
        #參考資料:
        #__call=>http://php.net/manual/en/language.oop5.overloading.php#object.callstatic
        #備註:
        #無.
        */
        public function __call($method,$arguments){
                
                #取得當前執行的函式
                $result["function"]=__FUNCTION__;
                
                #設置執行不正常
                $result["status"]="false";
                
                #設置執行錯誤
                $result["error"][]=__NAMESPACE__ ."/".$method."() 不存在!";
                
                #設置所丟入的參數
                $result["error"][]=$arguments;
                
                #回傳結果
                return $result;
                
                }#function __call end
                
        /*
        #函式說明:
        #當前類別被呼叫的靜態方法不存在時,將會執行該函數,回報該方法不存在.
        #回傳結果:
        #$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
        #$reuslt["error"],執行不正常結束的錯訊息陣列.
        #$result["function"],當前執行的函式名稱.
        #必填參數:
        #$method,物件,為物件實體或類別名稱,會自動置入該參數.
        #$arguments,陣列,為呼叫方法時所用的參數.
        #可省略參數:
        #無.
        #參考資料:
        #__callStatic=>http://php.net/manual/en/language.oop5.overloading.php#object.callstatic
        #備註:
        #無.
        */
        public static function __callStatic($method,$arguments){
                
                #取得當前執行的函式
                $result["function"]=__FUNCTION__;
                
                #設置執行不正常
                $result["status"]="false";
                
                #設置執行錯誤
                $result["error"][]="欲呼叫的". __NAMESPACE__ ."/".$method."() 不存在!";
                
                #設置所丟入的參數
                $result["error"][]=$arguments;
                
                #回傳結果
                return $result;
                
                }#function __callStatic end

        /*
        #函式說明:
        #取得目錄底下函式庫檔案清單
        #回傳結果:
        #$result["status"],"true"表示執行成功;"false"表示執行失敗
        #$result["error"],錯誤訊息.
        #$result["function"],當前執行的函數名稱.
        #$result["dataCount"],有幾筆符合的資料
        #$result["neededList"],符合條件的檔案清單              
        #必填參數:
        #$conf["folderAddress"],字串,要讀取的函式庫目錄
        $conf["folderAddress"]="phpLib";
        #$conf["fileArgu"],字串,__FILE__的內容.
        $conf["fileArgu"]=__FILE__;
        #可省略參數:
        #$conf["readFileType"],陣列,要讀取具有該陣列底下副檔名的檔案
        #$conf["readFileType"]=array("php","js","css");
        #$conf["excludeFile"],陣列,要忽略的檔案,*-soap.php代表"-soap.php"結尾的檔案都不要.
        #$conf["excludeFile"]=array();
        #參考資料:
        #無.
        #備註:
        #無.
        */
        public static function getLibFileList(&$conf){

                #初始化要回傳的內容
                $result=array();

                #取得當前函數的名稱
                $result["function"]=__FUNCTION__;

                #如果 $conf 不為陣列
                if(gettype($conf)!="array"){
                        
                        #設置執行失敗
                        $result["status"]="false";
                        
                        #設置執行錯誤訊息
                        $result["error"][]="\$conf變數須為陣列形態";

                        #如果傳入的參數為 null
                        if($conf==null){
                                
                                #設置執行錯誤訊息
                                $result["error"][]="\$conf變數不得為null,請檢查函數「".$result["function"]."」的參數設置有無正確!";
                                
                                }#if end

                        #回傳結果
                        return $result;
                        
                        }#if end

                #函式說明:
                #檢查陣列裡面的特定元素是否存在以及其變數型態是否正確,如果沒有設定則回傳提示訊息。
                #回傳結果:
                #$result["passed"],識別要檢查的全體變數是否存在以及型態是否正確的變數,"true"代表檢查全部通過;"false"代表檢查不通過
                #$result[$shouldBtCheckedVarName]["varExist"],所檢查的變數是否存在,"false"代表不存在;"true"代表存在
                #$result[$shouldBtCheckedVarName]["varType"],所檢查的變數型態是否正確,"false"代表錯誤;"true"代表正確
                #必填寫的參數:
                $conf["variableCheck"]["isexistMuti"]["varInput"]=$conf;#要檢查的陣列變數
                $conf["variableCheck"]["isexistMuti"]["variableCheck"]=array("folderAddress","fileArgu");#要檢查的變數名稱陣列,形態爲陣列變數,例如: $conf["variableCheck"] = array("id","account","password");
                #可以省略的參數:
                $conf["variableCheck"]["isexistMuti"]["variableType"]=array("string","string");#要檢查的陣列變數內的元素應該爲何種變數形態,形態爲陣列 例如: $conf[variableType] = array("string","int","double"); 
                #$conf["canBeEmptyString"]="false";#變數內容如果是空字串就不能算是有設置的話,請設為"false",預設為也算是有設置。
                $checkResult=variableCheck::isexistMulti($conf["variableCheck"]["isexistMuti"]);
                unset($conf["variableCheck"]["isexistMuti"]);

                #如果參數檢查有問題 
                if($checkResult["passed"]=="false"){

                        #回傳檢查的結果
                        return $checkResult;

                        }#if end

                #如果 $conf["readFileType"] 沒有設置
                if(!isset($conf["readFileType"])){

                        #套用預設數值
                        $conf["readFileType"]=array("php","js","css");

                        }#if end

                #如果 $conf["readFileType"] 沒有設置
                if(!isset($conf["excludeFile"])){

                        #套用預設數值
                        $conf["excludeFile"]=array("");

                        }#if end

                #初始化要回傳的變數
                $result["status"]="false";

                #函式說明:
                #取得目錄底下的詳細資訊.
                #回傳結果:
                #$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
                #$result["error"],錯誤訊息.
                #$result["function"],當前執行的函數名稱.
                #$result["size"],該清單的大小,單位為bytes.
                #$result["dataCount"],該清單的長度.
                #$result["content"],指定目錄底下的所有檔案資訊.
                #$result["content"][$i]["nType&permission"],第$i個節點類型、權限.
                #$result["content"][$i]["nType"],第$i個節點類型,"-"代表檔案,"d"代表資料夾.
                #$result["content"][$i]["permission"],第$i個節點權限.
                #$result["content"][$i]["ownByUser"],第$i個節點擁有者賬號.
                #$result["content"][$i]["ownByGroup"],第$i個節點擁有者群組.
                #$result["content"][$i]["bytes"],第$i個節點大小.
                #$result["content"][$i]["date"],第$i個節點最後變更日期.
                #$result["content"][$i]["time"],第$i個節點最後異動時間.
                #$result["content"][$i]["timeDetail"],第$i個節點最後異動詳細時間.
                #$result["content"][$i]["timezone"],第$i個節點的時區.
                #$result["content"][$i]["name"],第$i個節點的名稱.
                #必填參數:
                #$conf["path"],字串,要檢視的路徑.
                $conf["fileAccess::ls"]["path"]=$conf["folderAddress"];
                #可省略參數:
                #無.
                #參考資料:
                #https://www.businessweekly.com.tw/careers/Blog/14307
                #備註:
                #清單要不包含 "."開頭 跟 "~" 開頭
                $ls=fileAccess::ls($conf["fileAccess::ls"]);
                unset($conf["fileAccess::ls"]);

                #如果執行失敗
                if($ls["status"]==="false"){
                
                        #設置執行失敗識別
                        $result["status"]="false";
                        
                        #設置執行失敗提示
                        $result["error"]=$ls;
                        
                        #回傳結果
                        return $result;
                        
                        }#if end

                #debug
                #var_dump(__FILE__,__LINE__,$ls);

                #初始化需要的清單
                $result["neededList"]=array();

                #針對清單中每個項目
                foreach($ls["content"] as $node){

                        #debug
                        #var_dump(__FILE__,__LINE__,$node["name"]);

                        #用 "." 分割節點名稱
                        #函式說明:
                        #將固定格式的字串分開,並回傳分開的結果.
                        #回傳結果:
                        #$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
                        #$result["error"],錯誤訊息陣列
                        #$result["function"],當前執行的函數名稱.
                        #$result["argu"],使用的參數.
                        #$result["oriStr"],要分割的原始字串內容
                        #$result["dataArray"],爲分割好字串的陣列內容,$result["dataArray"][$i]爲第($i+1)段的內容。
                        #$result["dataCounts"],爲總共分成幾段
                        #$result["found"],是否有在$conf["stringIn"]找到$conf["spiltSymbol"],"true"代表有找到,"false"代表沒有找到.
                        #必填參數:
                        #$conf["stringIn"],字串,要處理的字串.
                        $conf["stringProcess::spiltString"]["stringIn"]=$node["name"];
                        #$conf["spiltSymbol"],字串,爲以哪個符號作爲分割.
                        $conf["stringProcess::spiltString"]["spiltSymbol"]=".";
                        #可省略參數:
                        #$conf["allowEmptyStr"],是否允許分割出來空字串,預設為"false"不允許;"true"代表允許.
                        #$conf["allowEmptyStr"]="false";
                        #參考資料:
                        #無.
                        #備註:
                        #無.
                        $spiltString=stringProcess::spiltString($conf["stringProcess::spiltString"]);
                        unset($conf["stringProcess::spiltString"]);

                        #debug
                        #var_dump(__FILE__,__LINE__,$spiltString);

                        #如果執行失敗
                        if($spiltString["status"]=="false"){
                                
                                #設置執行失敗識別
                                $result["status"]="false";
                                
                                #設置執行失敗提示
                                $result["error"]=$spiltString["error"];
                                
                                #回傳結果
                                return $result;
                                
                                }#if end

                        #如果「.」後面有內容 
                        if($spiltString["dataCounts"]>1){

                                #debug
                                #var_dump($spiltStr);

                                #涵式說明:
                                #處理字串避免網頁出錯
                                #回傳的結果:
                                #$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
                                #$result["function"],當前執行的函數.
                                #$result["content"],爲處理好的字串.
                                #$result["error"],錯誤訊息陣列.
                                #$result["argu"],使用的參數. 
                                #必填參數:
                                $conf["stringProcess"]["correctCharacter"]["stringIn"]=$spiltString["dataArray"][$spiltString["dataCounts"]-1];#爲要處理的字串
                                #可省略的參數:
                                $conf["stringProcess"]["correctCharacter"]["selectedCharacter"]=array("\r","\n","\r\n","\n\r");#爲被選擇要處理的字串/字元,須爲陣列值。
                                        #若不設定則預設爲要將這些字串作替換("<" ">" ";" "=" "//" "'" "$" "%" "&" "|" "#" "/*" "*\/")。
                                #$conf["changeTo"]=array("","","","");#爲被選擇的字元要換成什麼字串/字元,須爲陣列值。若不設定,則預設爲更換成""(空字串)。
                                $correctCharacter=stringProcess::correctCharacter($conf["stringProcess"]["correctCharacter"]);
                                unset($conf["stringProcess"]["correctCharacter"]);
                                
                                #如果處理失敗
                                if($correctCharacter["status"]==="false"){
                                
                                        #設置執行失敗識別
                                        $result["status"]="false";
                                        
                                        #設置執行失敗提示
                                        $result["error"]=$correctCharacter;
                                        
                                        #回傳結果
                                        return $result;
                                
                                        }#if end
                                
                                #var_dump($spiltStr["dataArray"][$spiltStr["dataCounts"]-1]);
                                #var_dump($correctCharacter["content"]);
                                
                                #更新處理好的字串內容
                                $spiltString["dataArray"][$spiltString["dataCounts"]-1]=$correctCharacter["content"];

                                #對照其最後一個「.」後面的內容(副檔名)是否爲我們所需要的。
                                #函式說明:
                                #檢查一個數值是否與陣列裏面的元素相同
                                #回傳結果:
                                #$result["status"],"true"表示執行正確,"false"表示執行錯誤.
                                #$result["founded"],"true"表示有找到相同的,"false"表示沒有找到相同的.
                                #$result["error"],錯誤訊息
                                #$result["function"],當前執行的函數名稱
                                #$result["argv"],使用的參數
                                #$result["equalVarName"],相等的變數名稱或key.
                                #$result["equalVarValue"],相等的變數數值內容.
                                #必填參數:
                                $conf["search"]["getEqualVar"]["conditionElement"]=$spiltString["dataArray"][$spiltString["dataCounts"]-1];#條件元素,要等於的元素內容。
                                $conf["search"]["getEqualVar"]["compareElements"]=$conf["readFileType"];#要比對的陣列變數內容。
                                $compareResult=search::getEqualVar($conf["search"]["getEqualVar"]);
                                unset($conf["search"]["getEqualVar"]);

                                #如果執行失敗
                                if($compareResult["status"]==="false"){
                                
                                        #設置執行失敗識別
                                        $result["status"]="false";
                                        
                                        #設置執行失敗提示
                                        $result["error"]=$compareResult;
                                        
                                        #回傳結果
                                        return $result;
                                        
                                        }#if end

                                #如果有符合
                                if($compareResult["founded"]==="true"){

                                        #函式說明:
                                        #處理字串避免網頁出錯
                                        #回傳結果:
                                        #$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
                                        #$result["function"],當前執行的函數.
                                        #$result["content"],爲處理好的字串.
                                        #$result["error"],錯誤訊息陣列.
                                        #$result["argu"],使用的參數. 
                                        #必填參數:
                                        $conf["stringProcess"]["correctCharacter"]["stringIn"]=$spiltString["dataArray"][$spiltString["dataCounts"]-1];#爲要處理的字串
                                        #可省略的參數:
                                        $conf["stringProcess"]["correctCharacter"]["selectedCharacter"]=array("\r","\n","\r\n","\n\r");#爲被選擇要處理的字串/字元,須爲陣列值。
                                                #若不設定則預設爲要將這些字串作替換("<" ">" ";" "=" "//" "'" "$" "%" "&" "|" "#" "/*" "*\/")。
                                        #$conf["changeTo"]=array("","","","");#爲被選擇的字元要換成什麼字串/字元,須爲陣列值。若不設定,則預設爲更換成""(空字串)。
                                        $correctCharacter=stringProcess::correctCharacter($conf["stringProcess"]["correctCharacter"]);
                                        unset($conf["stringProcess"]["correctCharacter"]);

                                        #debug
                                        #var_dump(__FILE__,__LINE__,$correctCharacter);

                                        #如果檔案是要排除的
                                        if(in_array($correctCharacter["content"],$conf["excludeFile"])){
                                        
                                                #debug
                                                #var_dump(__FILE__,__LINE__,$correctCharacter["content"],$conf["excludeFile"]);
                                        
                                                #忽略之
                                                continue;
                                        
                                                }#if end
                                        
                                        #針對每個要排除的項目 
                                        foreach($conf["excludeFile"] as $excludeFile){
                                        
                                                #如果檔案名稱包含"*",且為第一個字
                                                if(strpos($excludeFile,"*")===0){
                                                
                                                        #取得要排除的關鍵字
                                                        $excludeFileKeyWord=substr($excludeFile,1);
                                                        
                                                        #檢查有無結尾一樣
                                                        #涵式說明:
                                                        #取得符合特定字首與字尾的字串
                                                        #回傳的結果:
                                                        #$result["status"],若爲"true"則代表執行正常;若爲"false"則代表執行失敗。
                                                        #$result["function"],當前執行的函數名稱.
                                                        #$result["error"],錯誤訊息陣列.
                                                        #$result["founded"],若為"true"則代表有找到符合字首條件的結果;若爲"false"則代表沒有找到。
                                                        #$result["returnString"],爲符合字首條件的字串內容。
                                                        #$result["argu"],使用的參數.
                                                        #必填參數:
                                                        #$conf["checkString"],字串,要檢查的字串.
                                                        $conf["search::getMeetConditionsString"]["checkString"]=$node["name"];
                                                        #可省略參數:
                                                        #$conf["frontWord"],字串,用來檢查字首應該要有什麼字串,預設不指定.
                                                        #$conf["frontWord"]="";
                                                        #$conf["tailWord"],字串,用來檢查字尾應該要有什麼字串,預設不指定.
                                                        $conf["search::getMeetConditionsString"]["tailWord"]=$excludeFileKeyWord;
                                                        #參考資料:
                                                        #str_spilt(),可以將字串依照字母分割成一個個陣列字串。
                                                        $getMeetConditionsString=search::getMeetConditionsString($conf["search::getMeetConditionsString"]);
                                                        unset($conf["search::getMeetConditionsString"]);
                                                
                                                        #如果執行失敗
                                                        if($getMeetConditionsString["status"]==="false"){
                                                        
                                                                #如果不是檔案名稱過短的錯誤
                                                                if($getMeetConditionsString["error"][0]!=="要尋找的字尾長度大於要檢查的字串長度"){
                                                        
                                                                        #設置執行失敗識別
                                                                        $result["status"]="false";
                                                                        
                                                                        #設置執行失敗提示
                                                                        $result["error"]=$getMeetConditionsString["error"];
                                                                        
                                                                        #回傳結果
                                                                        return $result;
                                                                        
                                                                        }#if end
                                                                        
                                                                #設置沒有找到結尾相同的
                                                                $getMeetConditionsString["founded"]="false";
                                                        
                                                                }#if end
                                                                                                                                                                                        
                                                        #如果結尾相同
                                                        if($getMeetConditionsString["founded"]==="true"){
                                                                                                                
                                                                #跳過該檔案
                                                                continue 2;
                                                        
                                                                }#if end
                                                
                                                        }#if end
                                        
                                                }#foreach end

                                        #debug
                                        #var_dump(__FILE__,__LINE__,$node["name"]);

                                        #只接受檔案(排除軟連結、資料夾)
                                        if($node["nType"]==='-'){
                                        
                                                #將該檔案項目取出
                                                $result["neededList"][]=$node["name"];
                                        
                                                #將是否有符合條件的檔案的識別設爲 "true"
                                                $result["status"]="true";
                                        
                                                }#if end
                                                
                                        }#if end
                
                                }#if end

                        }#foreach end

                #取得總共有幾個檔案是我們要的
                $result["dataCount"]=count($result["neededList"]);

                #回傳結果
                return $result;

                }#function getLibFileContent end

        /*
        #函式說明:
        #取得php函式庫檔案裡面的結構.
        #回傳結果:
        #$result["status"],"true"表示取得成功;"false"表示取得失敗.
        #$result["error"],錯誤訊息.
        #$result["function"],當前執行的函數名稱.
        #$result["namesapceCount"],命名空間的筆數.
        #$result["classCount"],類別的筆數.
        #$result["functionsCount"],函式的筆數.
        #$result["namespace"],命名空間名稱的陣列,每個元素有"lineNo"記錄所在行數與"content"記錄名稱.
        #$result["commentForNamespace"],每個命令空間對應的註解.
        #$result["class"],類別的陣列,每個元素有"lineNo"記錄所在行數與"content"記錄名稱與"namespace"記錄所屬的命名空間名稱.
        #$result["commentForClass"],每個類別對應的註解.
        #$result["functions"],函式名稱資訊的陣列,每個元素有"namespace"記錄所屬的命名空間與"class"記錄所屬的類別名稱與"content"記錄名稱.
        #必填參數:
        #$conf["libFileAddress"]=,字串,要讀取的函式庫檔案位置
        $conf["libFileAddress"]=".php";
        #$conf["fileArgu"],字串,__FILE__的內容.
        $conf["fileArgu"]=__FILE__;
        #可省略參數:
        #$conf["web"],字串,"true"代表檔案是放在web環境;"false"是代表在檔案系統環境,預設為"false".
        #$conf["web"]="true";
        #參考資料:
        #無.
        #備註:
        #無.
        */
        public static function getPhpLibConstruction(&$conf){

                #初始化要回傳的內容
                $result=array();

                #取得當前函數的名稱
                $result["function"]=__FUNCTION__;

                #如果 $conf 不為陣列
                if(gettype($conf)!="array"){
                        
                        #設置執行失敗
                        $result["status"]="false";
                        
                        #設置執行錯誤訊息
                        $result["error"][]="\$conf變數須為陣列形態";

                        #如果傳入的參數為 null
                        if($conf==null){
                                
                                #設置執行錯誤訊息
                                $result["error"][]="\$conf變數不得為null,請檢查函數「".$result["function"]."」的參數設置有無正確!";
                                
                                }#if end

                        #回傳結果
                        return $result;
                        
                        }#if end

                #函式說明:
                #檢查必填與可省略的參數,可省略參數可指定預設要給與什麼數值內容。
                #$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
                #$reuslt["error"],執行不正常結束的錯訊息陣列.
                #$result["function"],當前執行的函式名稱.
                #$result["argu"],設置給予的參數.
                #$result["passed"],識別要檢查的全體變數是否存在以及型態是否正確的變數,"true"代表檢查全部通過;"false"代表檢查不通過
                #$result[$shouldBeCheckedVarName]["varExist"],所檢查的變數是否存在,"false"代表不存在;"true"代表存在
                #$result[$shouldBeCheckedVarName]["varType"],所檢查的變數型態是否正確,"false"代表錯誤;"true"代表正確
                #$result[$shouldBeCheckedVarName]["error"],每個參數設定的錯誤訊息
                #$result["shouldNotBeEmpty"],不應該為空字串或控陣列的變數.
                #$result["argu"],字串陣列,目前輸入的參數名稱陣列.
                #$result["legalVarName"],字串陣列,合法可用的參數名稱陣列.
                #$result["notNeedVar"],字串陣列,多餘的參數名稱.
                #必填寫的參數:
                #$conf["varInput"],陣列變數,要檢查的陣列變數,請在要檢查的參數前面加上&,這樣變動的結果才能被套用。
                $conf["variable::checkArguments"]["varInput"]=&$conf;
                #$conf["referenceVarKey"],字串,$conf參數後面的key值,用於移除不要的參考陣列.
                $conf["variable::checkArguments"]["referenceVarKey"]="variable::checkArguments";
                #可以省略的參數:
                #$conf["mustBeFilledVariableName"],爲必填參數的變數名稱陣列,形態爲陣列變數,元素數量需要跟"mustBeFilledVariableType"參數的元素數量一致,例如: $conf["mustBeFilledVariableName"] = array("id","account","password");
                $conf["variable::checkArguments"]["mustBeFilledVariableName"]=array("libFileAddress","fileArgu");
                #$conf["mustBeFilledVariableType"],爲必填參數的變數陣列應該爲何種變數形態,形態爲陣列,元素數量需要跟"mustBeFilledVariableName"參數的元素數量一致,例如: $conf["mustBeFilledVariableType"] = array("string",integer,"double","resource","object"); , null代表不指定變數形態.
                $conf["variable::checkArguments"]["mustBeFilledVariableType"]=array("string","string");
                #$conf["canBeEmptyString"],字串,必填變數內容如果是空字串就不能算是有設置的話,請設為"false",預設爲"true",可以為空字串.
                #$conf["canBeEmptyString"]="false";
                #$conf["canNotBeEmpty"],字串陣列,哪些必填參數的內容不得為空字串或空陣列,僅當$conf["canBeEmptyString"]為"true"時會生效.
                #$conf["canNotBeEmpty"]=array();
                #$conf["canBeEmpty"],字串陣列,哪些必填參數的內容可為空字串或空陣列,僅當$conf["canBeEmptyString"]為"false"時會生效.
                #$conf["canBeEmpty"]=array();
                #$conf["skipableVariableCanNotBeEmpty"],字串陣列,哪些可省略參數不可以為空字串或空陣列.
                #$conf["skipableVariableCanNotBeEmpty"]=array();
                #$conf["skipableVariableName"],陣列字串,爲可省略參數的變數名稱陣列,形態爲陣列變數,例如: $conf["skipableVariableName"] = array("id","account","password");
                $conf["variable::checkArguments"]["skipableVariableName"]=array("web");
                #$conf["skipableVariableType"],陣列字串,爲可省略參數的變數名稱陣列,形態爲陣列變數,例如: $conf["skipableVariableType"] = array("string",integer,"double");
                $conf["variable::checkArguments"]["skipableVariableType"]=array("string");
                #$conf["skipableVarDefaultValue"],字串陣列,每個不存在的可省略變數要初始化為什麼,null與代表不指定,若預設值是參數之一,請將$conf["mustBeFilledVar"]改成"\$conf["\mustBeFilledVar\"]".
                $conf["variable::checkArguments"]["skipableVarDefaultValue"]=array("false");
                #$conf["disallowAllSkipableVarIsEmpty"],字串,是否允許每個可省略參數都為空字串,預設為"true"允許,反之為"false".
                #$conf["disallowAllSkipableVarIsEmpty"]="";
                #$conf["disallowAllSkipableVarIsEmptyArray"],字串,是否允許每個可省略參數都為空陣列,預設為"true"允許,反之為"false".
                #$conf["disallowAllSkipableVarIsEmptyArray"]="";
                #$conf["arrayCountEqualCheck"],字串陣列,為檢查哪些陣列參數的元素數量要一樣,$conf["arrayCountEqualCheck"][$i]=array()為第$i組key為哪些的變數其元素數量要相等.
                #$conf["arrayCountEqualCheck"][]=array();
                #參考資料來源:
                #array_keys=>http://php.net/manual/en/function.array-keys.php
                $checkArguments=variableCheck::checkArguments($conf["variable::checkArguments"]);
                unset($conf["variable::checkArguments"]);

                # 如果檢查出錯
                if($checkArguments["status"]=="false"){
                        
                        #設置執行錯誤的識別
                        $result["status"]="fasle";

                        #設置執行錯誤的訊息
                        $result["error"]=$checkArguments;
                        
                        #回傳結果
                        return $result;
                        
                        }#if end

                # 如果檢查不通過
                if($checkArguments["passed"]=="false"){
                        
                        #設置執行錯誤的識別
                        $result["status"]="fasle";

                        #設置執行錯誤的訊息
                        $result["error"]=$checkArguments;
                        
                        #回傳結果
                        return $result;
                        
                        }#if end

                #函數說明:
                #將檔案的位置名稱變成網址,也可以取得檔案位於伺服器上檔案系統的絕對位置.
                #回傳結果:
                #$result["status"],"true"爲建立成功,"false"爲建立失敗.
                #$result["error"],錯誤訊息陣列.
                #$result["function"],函數名稱. 
                #$result["argu"],使用的參數.
                #$result["content"],網址,若是在命令列執行,則為"null".
                #$result["webPathFromRoot"],相對於網頁根目錄的路徑.
                #$result["fileSystemAbsoulutePosition"],針對伺服器端的絕對位置,亦即從網頁「document_root」目錄開始的路徑.
                #必填參數:
                #$conf["address"],字串,檔案的相對位置,若為絕對位置則會自動轉換成相對位置.
                $conf["fileAccess::getInternetAddressV2"]["address"]=$conf["libFileAddress"];
                #$conf["fileArgu"],字串,php變數__FILE__的內容,亦即該檔案在檔案系統的絕對路徑.
                $conf["fileAccess::getInternetAddressV2"]["fileArgu"]=$conf["fileArgu"];
                #可省略參數:
                #$conf["web"],字串,"true"代表檔案是放在web環境;"false"是代表在檔案系統環境,預設為"true".
                $conf["fileAccess::getInternetAddressV2"]["web"]=$conf["web"];
                #備註:
                #建構中,fileSystemRelativePosition尚未實作,檢查參數尚未實作.
                $getInternetAddressV2=fileAccess::getInternetAddressV2($conf["fileAccess::getInternetAddressV2"]);
                unset($conf["fileAccess::getInternetAddressV2"]);

                #如果取得網路位置出錯
                if($getInternetAddressV2["status"]=="false"){
                        
                        #設置執行錯誤的識別
                        $result["status"]="fasle";

                        #設置執行錯誤的訊息
                        $result["error"]=$checkArguments;
                        
                        #回傳結果
                        return $result;
                        
                        }#if end

                #取得檔案系統位置
                $conf["libFileAddress"]=$getInternetAddressV2["fileSystemAbsoulutePosition"];

                #函式說明:
                #依據行號分隔抓取檔案的內容,結果會回傳一個陣列
                #回傳的變數說明:
                #$result["status"],執行是否成功,"true"代表成功;"fasle"代表失敗。
                #$result["error"],錯誤訊息提示
                #$result["fileContent"],爲檔案的內容陣列
                #$result["lineCount"],爲檔案內容總共的行數
                #必填參數:
                $conf["fileAccess::getFileContent"]["filePositionAndName"]=$conf["libFileAddress"];#爲檔案的位置以及名稱
                $conf["fileAccess::getFileContent"]["fileArgu"]=$conf["fileArgu"];
                #可省略參數:
                #$conf["web"],是要取得網路上的檔案則為"true";反之則為"false".
                $conf["fileAccess::getFileContent"]["web"]="false";
                #參考資料:
                #file():取得檔案內容的行數
                #http://php.net/manual/en/function.file.php
                $fileContent=fileAccess::getFileContent($conf["fileAccess::getFileContent"]);
                unset($conf["fileAccess::getFileContent"]);

                #如果 檔案取得失敗
                if($fileContent["status"]=="false"){
                        
                        #設置執行失敗的識別
                        $result["status"]="false";
                        
                        #設置錯誤訊息
                        $result["error"]=$fileContent["error"];
                        
                        return $result;
                        
                        }#if end

                #根據 $fileContent 來尋找總共有幾個命名空間
                #函式說明:
                #檢查一個字串裡面是否有多個關鍵字
                #回傳的結果:
                #$result["status"],整體來說,執行是否成功,"true"代表執行成功,"false"代表執行失敗。
                #$result[$i]["status"],第$i個字串搜尋是否成功,"true"代表執行成功,"false"代表執行失敗。
                #$result[$i]["error"],第$i個字串搜尋的錯誤訊息陣列
                #$result[$i]["founded"],第$i個字串搜尋,是否找到所有的關鍵字,"true"代表有找到關鍵字;"false"代表沒有找到關鍵字。
                #$result["foundedTrueKey"],["founded"]結果為"true"的元素key陣列。
                #$result["foundedFalseKey"],["founded"]結果為"false"的元素key陣列。
                #必填參數:
                $conf["search"]["findManyKeyWordsFromManyString"]["keyWords"]=array("namespace");#想要搜尋的關鍵字
                $conf["search"]["findManyKeyWordsFromManyString"]["stringArray"]=$fileContent["fileContent"];#要被搜尋的字串內容陣列         
                #可省略的參數:
                #$conf["search"]["findManyKeyWordsFromManyString"]["completeEqual"]="true";#是否內容要完全符合,不能多出任何不符合的內容,預設為不需要完全符合。
                $foundedNamespaceStrArray=search::findManyKeyWordsFromManyString($conf["search"]["findManyKeyWordsFromManyString"]);
                unset($conf["search"]["findManyKeyWordsFromManyString"]);

                #針對每個找到"namespace"的行編號
                foreach($foundedNamespaceStrArray["foundedTrueKey"] as $lineNo => $value){
                        
                        #確認該行是否為命名空間的宣告行
                        #函式說明:
                        #檢查一個字串裡面是否沒有多個任何篩選字存在
                        #回傳的結果:
                        #$result["status"],執行是否成功的識別,"true"為執行成功;"false"為執行失敗
                        #$result["error"],錯誤訊息陣列                    
                        #$result["filtered"],該字串是否為要過濾掉的,"true"為要過濾掉的;"false"為不用過濾掉的
                        #必填參數:
                        $conf["search"]["filterString"]["inputStr"]=$value;#要過濾的字串
                        $conf["search"]["filterString"]["filterWord"]=array("#","=","}","unset(","foreach(","var_dump(");#要過濾的字串不能含有該陣列元素之一
                        $searchResult=search::filterString($conf["search"]["filterString"]);
                        unset($conf["search"]["filterString"]);
                        
                        #如果 $searchResult["filtered"] 等於 "fasle"
                        if($searchResult["filtered"]=="false"){
                                
                                #代表是命名空間宣告的行
                                
                                #取得命名空間宣告的行
                                $namespaceStr=$value;
                                
                                #函式說明:
                                #處理字串避免網頁出錯
                                #回傳的結果:
                                #回傳結果:
                                #$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
                                #$result["function"],當前執行的函數.
                                #$result["content"],爲處理好的字串.
                                #$result["error"],錯誤訊息陣列.
                                #$result["argu"],使用的參數. 
                                #必填參數:
                                $conf["stringProcess"]["correctCharacter"]["stringIn"]=$namespaceStr;#爲要處理的字串
                                #可省略的參數:
                                $conf["stringProcess"]["correctCharacter"]["selectedCharacter"]=array(" ","{","namespace","\n","\t",";");#爲被選擇要處理的字串/字元,須爲陣列值。
                                        #若不設定則預設爲要將這些字串作替換("<",">",";","=","//","'","$","%","&","|","/*","*\/","#")。
                                #$conf["changeTo"]=array();#爲被選擇的字元要換成什麼字串/字元,須爲陣列值。若不設定,則預設爲更換成""(空字串)。
                                $correctCharacter=stringProcess::correctCharacter($conf["stringProcess"]["correctCharacter"]);
                                unset($conf["stringProcess"]["correctCharacter"]);
                                
                                #如果執行失敗
                                if($correctCharacter["status"]==="false"){
                                
                                        #設置執行失敗的識別
                                        $result["status"]="false";
                                        
                                        #設置錯誤訊息
                                        $result["error"]=$correctCharacter["error"];
                                        
                                        return $result;
                                
                                        }#if end
                                
                                #記錄取得的命名空間所在行數與名稱
                                $result["namespace"][]=array("lineNo"=>$lineNo,"content"=>$correctCharacter["content"]);
                                
                                # 從 namespace 往前讀取對應的註解
                                for($i=$lineNo-1;$i>0;$i--){
                                
                                        #初始化 $temp
                                        $temp=$fileContent["fileContent"][$i];
                                
                                        #如果該行內容不為空
                                        if(!empty($fileContent["fileContent"][$i])){
                                        
                                                #函式說明:
                                                #處理字串避免網頁出錯
                                                #回傳的結果:
                                                #$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
                                                #$result["function"],當前執行的函數.
                                                #$result["content"],爲處理好的字串.
                                                #$result["error"],錯誤訊息陣列.
                                                #$result["argu"],使用的參數. 
                                                #必填參數:
                                                $conf["stringProcess"]["correctCharacter"]["stringIn"]=$fileContent["fileContent"][$i];#爲要處理的字串
                                                #可省略的參數:
                                                $conf["stringProcess"]["correctCharacter"]["selectedCharacter"]=array("\n");#爲被選擇要處理的字串/字元,須爲陣列值。
                                                        #若不設定則預設爲要將這些字串作替換("<",">",";","=","//","'","$","%","&","|","/*","*\/","#")。
                                                #$conf["changeTo"]=array();#爲被選擇的字元要換成什麼字串/字元,須爲陣列值。若不設定,則預設爲更換成""(空字串)。
                                                $correctCharacter=stringProcess::correctCharacter($conf["stringProcess"]["correctCharacter"]);
                                                unset($conf["stringProcess"]["correctCharacter"]);
                                                
                                                #如果處理失敗
                                                if($correctCharacter["status"]==="false"){

                                                        #設置執行錯誤的識別
                                                        $result["status"]="false";

                                                        #設置執行錯誤的訊息
                                                        $result["error"]=$correctCharacter;
                                                        
                                                        #回傳結果
                                                        return $result;
                                                
                                                        }#if end
                                                
                                                #取得處理好的內容列
                                                $temp=$correctCharacter["content"];
                                        
                                                }#if end
                                
                                        #如果 $temp 為 「/*」
                                        if($temp==="/*"){
                                                                        
                                                #跳出for迴圈
                                                break;
                                        
                                                }#if end
                                                
                                        #如果 $temp 為 「*/」 
                                        if($temp==="*/"){
                                                                        
                                                #跳到下一輪
                                                continue;
                                                                                
                                                }#if end
                                                
                                        #記錄namesapce的註解內容
                                        $result["commentForNamespace"][count($result["namespace"])-1][]=$temp;
                                
                                        }#for end
                                        
                                #函式說明:
                                #將陣列倒置
                                #回傳的結果:
                                #$result["status"],執行是否成功,"true"為執行成功;"false"為執行失敗
                                #$result["error"],錯誤訊息陣列
                                #$result["convertArray"],轉置後的陣列內容
                                #必填參數:
                                $conf["arrays"]["convertArray"]["inputArray"]=$result["commentForNamespace"][count($result["namespace"])-1];#要倒置的陣列
                                #參考資料來源:
                                #http://tw2.php.net/array_reverse => 陣列倒置的內建函式
                                $convertResult=arrays::convertArray($conf["arrays"]["convertArray"]);
                                unset($conf["arrays"]["convertArray"]);
                                        
                                #如果轉置失敗
                                if($convertResult["status"]=="false"){
                                        
                                        #設置執行失敗的識別
                                        $result["status"]="false";
                                        
                                        #設置執行失敗的提示
                                        $result["error"]=$convertResult;
                                        
                                        #回傳結果
                                        return $result;
                                        
                                        }#if end        
                                        
                                #反之代表執行成功
                                else{
                                        
                                        #將倒置後的元素存起來
                                        $result["commentForNamespace"][count($result["namespace"])-1]=$convertResult["convertArray"];
                                        
                                        }#else  
                                
                                }#if end
                                
                        }#foreach end
                
                #根據 $fileContent 來尋找總共有幾個類別
                #函式說明:
                #檢查一個字串裡面是否有多個關鍵字
                #回傳的結果:
                #$result["status"],整體來說,執行是否成功,"true"代表執行成功,"false"代表執行失敗。
                #$result[$i]["status"],第$i個字串搜尋是否成功,"true"代表執行成功,"false"代表執行失敗。
                #$result[$i]["error"],第$i個字串搜尋的錯誤訊息陣列
                #$result[$i]["founded"],第$i個字串搜尋,是否找到所有的關鍵字,"true"代表有找到關鍵字;"false"代表沒有找到關鍵字。
                #$result["foundedTrueKey"],["founded"]結果為"true"的元素key陣列。
                #$result["foundedFalseKey"],["founded"]結果為"false"的元素key陣列。
                #必填參數:
                $conf["search"]["findManyKeyWordsFromManyString"]["keyWords"]=array("class");#想要搜尋的關鍵字
                $conf["search"]["findManyKeyWordsFromManyString"]["stringArray"]=$fileContent["fileContent"];#要被搜尋的字串內容陣列
                #可省略的參數:
                #$conf["search"]["findManyKeyWordsFromManyString"]["completeEqual"]="true";#是否內容要完全符合,不能多出任何不符合的內容,預設為不需要完全符合。
                $foundedClassStrArray=search::findManyKeyWordsFromManyString($conf["search"]["findManyKeyWordsFromManyString"]);
                unset($conf["search"]["findManyKeyWordsFromManyString"]);
                
                #debug
                #var_dump($foundedClassStrArray["foundedTrueKey"]);
                #exit;
                
                #針對每個找到"class"的行編號
                foreach($foundedClassStrArray["foundedTrueKey"] as $lineNo => $value){
                        
                        #確認該行是否真的為類別宣告行。
                        #函式說明:
                        #檢查一個字串裡面是否沒有多個任何篩選字存在
                        #回傳的結果:
                        #$result["status"],執行是否成功的識別,"true"為執行成功;"false"為執行失敗
                        #$result["error"],錯誤訊息陣列                    
                        #$result["filtered"],該字串是否為要過濾掉的,"true"為要過濾掉的;"false"為不用過濾掉的
                        #必填參數:
                        $conf["search"]["filterString"]["inputStr"]=$value;#要過濾的字串
                        $conf["search"]["filterString"]["filterWord"]=array("#","=","}","unset(","foreach(","var_dump(",";","(",")"," implements ");#要過濾的字串不能含有該陣列元素之一
                        $searchResult=search::filterString($conf["search"]["filterString"]);
                        unset($conf["search"]["filterString"]);
                                                
                        #如果 $searchResult["filtered"] 等於 "fasle"
                        if($searchResult["filtered"]=="false"){
                        
                                #代表是類別宣告的行
                                
                                #取得類別宣告的行
                                $classStr=$value;
                                
                                #函式說明:
                                #處理字串避免網頁出錯
                                #回傳的結果:
                                #$result,爲處理好的字串。
                                #必填參數:
                                $conf["stringProcess"]["correctCharacter"]["stringIn"]=$classStr;#爲要處理的字串
                                #可省略的參數:
                                $conf["stringProcess"]["correctCharacter"]["selectedCharacter"]=array(" ","{","class","\n","\t");#爲被選擇要處理的字串/字元,須爲陣列值。
                                        #若不設定則預設爲要將這些字串作替換("<",">",";","=","//","'","$","%","&","|","/*","*\/","#")。
                                #$conf["changeTo"]=array();#爲被選擇的字元要換成什麼字串/字元,須爲陣列值。若不設定,則預設爲更換成""(空字串)。
                                $correctCharacter=stringProcess::correctCharacter($conf["stringProcess"]["correctCharacter"]);
                                unset($conf["stringProcess"]["correctCharacter"]);
                                
                                #如果執行失敗
                                if($correctCharacter["status"]==="false"){
                                
                                        #設置執行失敗的識別
                                        $result["status"]="false";
                                        
                                        #設置錯誤訊息
                                        $result["error"]=$correctCharacter["error"];
                                        
                                        return $result;
                                
                                        }#if end
                                
                                #針對每個命名空間
                                foreach($result["namespace"] as $nsArray){
                                
                                        #如果該類別的行數是在該namespace之後
                                        if($lineNo>$nsArray["lineNo"]){
                                        
                                                #設定該類別所屬的命名空間
                                                $namespace=$nsArray["content"];
                                        
                                                }#if end
                                                
                                        #反之
                                        else{
                                        
                                                #跳出foreach
                                                break;
                                        
                                                }#else end
                                
                                        }#foreach end
                                
                                #記錄取得的類別所在行數與名稱
                                $result["class"][]=array("lineNo"=>$lineNo,"content"=>$correctCharacter["content"],"namespace"=>$namespace);
                                                                
                                # 從 class 往前讀取對應的註解
                                for($i=$lineNo-1;$i>0;$i--){
                                
                                        #初始化 $temp
                                        $temp=$fileContent["fileContent"][$i];
                                
                                        #如果該行內容不為空
                                        if(!empty($fileContent["fileContent"][$i])){
                                        
                                                #函式說明:
                                                #處理字串避免網頁出錯
                                                #回傳的結果:
                                                #$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
                                                #$result["function"],當前執行的函數.
                                                #$result["content"],爲處理好的字串.
                                                #$result["error"],錯誤訊息陣列.
                                                #$result["argu"],使用的參數. 
                                                #必填參數:
                                                $conf["stringProcess"]["correctCharacter"]["stringIn"]=$fileContent["fileContent"][$i];#爲要處理的字串
                                                #可省略的參數:
                                                $conf["stringProcess"]["correctCharacter"]["selectedCharacter"]=array(" ","\n","\t");#爲被選擇要處理的字串/字元,須爲陣列值。
                                                        #若不設定則預設爲要將這些字串作替換("<",">",";","=","//","'","$","%","&","|","/*","*\/","#")。
                                                #$conf["changeTo"]=array();#爲被選擇的字元要換成什麼字串/字元,須爲陣列值。若不設定,則預設爲更換成""(空字串)。
                                                $correctCharacter=stringProcess::correctCharacter($conf["stringProcess"]["correctCharacter"]);
                                                unset($conf["stringProcess"]["correctCharacter"]);
                                                
                                                #如果處理失敗
                                                if($correctCharacter["status"]==="false"){

                                                        #設置執行錯誤的識別
                                                        $result["status"]="false";

                                                        #設置執行錯誤的訊息
                                                        $result["error"]=$correctCharacter;
                                                        
                                                        #回傳結果
                                                        return $result;
                                                
                                                        }#if end
                                                
                                                #取得處理好的內容列
                                                $temp=$correctCharacter["content"];
                                        
                                                }#if end

                                        #如果 $temp 為 「/*」
                                        if($temp==="/*"){
                                                                        
                                                #跳出for迴圈
                                                break;
                                        
                                                }#if end
                                                
                                        #如果 $temp 為 「*/」 
                                        if($temp==="*/"){
                                                                        
                                                #跳到下一輪
                                                continue;
                                                                                
                                                }#if end
                                                
                                        #記錄namesapce的註解內容
                                        $result["commentForClass"][count($result["class"])-1][]=$temp;
                                
                                        }#for end
                                
                                #函式說明:
                                #將陣列倒置
                                #回傳的結果:
                                #$result["status"],執行是否成功,"true"為執行成功;"false"為執行失敗
                                #$result["error"],錯誤訊息陣列
                                #$result["convertArray"],轉置後的陣列內容
                                #必填參數:
                                $conf["arrays"]["convertArray"]["inputArray"]=$result["commentForClass"][count($result["class"])-1];#要倒置的陣列
                                #參考資料來源:
                                #http://tw2.php.net/array_reverse => 陣列倒置的內建函式
                                $convertResult=arrays::convertArray($conf["arrays"]["convertArray"]);
                                unset($conf["arrays"]["convertArray"]);
                                        
                                #如果轉置失敗
                                if($convertResult["status"]=="false"){
                                        
                                        #設置執行失敗的識別
                                        $result["status"]="false";
                                        
                                        #設置執行失敗的提示
                                        $result["error"]=$convertResult;
                                        
                                        #回傳結果
                                        return $result;
                                        
                                        }#if end        
                                        
                                #反之代表執行成功
                                else{
                                        
                                        #將倒置後的元素存起來
                                        $result["commentForClass"][count($result["class"])-1]=$convertResult["convertArray"];
                                        
                                        }#else  
                                
                                }#if end
                                
                        }#foreach end
                
                #針對每個要處理的命名空間註解陣列
                foreach($result["commentForNamespace"] as $index => $cfn){
                
                        #函式說明:
                        #將一維陣列轉換為用特定符號間隔的字串,ex:array("1","2","3") to "a;b;c;".
                        #回傳的結果:
                        #$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
                        #$result["function"],當前執行的function名稱
                        #$result["error"],錯誤訊息陣列.
                        #$result["content"],處理好的字串.
                        #$result["argu"],使用的參數.
                        #必填參數:
                        #$conf["inputArray"],字串陣列,要轉成字串的一維陣列.
                        $conf["arrays::arrayToString"]["inputArray"]=$cfn;
                        #可省略參數:
                        #$conf["spiltSymbol"],字串,用來區隔字串的符號,預設為;
                        $conf["arrays::arrayToString"]["spiltSymbol"]=PHP_EOL;
                        #$conf["skipEnd"],字串,結尾是否不要加上符號,預設為"false",要加上符號,"true"代表不要加上符號。
                        $conf["arrays::arrayToString"]["skipEnd"]="true";
                        #參考資料:
                        #無.
                        #備註:
                        #無.
                        $arrayToString=arrays::arrayToString($conf["arrays::arrayToString"]);
                        unset($conf["arrays::arrayToString"]);
                        
                        #如果執行失敗
                        if($arrayToString["status"]==="false"){
                                
                                #設定執行錯誤識別
                                $result["status"]="false";
                                
                                #設定執行錯誤提示
                                $result["error"]=$arrayToString;
                                
                                #回傳結果 
                                return $result;
                                
                                }#if end

                        #轉存為字串
                        $result["commentForNamespace"][$index]=$arrayToString["content"];
                
                        }#foreach end
                
                #針對每個要處理的類別註解陣列
                foreach($result["commentForClass"] as $index => $cfc){

                        #函式說明:
                        #將一維陣列轉換為用特定符號間隔的字串,ex:array("1","2","3") to "a;b;c;".
                        #回傳的結果:
                        #$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
                        #$result["function"],當前執行的function名稱
                        #$result["error"],錯誤訊息陣列.
                        #$result["content"],處理好的字串.
                        #$result["argu"],使用的參數.
                        #必填參數:
                        #$conf["inputArray"],字串陣列,要轉成字串的一維陣列.
                        $conf["arrays::arrayToString"]["inputArray"]=$cfc;
                        #可省略參數:
                        #$conf["spiltSymbol"],字串,用來區隔字串的符號,預設為;
                        $conf["arrays::arrayToString"]["spiltSymbol"]=PHP_EOL;
                        #$conf["skipEnd"],字串,結尾是否不要加上符號,預設為"false",要加上符號,"true"代表不要加上符號。
                        $conf["arrays::arrayToString"]["skipEnd"]="true";
                        #參考資料:
                        #無.
                        #備註:
                        #無.
                        $arrayToString=arrays::arrayToString($conf["arrays::arrayToString"]);
                        unset($conf["arrays::arrayToString"]);

                        #如果執行失敗
                        if($arrayToString["status"]==="false"){
                                
                                #設定執行錯誤識別
                                $result["status"]="false";
                                
                                #設定執行錯誤提示
                                $result["error"]=$arrayToString;
                                
                                #回傳結果 
                                return $result;
                                
                                }#if end

                        #轉存為字串
                        $result["commentForClass"][$index]=$arrayToString["content"];   
                
                        }#foreach end

                #根據 $fileContent 來尋找總共有幾個 function
                #函式說明:
                #檢查一個字串裡面是否有多個關鍵字
                #回傳的結果:
                #$result["status"],整體來說,執行是否成功,"true"代表執行成功,"false"代表執行失敗。
                #$result[$i]["status"],第$i個字串搜尋是否成功,"true"代表執行成功,"false"代表執行失敗。
                #$result[$i]["error"],第$i個字串搜尋的錯誤訊息陣列
                #$result[$i]["founded"],第$i個字串搜尋,是否找到所有的關鍵字,"true"代表有找到關鍵字;"false"代表沒有找到關鍵字。
                #$result["foundedTrueKey"],["founded"]結果為"true"的元素key陣列。
                #$result["foundedFalseKey"],["founded"]結果為"false"的元素key陣列。
                #必填參數:
                $conf["search"]["findManyKeyWordsFromManyString"]["keyWords"]=array("public static function");#想要搜尋的關鍵字
                $conf["search"]["findManyKeyWordsFromManyString"]["stringArray"]=$fileContent["fileContent"];#要被搜尋的字串內容陣列
                #可省略的參數:
                #$conf["search"]["findManyKeyWordsFromManyString"]["completeEqual"]="true";#是否內容要完全符合,不能多出任何不符合的內容,預設為不需要完全符合。
                $foundedFunctionStrArray=search::findManyKeyWordsFromManyString($conf["search"]["findManyKeyWordsFromManyString"]);
                unset($conf["search"]["findManyKeyWordsFromManyString"]);
                
                #針對每個找到"function"的行編號
                foreach($foundedFunctionStrArray["foundedTrueKey"] as $keyNo=>$keyContent){
                        
                        #確認該行是否真的為函式宣告行。
                        #函式說明:
                        #檢查一個字串裡面是否沒有多個任何篩選字存在
                        #回傳的結果:
                        #$result["status"],執行是否成功的識別,"true"為執行成功;"false"為執行失敗
                        #$result["error"],錯誤訊息陣列                    
                        #$result["filtered"],該字串是否為要過濾掉的,"true"為要過濾掉的;"false"為不用過濾掉的
                        #必填參數:
                        $conf["search"]["filterString"]["inputStr"]=$keyContent;#要過濾的字串
                        $conf["search"]["filterString"]["filterWord"]=array("__call","__callStatic","#","=","}","unset(","foreach(","var_dump(",";","(function","ckeditor.on","-",".","/","!",":",",","onResponseresponse(");#要過濾的字串不能含有該陣列元素之一
                        $searchResult=search::filterString($conf["search"]["filterString"]);
                        unset($conf["search"]["filterString"]);
                                                
                        #如果 $searchResult["filtered"] 等於 "fasle"
                        if($searchResult["filtered"]==="false"){
                                
                                #代表是宣告函式的行
                                
                                #取得類宣告函式的行
                                $functionStr=$keyContent;
                                
                                #函式說明:
                                #處理字串避免網頁出錯
                                #回傳的結果:
                                #$result,爲處理好的字串。
                                #必填參數:
                                $conf["stringProcess"]["correctCharacter"]["stringIn"]=$functionStr;#爲要處理的字串
                                #可省略的參數:
                                $conf["stringProcess"]["correctCharacter"]["selectedCharacter"]=array(",&\$argu","public static"," ","{","function","\$conf","(",")","&","\n","\t");#爲被選擇要處理的字串/字元,須爲陣列值。
                                        #若不設定則預設爲要將這些字串作替換("<",">",";","=","//","'","$","%","&","|","/*","*\/","#")。
                                #$conf["changeTo"]=array();#爲被選擇的字元要換成什麼字串/字元,須爲陣列值。若不設定,則預設爲更換成""(空字串)。
                                $correctCharacter=stringProcess::correctCharacter($conf["stringProcess"]["correctCharacter"]);
                                unset($conf["stringProcess"]["correctCharacter"]);
                                
                                #如果執行失敗
                                if($correctCharacter["status"]==="false"){
                                        
                                        #設定執行錯誤識別
                                        $result["status"]="false";
                                        
                                        #設定執行錯誤提示
                                        $result["error"]=$correctCharacter;
                                        
                                        #回傳結果 
                                        return $result;
                                        
                                        }#if end
                                
                                #針對每個命名空間
                                foreach($result["namespace"] as $ni){
                                
                                        #如果所在行數則在該命名空間之後
                                        if($keyNo > $ni["lineNo"]){
                                        
                                                #設置該函式所屬的命名空間名稱
                                                $namespaceOfFunc=$ni["content"];
                                        
                                                }#if end
                                        
                                        #反之
                                        else{
                                        
                                                #結束 foreach end
                                                break;
                                        
                                                }#else end
                                
                                        }#foreach end
                                
                                #針對每個類別名稱
                                foreach($result["class"] as $ci){
                                
                                        #如果所在行數則在該類別名稱之後
                                        if($keyNo > $ci["lineNo"]){
                                        
                                                #設置該函式所屬的類別名稱
                                                $classOfFunc=$ci["content"];
                                        
                                                }#if end
                                        
                                        #反之
                                        else{
                                        
                                                #結束 foreach end
                                                break;
                                        
                                                }#else end
                                
                                        }#foreach end
                                
                                #儲存函式的資訊
                                $result["functions"][]=array("content"=>$correctCharacter["content"],"namespace"=>$namespaceOfFunc,"class"=>$classOfFunc);
                                
                                }#if end
                                
                        }#foreach end
                        
                #取得命名空間的數量
                $result["namesapceCount"]=count($result["namespace"]);
                
                #如果 $result["class"] 不存在
                if(!isset($result["class"])){
                
                        #設置為空陣列
                        $result["class"]=array();
                
                        }#if end
                
                #取得類別的數量
                $result["classCount"]=count($result["class"]);

                #如果 $result["class"] 不存在
                if(!isset($result["functions"])){
                
                        #設置為空陣列
                        $result["functions"]=array();
                
                        }#if end

                #取得函式的數量
                $result["functionCount"]=count($result["functions"]);

                #值行到這邊執行成功
                $result["status"]="true";

                #回傳節果
                return $result;

                }#function getPhpLibContent end
                
        /*
        #函式說明:
        #取得函式的結構
        #回傳結果:
        #$result["status"],執行是否成功"true"代表執行成功,"false"代表執行失敗
        #$result["error"],錯誤訊息陣列
        #$result["function"],當前執行的函數名稱.
        #$result["functionComment"],函式的註解全文.
        #$result["content"],函式的程式內容字串.
        #$result["comment"],函式說明
        #$result["argvType"],傳入參數的型態,""表示不用參數
        #$result["returnVarType"],回傳的變數型態,目前尚無法判斷其型態為string、int、float、double、boolean的哪一個,所以先一律視為"string"
        #$result["return"]["name"],回傳的變數名稱
        #$result["return"]["comment"],回傳的變數註解
        #$result["mustBeFilled"]["dataCount"],不可省略的參數陣列元素數量 
        #$result["optionalFilled"]["dataCount"],可省略的參數陣列元素數量
        #$result["mustBeFilled"]["name"],不可省略的參數陣列
        #$result["mustBeFilled"]["comment"],不可省略的參數註解陣列
        #$result["optionalFilled"]["name"],可省略的參數陣列
        #$result["optionalFilled"]["comment"],可省略的參數註解陣列
        #$result["reference"]["addr"],參考資料的網址
        #$result["reference"]["comment"],參考資料的說明
        #必填參數:
        #$conf["phpFileAddress"],字串,含有函式內容的php檔案位置與名稱
        $conf["phpFileAddress"]="";
        #$conf["functionName"],字串,函式的名稱
        $conf["functionName"]="";
        #$conf["fileArgu"],字串,__FILE__的內容.
        $conf["fileArgu"]=__FILE__;
        #可省略參數:
        #$conf["web"],字串,"true"代表檔案是放在web環境;"false"是代表在檔案系統環境,預設為"false".
        #$conf["web"]="false";
        #參考資料:
        #無.
        #備註:
        #無.
        */
        public static function getFunctionConstruction(&$conf){
                
                #初始化要回傳的內容
                $result=array();

                #取得當前函數的名稱
                $result["function"]=__FUNCTION__;

                #如果 $conf 不為陣列
                if(gettype($conf)!="array"){
                        
                        #設置執行失敗
                        $result["status"]="false";
                        
                        #設置執行錯誤訊息
                        $result["error"][]="\$conf變數須為陣列形態";

                        #如果傳入的參數為 null
                        if($conf==null){
                                
                                #設置執行錯誤訊息
                                $result["error"][]="\$conf變數不得為null,請檢查函數「".$result["function"]."」的參數設置有無正確!";
                                
                                }#if end

                        #回傳結果
                        return $result;
                        
                        }#if end
                
                #函式說明:
                #檢查必填與可省略的參數,可省略參數可指定預設要給與什麼數值內容。
                #$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
                #$reuslt["error"],執行不正常結束的錯訊息陣列.
                #$result["function"],當前執行的函式名稱.
                #$result["argu"],設置給予的參數.
                #$result["passed"],識別要檢查的全體變數是否存在以及型態是否正確的變數,"true"代表檢查全部通過;"false"代表檢查不通過
                #$result[$shouldBeCheckedVarName]["varExist"],所檢查的變數是否存在,"false"代表不存在;"true"代表存在
                #$result[$shouldBeCheckedVarName]["varType"],所檢查的變數型態是否正確,"false"代表錯誤;"true"代表正確
                #$result[$shouldBeCheckedVarName]["error"],每個參數設定的錯誤訊息
                #$result["shouldNotBeEmpty"],不應該為空字串或控陣列的變數.
                #$result["argu"],字串陣列,目前輸入的參數名稱陣列.
                #$result["legalVarName"],字串陣列,合法可用的參數名稱陣列.
                #$result["notNeedVar"],字串陣列,多餘的參數名稱.
                #必填寫的參數:
                #$conf["varInput"],陣列變數,要檢查的陣列變數,請在要檢查的參數前面加上&,這樣變動的結果才能被套用。
                $conf["variableCheck::checkArguments"]["varInput"]=&$conf;
                #$conf["referenceVarKey"],字串,$conf參數後面的key值,用於移除不要的參考陣列.
                $conf["variableCheck::checkArguments"]["referenceVarKey"]="variableCheck::checkArguments";
                #可以省略的參數:
                #$conf["mustBeFilledVariableName"],爲必填參數的變數名稱陣列,形態爲陣列變數,元素數量需要跟"mustBeFilledVariableType"參數的元素數量一致,例如: $conf["mustBeFilledVariableName"] = array("id","account","password");
                $conf["variableCheck::checkArguments"]["mustBeFilledVariableName"]=array("phpFileAddress","functionName","fileArgu");
                #$conf["mustBeFilledVariableType"],爲必填參數的變數陣列應該爲何種變數形態,形態爲陣列,元素數量需要跟"mustBeFilledVariableName"參數的元素數量一致,例如: $conf["mustBeFilledVariableType"] = array("string",integer,"double","resource","object"); , null代表不指定變數形態.
                $conf["variableCheck::checkArguments"]["mustBeFilledVariableType"]=array("string","string","string");
                #$conf["canBeEmptyString"],字串,必填變數內容如果是空字串就不能算是有設置的話,請設為"false",預設爲"true",可以為空字串.
                #$conf["canBeEmptyString"]="false";
                #$conf["canNotBeEmpty"],字串陣列,哪些必填參數的內容不得為空字串或空陣列,僅當$conf["canBeEmptyString"]為"true"時會生效.
                #$conf["canNotBeEmpty"]=array();
                #$conf["canBeEmpty"],字串陣列,哪些必填參數的內容可為空字串或空陣列,僅當$conf["canBeEmptyString"]為"false"時會生效.
                #$conf["canBeEmpty"]=array();
                #$conf["skipableVariableCanNotBeEmpty"],字串陣列,哪些可省略參數不可以為空字串或空陣列.
                #$conf["skipableVariableCanNotBeEmpty"]=array();
                #$conf["skipableVariableName"],陣列字串,爲可省略參數的變數名稱陣列,形態爲陣列變數,例如: $conf["skipableVariableName"] = array("id","account","password");
                $conf["variableCheck::checkArguments"]["skipableVariableName"]=array("web");
                #$conf["skipableVariableType"],陣列字串,爲可省略參數的變數名稱陣列,形態爲陣列變數,例如: $conf["skipableVariableType"] = array("string",integer,"double");
                $conf["variableCheck::checkArguments"]["skipableVariableType"]=array("string");
                #$conf["skipableVarDefaultValue"],字串陣列,每個不存在的可省略變數要初始化為什麼,null與代表不指定,若預設值是參數之一,請將$conf["mustBeFilledVar"]改成"\$conf["\mustBeFilledVar\"]".
                $conf["variableCheck::checkArguments"]["skipableVarDefaultValue"]=array("false");
                #$conf["disallowAllSkipableVarIsEmpty"],字串,是否允許每個可省略參數都為空字串,預設為"true"允許,反之為"false".
                #$conf["disallowAllSkipableVarIsEmpty"]="";
                #$conf["disallowAllSkipableVarIsEmptyArray"],字串,是否允許每個可省略參數都為空陣列,預設為"true"允許,反之為"false".
                #$conf["disallowAllSkipableVarIsEmptyArray"]="";
                #$conf["arrayCountEqualCheck"],字串陣列,為檢查哪些陣列參數的元素數量要一樣,$conf["arrayCountEqualCheck"][$i]=array()為第$i組key為哪些的變數其元素數量要相等.
                #$conf["arrayCountEqualCheck"][]=array();
                #參考資料來源:
                #array_keys=>http://php.net/manual/en/function.array-keys.php
                $checkArguments=variableCheck::checkArguments($conf["variableCheck::checkArguments"]);
                unset($conf["variableCheck::checkArguments"]);
                
                # 如果檢查出錯
                if($checkArguments["status"]==="false"){
                        
                        #設置執行錯誤的識別
                        $result["status"]="false";

                        #設置執行錯誤的訊息
                        $result["error"]=$checkArguments;
                        
                        #回傳結果
                        return $result;
                        
                        }#if end
        
                # 如果檢查不通過
                if($checkArguments["passed"]==="false"){
                        
                        #設置執行錯誤的識別
                        $result["status"]="false";

                        #設置執行錯誤的訊息
                        $result["error"]=$checkArguments;
                        
                        #回傳結果
                        return $result;
                        
                        }#if end
                
                #函數說明:
                #將檔案的位置名稱變成網址,也可以取得檔案位於伺服器上檔案系統的絕對位置.
                #回傳結果:
                #$result["status"],"true"爲建立成功,"false"爲建立失敗.
                #$result["error"],錯誤訊息陣列.
                #$result["function"],函數名稱. 
                #$result["argu"],使用的參數.
                #$result["content"],網址,若是在命令列執行,則為"null".
                #$result["webPathFromRoot"],相對於網頁根目錄的路徑.
                #$result["fileSystemAbsoulutePosition"],針對伺服器端的絕對位置,亦即從網頁「document_root」目錄開始的路徑.
                #必填參數:
                #$conf["address"],字串,檔案的相對位置,若為絕對位置則會自動轉換成相對位置.
                $conf["fileAccess::getInternetAddressV2"]["address"]=$conf["phpFileAddress"];
                #$conf["fileArgu"],字串,php變數__FILE__的內容,亦即該檔案在檔案系統的絕對路徑.
                $conf["fileAccess::getInternetAddressV2"]["fileArgu"]=$conf["fileArgu"];
                #可省略參數:
                #$conf["web"],字串,"true"代表檔案是放在web環境;"false"是代表在檔案系統環境,預設為"true".
                $conf["fileAccess::getInternetAddressV2"]["web"]=$conf["web"];
                #備註:
                #建構中,fileSystemRelativePosition尚未實作
                $getInternetAddressV2=fileAccess::getInternetAddressV2($conf["fileAccess::getInternetAddressV2"]);
                unset($conf["fileAccess::getInternetAddressV2"]);
                        
                #如果執行出錯
                if($getInternetAddressV2["status"]==="false"){
                
                        #設置執行錯誤的識別
                        $result["status"]="false";

                        #設置執行錯誤的訊息
                        $result["error"]=$getInternetAddressV2;
                        
                        #回傳結果
                        return $result;
                
                        }#if end        
                        
                #取得檔案的絕對位置
                $conf["phpFileAddress"]=$getInternetAddressV2["fileSystemAbsoulutePosition"];
                        
                #取得php檔案的內容
                #函式說明:
                #依據行號分隔抓取檔案的內容,結果會回傳一個陣列
                #回傳的變數說明:
                #$result["fileContent"],爲檔案的內容陣列
                #$result["lineCount"],爲檔案內容總共的行數
                #必填參數:
                $conf["fileAccess"]["getFileContent"]["filePositionAndName"]=$conf["phpFileAddress"];#爲檔案的位置以及名稱
                $conf["fileAccess"]["getFileContent"]["fileArgu"]=$conf["fileArgu"];
                #$conf["web"],字串,"true"代表檔案是放在web環境;"false"是代表在檔案系統環境,預設為"false".
                $conf["fileAccess"]["getFileContent"]["web"]="false";
                #參考資料:
                #file():取得檔案內容的行數
                #http:#php.net/manual/en/function.file.php
                $fileContent=fileAccess::getFileContent($conf["fileAccess"]["getFileContent"]);
                unset($conf["fileAccess"]["getFileContent"]);

                #如果執行出錯
                if($fileContent["status"]==="false"){
                
                        #設置執行錯誤的識別
                        $result["status"]="false";

                        #設置執行錯誤的訊息
                        $result["error"]=$fileContent;
                        
                        #回傳結果
                        return $result;
                
                        }#if end

                #尋找函式定義的位置.
                #函式說明:
                #檢查一個字串裡面是否有多個關鍵字
                #回傳的結果:
                #$result["status"],整體來說,執行是否成功,"true"代表執行成功,"false"代表執行失敗。
                #$result[$i]["status"],第$i個字串搜尋是否成功,"true"代表執行成功,"false"代表執行失敗。
                #$result[$i]["error"],第$i個字串搜尋的錯誤訊息陣列
                #$result[$i]["founded"],第$i個字串搜尋,是否找到所有的關鍵字,"true"代表有找到關鍵字;"false"代表沒有找到關鍵字。
                #$result["foundedTrueKey"],["founded"]結果為"true"的元素key陣列。
                #$result["foundedFalseKey"],["founded"]結果為"false"的元素key陣列。
                #必填參數:
                $conf["search"]["findManyKeyWordsFromManyString"]["keyWords"]=array("function ".$conf["functionName"]."(");#想要搜尋的關鍵字
                $conf["search"]["findManyKeyWordsFromManyString"]["stringArray"]=$fileContent["fileContent"];#要被搜尋的字串內容陣列
                #可省略的參數:
                #$conf["search"]["findManyKeyWordsFromManyString"]["completeEqual"]="true";#是否內容要完全符合,不能多出任何不符合的內容,預設為不需要完全符合。
                $foundedFunctionStrArray=search::findManyKeyWordsFromManyString($conf["search"]["findManyKeyWordsFromManyString"]);
                unset($conf["search"]["findManyKeyWordsFromManyString"]);
                
                #取得可能為函式宣告的陣列元素key
                $maybeAfunctionDefineLine=$foundedFunctionStrArray["foundedTrueKey"];           
                
                #有抓到錯誤的函式名稱,需要剔除
                #針對每個抓到的function行
                foreach($foundedFunctionStrArray["foundedTrueKey"] as $maybeAfunctinKeyNo){
                        
                        #如果該行內容含有「=」則代表為錯誤的函式行
                        #函式說明:
                        #檢查字串裡面有無指定的關鍵字
                        #回傳的結果:
                        #$result["status"],"true"代表執行成功,"false"代表執行失敗。
                        #$result["error"],錯誤訊息
                        #$result["founded"],是否找到關鍵字,"true"代表有找到關鍵字;"false"代表沒有找到關鍵字。
                        #必填參數:
                        $conf["search"]["findKeyWord"]["keyWord"]="=";#想要搜尋的關鍵字
                        $conf["search"]["findKeyWord"]["string"]=$maybeAfunctinKeyNo;#要被搜尋的字串內容
                        #可省略的參數:
                        #$conf["search"]["findKeyWord"]["completeEqual"]="true";#是否內容要完全符合,不能多出任何不符合的內容,預設為不需要完全符合。
                        $searchResult=search::findKeyWord($conf["search"]["findKeyWord"]);
                        unset($conf["search"]["findKeyWord"]);
                        
                        #如果 $searchResult["founded"] 等於 "true" 則代表該行不是真的函式宣告
                        if($searchResult["founded"]=="true"){
                                
                                #涵式說明:
                                #將陣列中特定元素剔除
                                #回傳的結果:
                                #剔除掉特地元素的陣列
                                #必填參數:
                                $conf["arrays"]["eraseElement"]["rawInputArray"]=$maybeAfunctionDefineLine;#要處理的原始數字陣列
                                $conf["arrays"]["eraseElement"]["eraseElementKey"]=$maybeAfunctinKeyNo;#要移除的元素key值  
                                $maybeAfunctionDefineLine=arrays::eraseElement($conf["arrays"]["eraseElement"]);
                                unset($conf["arrays"]["eraseElement"]);
                                
                                }#if end
                                                                
                        }#foreach end
                                                                
                #更新可能為函式宣告的行key
                $foundedFunctionStrArray["foundedTrueKey"]=$maybeAfunctionDefineLine;
                
                #針對每個找到"function"的行編號
                foreach($foundedFunctionStrArray["foundedTrueKey"] as $index=>$keyNum){
                        
                        #判斷該行是否為註解
                        #函式說明:
                        #檢查一個字串裡面是否有多個關鍵字
                        #回傳的結果:
                        #$result["status"],"true"代表執行成功,"false"代表執行失敗。
                        #$result["error"],錯誤訊息
                        #$result["founded"],是否找到所有的關鍵字,"true"代表有找到關鍵字;"false"代表沒有找到關鍵字。
                        #必填參數:
                        $conf["search"]["findManyKeyWords"]["keyWords"]=array("#");#想要搜尋的關鍵字
                        $conf["search"]["findManyKeyWords"]["string"]=$keyNum;#要被搜尋的字串內容
                        #可省略的參數:
                        #$conf["search"]["findManyKeyWords"]["completeEqual"]="true";#是否內容要完全符合,不能多出任何不符合的內容,預設為不需要完全符合。
                        $searchResult=search::findManyKeyWords($conf["search"]["findManyKeyWords"]);
                        unset($conf["search"]["findManyKeyWords"]);     
                                                
                        #如果沒有「#」關鍵字
                        if($searchResult["founded"]==="false"){
                                
                                #代表是宣告函式的行
                                
                                #取得函式結構結束的key(檔案內容每行的key)
                                $result["functionStructionEndPoint"]=$index;
                                
                                }#if end
                                
                        }#foreach end
                
                #如果找不到函數宣告的行數
                if(!isset($result["functionStructionEndPoint"])){
                
                        #設置執行錯誤的識別
                        $result["status"]="false";

                        #設置執行錯誤的訊息
                        $result["error"]=$foundedFunctionStrArray;
                        
                        #回傳結果
                        return $result;
                
                        }#if end
                                
                #從 $result["functionStructionEndPoint"] 元素往前讀,直到讀到「/*」為止。
                for($i=$result["functionStructionEndPoint"]-1;$i>=0;$i--){
                                
                        #函式說明:
                        #處理字串避免網頁出錯
                        #回傳的結果:
                        #$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
                        #$result["function"],當前執行的函數.
                        #$result["content"],爲處理好的字串.
                        #$result["error"],錯誤訊息陣列.
                        #$result["argu"],使用的參數. 
                        #必填參數:
                        $conf["stringProcess"]["correctCharacter"]["stringIn"]=$fileContent["fileContent"][$i];#爲要處理的字串
                        #可省略的參數:
                        $conf["stringProcess"]["correctCharacter"]["selectedCharacter"]=array(" ","\n","\t");#爲被選擇要處理的字串/字元,須爲陣列值。
                                #若不設定則預設爲要將這些字串作替換("<",">",";","=","//","'","$","%","&","|","/*","*\/","#")。
                        #$conf["changeTo"]=array();#爲被選擇的字元要換成什麼字串/字元,須爲陣列值。若不設定,則預設爲更換成""(空字串)。
                        $correctCharacter=stringProcess::correctCharacter($conf["stringProcess"]["correctCharacter"]);
                        unset($conf["stringProcess"]["correctCharacter"]);
                        
                        #如果處理失敗
                        if($correctCharacter["status"]==="false"){

                                #設置執行錯誤的識別
                                $result["status"]="false";

                                #設置執行錯誤的訊息
                                $result["error"]=$correctCharacter;
                                
                                #回傳結果
                                return $result;
                        
                                }#if end
                        
                        #取得處理號的內容列
                        $temp=$correctCharacter["content"];

                        #如果 $temp 為 「/*」
                        if($temp==="/*"){
                                                        
                                #跳出for迴圈
                                break;
                        
                                }#if end
                                
                        #如果 $temp 為 「*/」 
                        if($temp==="*/"){
                                                        
                                #跳到下一輪
                                continue;
                                                                
                                }#if end
                                
                        #取得涵式宣告的內容
                        $result["functionComment"][]=$fileContent["fileContent"][$i];   
                        
                        }#for end
                        
                #函式說明:
                #將陣列倒置
                #回傳的結果:
                #$result["status"],執行是否成功,"true"為執行成功;"false"為執行失敗
                #$result["error"],錯誤訊息陣列
                #$result["convertArray"],轉置後的陣列內容
                #必填參數:
                $conf["arrays"]["convertArray"]["inputArray"]=$result["functionComment"];#要倒置的陣列
                #參考資料來源:
                #http://tw2.php.net/array_reverse => 陣列倒置的內建函式
                $convertResult=arrays::convertArray($conf["arrays"]["convertArray"]);
                unset($conf["arrays"]["convertArray"]);
                        
                #如果轉置失敗
                if($convertResult["status"]=="false"){
                        
                        #設置執行失敗的識別
                        $result["status"]="false";
                        
                        #設置執行失敗的提示
                        $result["error"]=$convertResult;
                        
                        #回傳結果
                        return $result;
                        
                        }#if end        
                        
                #反之代表執行成功
                else{
                        
                        #將倒置後的元素存起來
                        $result["functionComment"]=$convertResult["convertArray"];
                        
                        }#else 
                        
                #將多餘的字元剔除
                #函式說明:
                #處理多個字串避免網頁出錯
                #回傳的結果:
                #$result["status"],"true"代表執行成功,"false"代表執行失敗。
                #$result["error"],錯誤訊息
                #$result["processedStrArray"],處理好的字串陣列
                #必填參數:
                $conf["stringProcess"]["correctMutiStrCharacter"]["stringIn"]=$result["functionComment"];#爲要處理的字串陣列
                #可省略的參數:
                $conf["stringProcess"]["correctMutiStrCharacter"]["selectedCharacter"]=array(" ","\t","\n");#爲被選擇要處理的字串/字元,須爲陣列值。
                        #若不設定則預設爲要將這些字串作替換("<",">",";","=","//","'","$","%","&","|","/*","*\/","#")。
                        #特殊字元,「\n」代表換行,「\t」代表tab鍵的間隔
                #$conf["changeTo"]=array();#爲被選擇的字元要換成什麼字串/字元,須爲陣列值。若不設定,則預設爲更換成""(空字串)。
                $strProcessedResult=stringProcess::correctMutiStrCharacter($conf["stringProcess"]["correctMutiStrCharacter"]);
                unset($conf["stringProcess"]["correctMutiStrCharacter"]);
                        
                #如果 $strProcessedResult["status"]為"false"
                if($strProcessedResult["status"]=="false"){
                        
                        #設定執行錯誤識別
                        $result["status"]="false";
                        
                        #設定執行錯誤提示
                        $result["error"]=$strProcessedResult;
                        
                        #回傳結果 
                        return $result;
                        
                        }#if end
                        
                #反之代表執行成功
                else{
                        
                        $result["functionComment"]=$strProcessedResult["processedStrArray"];
                        
                        }#else end
                                        
                #取得涵式宣告的那一行 
                $functionDefineLine=$fileContent["fileContent"][$result["functionStructionEndPoint"]];  
                        
                #如果 $functionDefineLine 中有「()」則代表沒有要傳入的參數
                #函式說明:
                #檢查字串裡面有無指定的關鍵字
                #回傳的結果:
                #$result["status"],"true"代表執行成功,"false"代表執行失敗。
                #$result["error"],錯誤訊息
                #$result["founded"],是否找到關鍵字,"true"代表有找到關鍵字;"false"代表沒有找到關鍵字。
                #必填參數:
                $conf["search"]["findKeyWord"]["keyWord"]="()";#想要搜尋的關鍵字
                $conf["search"]["findKeyWord"]["string"]=$functionDefineLine;#要被搜尋的字串內容
                #可省略的參數:
                #$conf["completeEqual"]="true";#是否內容要完全符合,不能多出任何不符合的內容,預設為不需要完全符合。
                $searchResult=search::findKeyWord($conf["search"]["findKeyWord"]);
                unset($conf["search"]["findKeyWord"]);
                                
                #如果 $searchResult["founded"]為"true"
                if($searchResult["founded"]=="true"){
                        
                        #代表不須要傳入參數
                        $result["argvType"]="";
                        
                        }#if end
                        
                #反之代表有傳入參數
                else{
                                
                        #用「(」來分割
                        #涵式說明:
                        #將固定格式的字串分開,並回傳分開的結果。
                        #回傳的參數:
                        #$result["oriStr"],要分割的原始字串內容
                        #$result["dataArray"],爲分割好字串的陣列內容,$result["dataArray"][$i]爲第($i+1)段的內容。
                        #$result["dataCounts"],爲總共分成幾段
                        #必填參數:
                        $conf["stringProcess"]["spiltString"]["stringIn"]=$functionDefineLine;#要處理的字串。
                        $conf["stringProcess"]["spiltString"]["spiltSymbol"]="(";#爲以哪個符號作爲分割
                        $spiltedStr=stringProcess::spiltString($conf["stringProcess"]["spiltString"]);
                        unset($conf["stringProcess"]["spiltString"]);
                                
                        #如果執行失敗
                        if($spiltedStr["status"]==="false"){
                                
                                #設定執行錯誤識別
                                $result["status"]="false";
                                
                                #設定執行錯誤提示
                                $result["error"]=$spiltedStr;
                                
                                #回傳結果 
                                return $result;
                                
                                }#if end        
                                
                        #如果切割出來小於2段
                        if($spiltedStr["dataCounts"]<2){
                                
                                #設定執行錯誤識別
                                $result["status"]="false";
                                
                                #設定執行錯誤提示
                                $result["error"][]=$spiltedStr;
                                
                                #設定執行錯誤提示
                                $result["error"][]="dataCounts 應該要大於等於 2";
                                
                                #回傳結果 
                                return $result;
                                
                                }#if end
                                
                        #用「)」來分割
                        #涵式說明:
                        #將固定格式的字串分開,並回傳分開的結果。
                        #回傳的參數:
                        #$result["oriStr"],要分割的原始字串內容
                        #$result["dataArray"],爲分割好字串的陣列內容,$result["dataArray"][$i]爲第($i+1)段的內容。
                        #$result["dataCounts"],爲總共分成幾段
                        #必填參數:
                        $conf["stringProcess"]["spiltString"]["stringIn"]=$spiltedStr["dataArray"][1];#要處理的字串。
                        $conf["stringProcess"]["spiltString"]["spiltSymbol"]=")";#爲以哪個符號作爲分割
                        $spiltedStr=stringProcess::spiltString($conf["stringProcess"]["spiltString"]);
                        unset($conf["stringProcess"]["spiltString"]);                           
                                
                        #取得參數內容
                        $argvName=$spiltedStr["dataArray"][0];
                        
                        #如果要傳入的參數為 "$conf"
                        if($argvName=="&\$conf"){
                                
                                #則為array型態
                                $result["argvType"]="array";
                                
                                }#if end
                                
                        #反之
                        else{
                                
                                #則未知型態
                                $result["argvType"]="unknow";
                                
                                }#else end
                                
                        }#else end
                        
                #取得函式說明的元素key
                #函式說明:
                #檢查一個數值是否與陣列裏面的元素相同
                #回傳的結果:
                #$result["status"],"true"表示執行正確,"false"表示執行錯誤.
                #$result["founded"],"true"表示有找到相同的,"false"表示沒有找到相同的.
                #$result["error"],錯誤訊息
                #$result["function"],當前執行的函數名稱
                #$result["argv"],使用的參數
                #$result["equalVarName"],相等的變數名稱或key.
                #$result["equalVarValue"],相等的變數數值內容.
                #必填參數:
                $conf["search"]["getEqualVar"]["conditionElement"]="#函式說明:";#條件元素,要等於的元素內容。
                $conf["search"]["getEqualVar"]["compareElements"]=$result["functionComment"];#要比對的陣列變數內容。
                $searchResult=search::getEqualVar($conf["search"]["getEqualVar"]);
                unset($conf["search"]["getEqualVar"]);
                
                #debug
                #var_dump($searchResult);
                
                #如果執行失敗
                if($searchResult["status"]==="false"){
                        
                        #設定執行錯誤識別
                        $result["status"]="false";
                        
                        #設定執行錯誤提示
                        $result["error"]=$searchResult;
                        
                        #回傳結果 
                        return $result;
                        
                        }#if end
                        
                #如果沒有找到
                if($searchResult["founded"]==="false"){
                        
                        #設定執行錯誤識別
                        $result["status"]="false";
                        
                        #設定執行錯誤提示
                        $result["error"]=$searchResult;
                        
                        #回傳結果 
                        return $result;
                        
                        }#if end
                
                #函式說明起始點的key
                $functionCommentStartKey=$searchResult["equalVarName"];
                
                #取得涵式說明內容:
                $result["comment"]=$result["functionComment"][$functionCommentStartKey+1];
                
                #卸除暫存變數
                unset($functionCommentStartKey);
                
                #取得回傳結果的陣列...
                #依據開頭為 $result 來判斷...
                
                #涵式說明:
                #取得多個字首一樣的字串,並回傳其字串。
                #回傳的結果:
                #$result["status"],若爲"true"則代表執行正常;若爲"false"則代表執行失敗。
                #$result["founded"],若為"true"則代表有找到符合字首條件的結果;若爲"false"則代表沒有找到。
                #$result["function"],當前執行的函數名稱.
                #$result["returnString"],爲符合字首條件的字串陣列內容.
                #$result["foundedKey"],找到的內容位於原本的哪一個元素.
                #$result["argu"],使用的參數.
                #必填參數:
                $conf["search"]["getMeetConditionsStringMuti"]["checkString"]=$result["functionComment"];#要檢查的字串陣列
                $conf["search"]["getMeetConditionsStringMuti"]["frontWord"]="#\$result";#用來檢查字首應該要有什麼字串
                #用到的涵式:
                #str_spilt(),可以將字串依照字母分割成一個個陣列字串。
                $returnVar=search::getMeetConditionsStringMulti($conf["search"]["getMeetConditionsStringMuti"]);
                unset($conf["search"]["getMeetConditionsStringMuti"]);
                
                #如果執行失敗
                if($returnVar["status"]==="false"){
                        
                        #設定執行錯誤識別
                        $result["status"]="false";
                        
                        #設定執行錯誤提示
                        $result["error"]=$returnVar;
                        
                        #回傳結果 
                        return $result;
                        
                        }#if end
                        
                #如果有符合的關鍵字
                if($returnVar["founded"]==="true"){
                
                        #用「,」區隔回傳變數名稱與註解
                        #涵式說明:
                        #將多個固定格式的字串分開,並回傳分開的結果
                        #回傳的參數:
                        #$result[status],執行成功與否,若爲0,代表執行成功,若爲1代表執失敗。
                        #$result["spiltString"][$i]["oriStr"],爲第i個字串的原始內容
                        #$result["spiltString"][$i]["dataArray"],爲第($i+1)個字串分割後的字串陣列
                        #$result["spiltString"][$i]["dataArray"][$j],爲第($i+1)的分割好的字串的第($j)段內容
                        #$result["spiltString"][$i]["dataCounts"],爲第($i+1)個字串分割後總共分成幾段
                        #必填參數:
                        $conf["stringProcess"]["spiltMutiString"]["stringIn"]=$returnVar["returnString"];#要處理的字串陣列。
                        $conf["stringProcess"]["spiltMutiString"]["spiltSymbol"]=",";#爲要以哪個符號作爲分割。
                        $spiltedVarNameAndComment=stringProcess::spiltMutiString($conf["stringProcess"]["spiltMutiString"]);
                        unset($conf["stringProcess"]["spiltMutiString"]);
                        
                        #如果執行失敗
                        if($spiltedVarNameAndComment["status"]==="false"){
                                
                                #設定執行錯誤識別
                                $result["status"]="false";
                                
                                #設定執行錯誤提示
                                $result["error"]=$spiltedVarNameAndComment;
                                
                                #回傳結果 
                                return $result;
                                
                                }
                        
                        #針對每行分割的回傳變數名稱
                        for($i=0;$i<count($spiltedVarNameAndComment["spiltString"]);$i++){
                        
                                #將「#」符號剔除
                                #涵式說明:
                                #處理多個字串避免網頁出錯
                                #回傳的結果:
                                #$result["status"],"true"代表執行成功,"false"代表執行失敗。
                                #$result["error"],錯誤訊息
                                #$result["processedStrArray"],處理好的字串陣列
                                #必填參數:
                                $conf["stringProcess"]["correctMutiStrCharacter"]["stringIn"]=array($spiltedVarNameAndComment["spiltString"][$i]["dataArray"][0]);#爲要處理的字串陣列
                                #可省略的參數:
                                $conf["stringProcess"]["correctMutiStrCharacter"]["selectedCharacter"]=array("#");#爲被選擇要處理的字串/字元,須爲陣列值。
                                        #若不設定則預設爲要將這些字串作替換("<",">",";","=","//","'","$","%","&","|","/*","*\/","#")。
                                        #特殊字元,「\n」代表換行,「\t」代表tab鍵的間隔
                                #$conf["stringProcess"]["correctMutiStrCharacter"]["changeTo"]=array();#爲被選擇的字元要換成什麼字串/字元,須爲陣列值。若不設定,則預設爲更換成""(空字串)。
                                $processedStr=stringProcess::correctMutiStrCharacter($conf["stringProcess"]["correctMutiStrCharacter"]);
                                unset($conf["stringProcess"]["correctMutiStrCharacter"]);
                                
                                #取得沒有 # 的內容
                                $spiltedVarNameAndComment["spiltString"][$i]["dataArray"][0]=$processedStr["processedStrArray"][0];     
                                
                                }#for end
                                
                        #將回傳變數名稱與註解紀錄起來
                        foreach($spiltedVarNameAndComment["spiltString"] as $returnVar){
                                
                                #取得回傳的變數名稱
                                $result["return"]["name"][]=$returnVar["dataArray"][0];
                                
                                if(isset($returnVar["dataArray"][1])){
                                
                                        #取得回傳的變數註解
                                        $result["return"]["comment"][]=$returnVar["dataArray"][1];
                                        
                                        }#if end
                                
                                }#foreach end
                                
                        #依據回傳變數說明來判斷回傳的型態
                                                
                        #如果回傳的變數名稱數量大於1
                        if(count($result["return"]["name"])>1){
                                
                                #則代表回傳的結果為array
                                $result["returnVarType"]="array";
                                
                                }#if end
                        
                        #反之其回傳的結果可能為string、int、float、double、boolean,目前先一律視為"string"
                        else{
                                
                                $result["returnVarType"]="string";
                                
                                }#else end
                                
                        }#if end
                                
                #取得必填參數陣列...
                #依據開頭為 #必填參數 來判斷...

                #涵式說明:
                #取得多個字首一樣的字串,並回傳其字串。
                #回傳的結果:
                #$result["status"],若爲"true"則代表執行正常;若爲"false"則代表執行失敗。
                #$result["founded"],若為"true"則代表有找到符合字首條件的結果;若爲"false"則代表沒有找到。
                #$result["function"],當前執行的函數名稱.
                #$result["returnString"],爲符合字首條件的字串陣列內容.
                #$result["foundedKey"],找到的內容位於原本的哪一個元素.
                #必填參數:
                $conf["search"]["getMeetConditionsStringMuti"]["checkString"]=$result["functionComment"];#要檢查的字串陣列
                #可省略參數:
                #$conf["frontWord"],字串,用來檢查字首應該要有什麼字串,預設不指定.
                $conf["search"]["getMeetConditionsStringMuti"]["frontWord"]="#必填參數";
                #$conf["tailWord"],字串,用來檢查字尾應該要有什麼字串,預設不指定.
                #$conf["tailWord"]="";
                $returnVar=search::getMeetConditionsStringMulti($conf["search"]["getMeetConditionsStringMuti"]);
                unset($conf["search"]["getMeetConditionsStringMuti"]);
                
                #如果執行失敗
                if($returnVar["status"]==="false"){
                        
                        #設定執行錯誤識別
                        $result["status"]="false";
                        
                        #設定執行錯誤提示
                        $result["error"]=$returnVar;
                        
                        #回傳結果 
                        return $result;
                        
                        }#if end

                #如果有找到必填參數的列
                if($returnVar["founded"]==="false")
                {
                        #設定執行錯誤識別
                        $result["status"]="false";
                        
                        #設定執行錯誤提示
                        $result["error"]=$returnVar;
                        
                        #回傳結果 
                        return $result;
                }

                #必填變數的開始行
                $mustBeFilledVarKeyStartPoint=$returnVar["foundedKey"][0];

                /*
                #debug          
                var_dump($mustBeFilledVarKeyStartPoint);
                var_dump($result["functionComment"]);
                exit;
                */ 

                #取得可省略的參數陣列...
                #依據開頭為 #可省略參數 來判斷...
                
                #涵式說明:
                #取得多個字首一樣的字串,並回傳其字串。
                #回傳的結果:
                #$result["status"],若爲"true"則代表執行正常;若爲"false"則代表執行失敗。
                #$result["founded"],若為"true"則代表有找到符合字首條件的結果;若爲"false"則代表沒有找到。
                #$result["function"],當前執行的函數名稱.
                #$result["returnString"],爲符合字首條件的字串陣列內容.
                #$result["foundedKey"],找到的內容位於原本的哪一個元素.
                #必填參數:
                $conf["search"]["getMeetConditionsStringMuti"]["checkString"]=$result["functionComment"];#要檢查的字串陣列
                #可省略參數:
                #$conf["frontWord"],字串,用來檢查字首應該要有什麼字串,預設不指定.
                $conf["search"]["getMeetConditionsStringMuti"]["frontWord"]="#可省略參數";
                #$conf["tailWord"],字串,用來檢查字尾應該要有什麼字串,預設不指定.
                #$conf["tailWord"]="";
                $returnVar=search::getMeetConditionsStringMulti($conf["search"]["getMeetConditionsStringMuti"]);
                unset($conf["search"]["getMeetConditionsStringMuti"]);
                
                #如果執行失敗
                if($returnVar["status"]==="false"){
                        
                        #設定執行錯誤識別
                        $result["status"]="false";
                        
                        #設定執行錯誤提示
                        $result["error"]=$returnVar;
                        
                        #回傳結果 
                        return $result;
                        
                        }#if end

                #如果有找到必填參數的列
                if($returnVar["founded"]==="false"){

                        #設定執行錯誤識別
                        $result["status"]="false";
                        
                        #設定執行錯誤提示
                        $result["error"]=$returnVar;
                        
                        #回傳結果 
                        return $result;

                        }#if end

                #可省略參數的開始行
                $skipableVarKeyStartPoint=$returnVar["foundedKey"][0];  

                #取得參考資料來源
                #依據開頭為 #參考資料: 來判斷...

                #涵式說明:
                #取得多個字首一樣的字串,並回傳其字串。
                #回傳的結果:
                #$result["status"],若爲"true"則代表執行正常;若爲"false"則代表執行失敗。
                #$result["founded"],若為"true"則代表有找到符合字首條件的結果;若爲"false"則代表沒有找到。
                #$result["function"],當前執行的函數名稱.
                #$result["returnString"],爲符合字首條件的字串陣列內容.
                #$result["foundedKey"],找到的內容位於原本的哪一個元素.
                #必填參數:
                $conf["search"]["getMeetConditionsStringMuti"]["checkString"]=$result["functionComment"];#要檢查的字串陣列
                #可省略參數:
                #$conf["frontWord"],字串,用來檢查字首應該要有什麼字串,預設不指定.
                $conf["search"]["getMeetConditionsStringMuti"]["frontWord"]="#參考資料";
                #$conf["tailWord"],字串,用來檢查字尾應該要有什麼字串,預設不指定.
                #$conf["tailWord"]="";
                $getMeetConditionsStringMulti=search::getMeetConditionsStringMulti($conf["search"]["getMeetConditionsStringMuti"]);
                unset($conf["search"]["getMeetConditionsStringMuti"]);
                
                #debug
                #var_dump($getMeetConditionsStringMulti);
                #exit;

                #如果執行失敗
                if($getMeetConditionsStringMulti["status"]==="false"){
                        
                        #設定執行錯誤識別
                        $result["status"]="false";
                        
                        #設定執行錯誤提示
                        $result["error"]=$getMeetConditionsStringMulti;
                        
                        #回傳結果 
                        return $result;
                        
                        }#if end

                #如果沒有找到備註的列
                if($getMeetConditionsStringMulti["founded"]==="false"){

                        #設定執行錯誤識別
                        $result["status"]="false";
                        
                        #設定執行錯誤提示
                        $result["error"]=$getMeetConditionsStringMulti;
                        
                        #回傳結果 
                        return $result;

                        }#if end

                #參考資料的開始行
                $referenceVarKeyStartPoint=$getMeetConditionsStringMulti["foundedKey"][0];

                #取得備註陣列
                #依據開頭為 #備註: 來判斷...
                
                #涵式說明:
                #取得多個字首一樣的字串,並回傳其字串。
                #回傳的結果:
                #$result["status"],若爲"true"則代表執行正常;若爲"false"則代表執行失敗。
                #$result["founded"],若為"true"則代表有找到符合字首條件的結果;若爲"false"則代表沒有找到。
                #$result["function"],當前執行的函數名稱.
                #$result["returnString"],爲符合字首條件的字串陣列內容.
                #$result["foundedKey"],找到的內容位於原本的哪一個元素.
                #必填參數:
                $conf["search"]["getMeetConditionsStringMuti"]["checkString"]=$result["functionComment"];#要檢查的字串陣列
                #可省略參數:
                #$conf["frontWord"],字串,用來檢查字首應該要有什麼字串,預設不指定.
                $conf["search"]["getMeetConditionsStringMuti"]["frontWord"]="#備註";
                #$conf["tailWord"],字串,用來檢查字尾應該要有什麼字串,預設不指定.
                #$conf["tailWord"]="";
                $getMeetConditionsStringMulti=search::getMeetConditionsStringMulti($conf["search"]["getMeetConditionsStringMuti"]);
                unset($conf["search"]["getMeetConditionsStringMuti"]);
                
                #debug
                #var_dump($getMeetConditionsStringMulti);
                #exit;

                #如果執行失敗
                if($getMeetConditionsStringMulti["status"]==="false"){
                        
                        #設定執行錯誤識別
                        $result["status"]="false";
                        
                        #設定執行錯誤提示
                        $result["error"]=$getMeetConditionsStringMulti;
                        
                        #回傳結果 
                        return $result;
                        
                        }#if end

                #如果沒有找到備註的列
                if($getMeetConditionsStringMulti["founded"]==="false"){

                        #設定執行錯誤識別
                        $result["status"]="false";
                        
                        #設定執行錯誤提示
                        $result["error"]=$getMeetConditionsStringMulti;
                        
                        #回傳結果 
                        return $result;

                        }#if end

                #備註的開始行
                $noteVarKeyStartPoint=$getMeetConditionsStringMulti["foundedKey"][0];

                #取得必填參數的內容
        
                #初始化必填參數的列
                $mustBeFilledVar=array();       

                #從 $result["functionStructionEndPoint"] 元素往前讀,只讀取必填參數.
                for($i=$mustBeFilledVarKeyStartPoint;$i<$skipableVarKeyStartPoint;$i++){

                        #針對每個必填參數行,檢查是否為"#"開頭
                        $line=$result["functionComment"][$i];

                        #涵式說明:
                        #取得多個字首一樣的字串,並回傳其字串。
                        #回傳的結果:
                        #$result["status"],若爲"true"則代表執行正常;若爲"false"則代表執行失敗。
                        #$result["founded"],若為"true"則代表有找到符合字首條件的結果;若爲"false"則代表沒有找到。
                        #$result["function"],當前執行的函數名稱.
                        #$result["returnString"],爲符合字首條件的字串陣列內容.
                        #$result["foundedKey"],找到的內容位於原本的哪一個元素.
                        #必填參數:
                        $conf["search"]["getMeetConditionsStringMuti"]["checkString"]=array($line);#要檢查的字串陣列
                        #可省略參數:
                        #$conf["frontWord"],字串,用來檢查字首應該要有什麼字串,預設不指定.
                        $conf["search"]["getMeetConditionsStringMuti"]["frontWord"]="#";
                        #$conf["tailWord"],字串,用來檢查字尾應該要有什麼字串,預設不指定.
                        #$conf["tailWord"]="";
                        $returnVar=search::getMeetConditionsStringMulti($conf["search"]["getMeetConditionsStringMuti"]);
                        unset($conf["search"]["getMeetConditionsStringMuti"]);
                        
                        #如果執行失敗
                        if($returnVar["status"]==="false"){
                                
                                #設定執行錯誤識別
                                $result["status"]="false";
                                
                                #設定執行錯誤提示
                                $result["error"]=$returnVar;
                                
                                #回傳結果 
                                return $result;
                                
                                }#if end

                        #如果沒有找到必填參數的列
                        if($returnVar["founded"]==="false"){

                                #跳到下一個迴圈
                                continue;
        
                                }#if end

                        #取得必填參數名稱與解說的列
                        $mustBeFilledVar[]=$returnVar["returnString"][0];
                
                        }#for end

                #針對每一列
                foreach($mustBeFilledVar as $key=>$line){

                        #剔除開頭的 "#"
                        #涵式說明:
                        #處理字串避免網頁出錯
                        #回傳的結果:
                        #$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
                        #$result["function"],當前執行的函數.
                        #$result["content"],爲處理好的字串.
                        #$result["error"],錯誤訊息陣列.
                        #$result["argu"],使用的參數. 
                        #必填參數:
                        $conf["stringProcess::correctCharacter"]["stringIn"]=$line;#爲要處理的字串
                        #可省略的參數:
                        $conf["stringProcess::correctCharacter"]["selectedCharacter"]=array("#");#爲被選擇要處理的字串/字元,須爲陣列值。
                                #若不設定則預設爲要將這些字串作替換 ("<",">","=","//","'","$","%","&","|","/*","*","#","\"").
                                #特殊字元,「\n」代表換行,「\t」代表tab鍵的間隔
                        #$conf["changeTo"]=array();#爲被選擇的字元要換成什麼字串/字元,須爲陣列值。若不設定,則預設爲更換成""(空字串).
                        #備註:
                        #無.
                        $correctCharacter=stringProcess::correctCharacter($conf["stringProcess::correctCharacter"]);
                        unset($conf["stringProcess::correctCharacter"]);

                        #如果執行失敗
                        if($correctCharacter["status"]==="false"){
                                
                                #設定執行錯誤識別
                                $result["status"]="false";
                                
                                #設定執行錯誤提示
                                $result["error"]=$correctCharacter;
                                
                                #回傳結果 
                                return $result;
                                
                                }#if end

        
                        #取得剔除開頭 # 的內容列
                        $mustBeFilledVar[$key]=$correctCharacter["content"];

                        }#foreach end

                #針對每一列
                foreach($mustBeFilledVar as $key=>$line){

                        #涵式說明:
                        #將固定格式的字串分開,並回傳分開的結果。
                        #回傳結果:
                        #$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
                        #$result["error"],錯誤訊息陣列
                        #$result["function"],當前執行的函數名稱.
                        #$result["argu"],使用的參數.
                        #$result["oriStr"],要分割的原始字串內容
                        #$result["dataArray"],爲分割好字串的陣列內容,$result["dataArray"][$i]爲第($i+1)段的內容。
                        #$result["dataCounts"],爲總共分成幾段
                        #$result["found"],是否有在$conf["stringIn"]找到$conf["spiltSymbol"],"true"代表有找到,"false"代表沒有找到.
                        #必填參數:
                        $conf["stringProcess::spiltString"]["stringIn"]=$line;#要處理的字串。
                        $conf["stringProcess::spiltString"]["spiltSymbol"]=",";#爲以哪個符號作爲分割
                        #可省略參數:
                        #$conf["allowEmptyStr"],是否允許分割出來空字串,預設為"false"不允許;"true"代表允許.
                        $conf["stringProcess::spiltString"]["allowEmptyStr"]="false";
                        $spiltString=stringProcess::spiltString($conf["stringProcess::spiltString"]);
                        unset($conf["stringProcess::spiltString"]);

                        #如果執行失敗
                        if($spiltString["status"]==="false"){
                                
                                #設定執行錯誤識別
                                $result["status"]="false";
                                
                                #設定執行錯誤提示
                                $result["error"]=$spiltString;
                                
                                #回傳結果 
                                return $result;
                                
                                }#if end

                        #如果執行失敗
                        if($spiltString["found"]==="false"){
                                
                                #移除之
                                unset($mustBeFilledVar[$key]);

                                #換下一列
                                continue;
                                
                                }#if end

                        #取得名稱屬性跟備註
                        $mustBeFilledVar[$key]=array();
                        $mustBeFilledVar[$key]["name"]=$spiltString["dataArray"][0];
                        $mustBeFilledVar[$key]["type"]=$spiltString["dataArray"][1];
                        
                        #如果沒有備註
                        if(!isset($spiltString["dataArray"][2]))
                        {
                                #設置為空字串
                                $spiltString["dataArray"][2]="";
                        
                        }#if end
                        
                        $mustBeFilledVar[$key]["note"]=$spiltString["dataArray"][2];
                        
                        #debug
                        if(!isset($spiltString["dataArray"][2])){
                        
                                #初始化結果
                                $result=array();
                                
                                #設置執行錯誤
                                $result["status"]="false";
                                
                                #設置錯誤訊息
                                $result["error"]=$line;
                                
                                #設置錯誤訊息
                                $result["error"][]="未按照「參數名稱,參數形態,參數說明」的格式撰寫";
                        
                                #回傳結果
                                return $result;
                        
                                }#if end

                        #針對後面的說明
                        for($i=3;$i<$spiltString["dataCounts"];$i++){

                                #傳接起來
                                $mustBeFilledVar[$key]["note"]=$mustBeFilledVar[$key]["note"].",".$spiltString["dataArray"][$i];

                                }#for end

                        }#foreach end

                /*
                #debug
                var_dump($mustBeFilledVar);
                exit;
                */

                #取得必填的參數
                $result["mustBeFilledVar"]=$mustBeFilledVar;

                #初始化儲存可省略的參數
                $skipableVar=array();

                /*
                #debug
                var_dump($skipableVarKeyStartPoint);
                var_dump($noteVarKeyStartPoint);                
                exit;
                */

                #從 $skipableVarKeyStartPoint 元素往後讀,只讀取可省略參數.
                for($i=$skipableVarKeyStartPoint;$i<$referenceVarKeyStartPoint;$i++){

                        #另存每個可省略參數行
                        $skipableVar[]=$result["functionComment"][$i];

                        }#for end

                #debug
                #var_dump($skipableVar);
                #exit;

                #暫存真的可省略變數與解說
                $newSkipableVar=array();

                #針對每個可略變數與解說
                for($i=1;$i<count($skipableVar);$i=$i+2){

                        #取得真的可省略變數與名稱
                        $newSkipableVar[]=$skipableVar[$i];

                        }#for end
                
                #置換內容
                $skipableVar=$newSkipableVar;
                
                /*
                #debug
                var_dump($skipableVar);
                exit;
                */
        
                #針對每一列
                foreach($skipableVar as $key=>$line){

                        #剔除開頭的 "#"
                        #涵式說明:
                        #處理字串避免網頁出錯
                        #回傳的結果:
                        #$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
                        #$result["function"],當前執行的函數.
                        #$result["content"],爲處理好的字串.
                        #$result["error"],錯誤訊息陣列.
                        #$result["argu"],使用的參數. 
                        #必填參數:
                        $conf["stringProcess::correctCharacter"]["stringIn"]=$line;#爲要處理的字串
                        #可省略的參數:
                        $conf["stringProcess::correctCharacter"]["selectedCharacter"]=array("#");#爲被選擇要處理的字串/字元,須爲陣列值。
                                #若不設定則預設爲要將這些字串作替換 ("<",">","=","//","'","$","%","&","|","/*","*","#","\"").
                                #特殊字元,「\n」代表換行,「\t」代表tab鍵的間隔
                        #$conf["changeTo"]=array();#爲被選擇的字元要換成什麼字串/字元,須爲陣列值。若不設定,則預設爲更換成""(空字串).
                        #備註:
                        #無.
                        $correctCharacter=stringProcess::correctCharacter($conf["stringProcess::correctCharacter"]);
                        unset($conf["stringProcess::correctCharacter"]);

                        #如果執行失敗
                        if($correctCharacter["status"]==="false"){
                                
                                #設定執行錯誤識別
                                $result["status"]="false";
                                
                                #設定執行錯誤提示
                                $result["error"]=$correctCharacter;
                                
                                #回傳結果 
                                return $result;
                                
                                }#if end

        
                        #取得剔除開頭 # 的內容列
                        $skipableVar[$key]=$correctCharacter["content"];

                        }#foreach end   

                #debug
                #var_dump($skipableVar);
                #exit;  

                #針對每一列
                foreach($skipableVar as $key=>$line){

                        #涵式說明:
                        #將固定格式的字串分開,並回傳分開的結果。
                        #回傳結果:
                        #$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
                        #$result["error"],錯誤訊息陣列
                        #$result["function"],當前執行的函數名稱.
                        #$result["argu"],使用的參數.
                        #$result["oriStr"],要分割的原始字串內容
                        #$result["dataArray"],爲分割好字串的陣列內容,$result["dataArray"][$i]爲第($i+1)段的內容。
                        #$result["dataCounts"],爲總共分成幾段
                        #$result["found"],是否有在$conf["stringIn"]找到$conf["spiltSymbol"],"true"代表有找到,"false"代表沒有找到.
                        #必填參數:
                        $conf["stringProcess::spiltString"]["stringIn"]=$line;#要處理的字串。
                        $conf["stringProcess::spiltString"]["spiltSymbol"]=",";#爲以哪個符號作爲分割
                        #可省略參數:
                        #$conf["allowEmptyStr"],是否允許分割出來空字串,預設為"false"不允許;"true"代表允許.
                        $conf["stringProcess::spiltString"]["allowEmptyStr"]="false";
                        $spiltString=stringProcess::spiltString($conf["stringProcess::spiltString"]);
                        unset($conf["stringProcess::spiltString"]);

                        #如果執行失敗
                        if($spiltString["status"]==="false"){
                                
                                #設定執行錯誤識別
                                $result["status"]="false";
                                
                                #設定執行錯誤提示
                                $result["error"]=$spiltString;
                                
                                #回傳結果 
                                return $result;
                                
                                }#if end

                        #如果執行失敗
                        if($spiltString["found"]==="false"){
                                
                                #移除之
                                unset($mustBeFilledVar[$key]);

                                #換下一列
                                continue;
                                
                                }#if end

                        #如果缺乏參數名稱位或屬性
                        if(!isset($spiltString["dataArray"][0]) || !isset($spiltString["dataArray"][1])){
                        
                                #設定執行錯誤識別
                                $result["status"]="false";
                                
                                #設定執行錯誤提示
                                $result["error"]=$spiltString;
                                
                                #回傳結果 
                                return $result;
                        
                                }#if end

                        #取得名稱屬性跟備註
                        $skipableVar[$key]=array();
                        $skipableVar[$key]["name"]=$spiltString["dataArray"][0];
                        $skipableVar[$key]["type"]=$spiltString["dataArray"][1];
                        
                        #如果沒有備註
                        if(!isset($spiltString["dataArray"][2]))
                        {
                                #設置為空字串.
                                $spiltString["dataArray"][2]="";
                        }
                        
                        $skipableVar[$key]["note"]=$spiltString["dataArray"][2];

                        #針對後面的說明
                        for($i=3;$i<$spiltString["dataCounts"];$i++){

                                #串接起來
                                $skipableVar[$key]["note"]=$skipableVar[$key]["note"].",".$spiltString["dataArray"][$i];

                                }#for end

                        }#foreach end

                #debug
                #var_dump($skipableVar);
                #exit;  

                #取得可省略參數的內容
                $result["skipableVar"]=$skipableVar;
                
                #初始化儲存參考資料的陣列
                $reference=array();

                #從 $result["referenceVarKeyStartPoint"] 元素往後讀,只讀取備註.
                for($i=$referenceVarKeyStartPoint+1;$i<$noteVarKeyStartPoint;$i++){

                        #另存每個可省略參數行
                        $reference[]=$result["functionComment"][$i];

                        }#for end

                #針對每一列
                foreach($reference as $key=>$line){

                        #剔除開頭的 "#"
                        #涵式說明:
                        #處理字串避免網頁出錯
                        #回傳的結果:
                        #$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
                        #$result["function"],當前執行的函數.
                        #$result["content"],爲處理好的字串.
                        #$result["error"],錯誤訊息陣列.
                        #$result["argu"],使用的參數. 
                        #必填參數:
                        $conf["stringProcess::correctCharacter"]["stringIn"]=$line;#爲要處理的字串
                        #可省略的參數:
                        $conf["stringProcess::correctCharacter"]["selectedCharacter"]=array("#");#爲被選擇要處理的字串/字元,須爲陣列值。
                                #若不設定則預設爲要將這些字串作替換 ("<",">","=","//","'","$","%","&","|","/*","*","#","\"").
                                #特殊字元,「\n」代表換行,「\t」代表tab鍵的間隔
                        #$conf["changeTo"]=array();#爲被選擇的字元要換成什麼字串/字元,須爲陣列值。若不設定,則預設爲更換成""(空字串).
                        #備註:
                        #無.
                        $correctCharacter=stringProcess::correctCharacter($conf["stringProcess::correctCharacter"]);
                        unset($conf["stringProcess::correctCharacter"]);

                        #如果執行失敗
                        if($correctCharacter["status"]==="false"){
                                
                                #設定執行錯誤識別
                                $result["status"]="false";
                                
                                #設定執行錯誤提示
                                $result["error"]=$correctCharacter;
                                
                                #回傳結果 
                                return $result;
                                
                                }#if end

        
                        #取得剔除開頭 # 的內容列
                        $reference[$key]=$correctCharacter["content"];

                        }#foreach end   

                #取得備註的內容
                $result["reference"]=$reference;
                
                #初始化儲存備註的陣列
                $note=array();

                #從 $result["noteVarKeyStartPoint"] 元素往後讀,只讀取備註.
                for($i=$noteVarKeyStartPoint+1;$i<count($result["functionComment"])-1;$i++){

                        #另存每個可省略參數行
                        $note[]=$result["functionComment"][$i];

                        }#for end

                #將 $result["functionComment"] 陣列變成字串.
                #函式說明:
                #將一維陣列轉換為用特定符號間隔的字串,ex:array("1","2","3") to "a;b;c;".
                #回傳的結果:
                #$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
                #$result["function"],當前執行的function名稱
                #$result["error"],錯誤訊息陣列.
                #$result["content"],處理好的字串.
                #$result["argu"],使用的參數.
                #必填參數:
                #$conf["inputArray"],字串陣列,要轉成字串的一維陣列.
                $conf["arrays::arrayToString"]["inputArray"]=$result["functionComment"];
                #可省略參數:
                #$conf["spiltSymbol"],字串,用來區隔字串的符號,預設為;
                $conf["arrays::arrayToString"]["spiltSymbol"]=PHP_EOL;
                #$conf["skipEnd"],字串,結尾是否不要加上符號,預設為"false",要加上符號,"true"代表不要加上符號。
                #$conf["skipEnd"]="";
                #參考資料:
                #無.
                #備註:
                #無.
                $arrayToString=arrays::arrayToString($conf["arrays::arrayToString"]);
                unset($conf["arrays::arrayToString"]);
                
                #如果執行失敗
                if($arrayToString["status"]==="false"){
                        
                        #設定執行錯誤識別
                        $result["status"]="false";
                        
                        #設定執行錯誤提示
                        $result["error"]=$arrayToString;
                        
                        #回傳結果 
                        return $result;
                        
                        }#if end

                #轉存為字串
                $result["functionComment"]=$arrayToString["content"];

                #針對每一列
                foreach($note as $key=>$line){

                        #剔除開頭的 "#"
                        #涵式說明:
                        #處理字串避免網頁出錯
                        #回傳的結果:
                        #$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
                        #$result["function"],當前執行的函數.
                        #$result["content"],爲處理好的字串.
                        #$result["error"],錯誤訊息陣列.
                        #$result["argu"],使用的參數. 
                        #必填參數:
                        $conf["stringProcess::correctCharacter"]["stringIn"]=$line;#爲要處理的字串
                        #可省略的參數:
                        $conf["stringProcess::correctCharacter"]["selectedCharacter"]=array("#");#爲被選擇要處理的字串/字元,須爲陣列值。
                                #若不設定則預設爲要將這些字串作替換 ("<",">","=","//","'","$","%","&","|","/*","*","#","\"").
                                #特殊字元,「\n」代表換行,「\t」代表tab鍵的間隔
                        #$conf["changeTo"]=array();#爲被選擇的字元要換成什麼字串/字元,須爲陣列值。若不設定,則預設爲更換成""(空字串).
                        #備註:
                        #無.
                        $correctCharacter=stringProcess::correctCharacter($conf["stringProcess::correctCharacter"]);
                        unset($conf["stringProcess::correctCharacter"]);

                        #如果執行失敗
                        if($correctCharacter["status"]==="false"){
                                
                                #設定執行錯誤識別
                                $result["status"]="false";
                                
                                #設定執行錯誤提示
                                $result["error"]=$correctCharacter;
                                
                                #回傳結果 
                                return $result;
                                
                                }#if end

        
                        #取得剔除開頭 # 的內容列
                        $note[$key]=$correctCharacter["content"];

                        }#foreach end   

                #取得備註的內容
                $result["note"]=$note;

                #初始化函式的程式內容.
                $result["content"]="";
                
                #針對函式的定義開始行,往後逐行執行.
                for($i=$result["functionStructionEndPoint"];$i<$fileContent["lineCount"];$i++){
                
                        #暫存該行程式的內容
                        $line=$fileContent["fileContent"][$i];
                
                        #如果無任何內容
                        if(empty($line)){
                        
                                #串接程式的內容
                                $result["content"]=$result["content"].$line;
                                
                                #換下一行
                                continue;
                        
                                }#if end
                
                        #判斷是否為函式定義的結束.
                        #函式說明:
                        #取得符合特定字首與字尾的字串
                        #回傳結果:
                        #$result["status"],若爲"true"則代表執行正常;若爲"false"則代表執行失敗。
                        #$result["function"],當前執行的函數名稱.
                        #$result["error"],錯誤訊息陣列.
                        #$result["founded"],若為"true"則代表有找到符合字首條件的結果;若爲"false"則代表沒有找到。
                        #$result["returnString"],爲符合字首條件的字串內容。
                        #$result["argu"],使用的參數.
                        #必填參數:
                        #$conf["checkString"],字串,要檢查的字串.
                        $conf["search::getMeetConditionsString"]["checkString"]=$line;
                        #可省略參數:
                        #$conf["frontWord"],字串,用來檢查字首應該要有什麼字串,預設不指定.
                        $conf["search::getMeetConditionsString"]["frontWord"]="\t\t}#function";
                        #$conf["tailWord"],字串,用來檢查字尾應該要有什麼字串,預設不指定.
                        #$conf["tailWord"]="";
                        #參考資料:
                        #str_spilt(),可以將字串依照字母分割成一個個陣列字串。
                        #備註:
                        #無.
                        $getMeetConditionsString=search::getMeetConditionsString($conf["search::getMeetConditionsString"]);
                        unset($conf["search::getMeetConditionsString"]);
                
                        #如果處理失敗
                        if($getMeetConditionsString["status"]==="false"){

                                #設置執行錯誤的識別
                                $result["status"]="false";

                                #設置執行錯誤的訊息
                                $result["error"]=$getMeetConditionsString;
                                
                                #回傳結果
                                return $result;
                        
                                }#if end
                        
                        #串接程式的內容
                        $result["content"]=$result["content"].$line;
                        
                        #如果找到函式的結尾
                        if($getMeetConditionsString["founded"]==="true"){

                                #跳出迴圈
                                break;
                        
                                }#if end
                
                        }#for end
                
                #值行到這邊執行成功
                $result["status"]="true";

                #回傳節果
                return $result;
                        
                }#function getFunctionConstruction end
        
        /*
        #函式說明:
        #取得多個函式的結構
        #回傳結果:
        #$result["status"],執行是否成功"true"代表執行成功,"false"代表執行失敗
        #$result["error"],錯誤訊息陣列
        #$result["function"],當前執行的函數名稱.
        #$result["comment"],每個函式說明的陣列
        #$result["argvType"],每個函式傳入參數型態的陣列,""表示不用參數
        #$result["returnVarType"],每個函式回傳變數型態的陣列,目前尚無法判斷其型態為string、int、float、double、boolean的哪一個,所以先一律視為"string"
        #$result["return"]["name"][$i],第$i+1個函式回傳變數名稱的陣列
        #$result["return"]["comment"][$i],第$i+1個函式回傳變數註解的陣列
        #$result["mustBeFilled"]["dataCount"][$j],第j+1個函式不可省略參數數量的陣列 
        #$result["optionalFilled"]["dataCount"][$k],第$k+1每個函式可省略參數數量的陣列
        #$result["mustBeFilled"]["name"][$j],第$j+1個函式不可省略參數的陣列
        #$result["mustBeFilled"]["comment"][$j],第$j+1個函式不可省略參數註解的陣列
        #$result["optionalFilled"]["name"][$k],第$k+1個函式可省略參數的陣列
        #$result["optionalFilled"]["comment"][$k],第$k+1個函式可省略參數註解的陣列
        #$result["reference"]["addr"][$l],第$l+1個函式參考資料網址的陣列
        #$result["reference"]["comment"][$l],第$l+1個函式參考資料說明的陣列
        #必填參數:
        #$conf["phpFileAddress"],字串,含有函式內容的php檔案位置與名稱
        $conf["phpFileAddress"]="";
        #$conf["functionName"],字串陣列,函式的名稱陣列.
        $conf["functionName"]="array("");
        #$conf["fileArgu"],字串,__FILE__的內容.
        $conf["fileArgu"]=__FILE__;
        #可省略參數:
        #無.
        #參考資料:
        #無.
        #備註:
        #目前尚未開發完畢.
        */
        public static function getMutiFunctionConstruction(&$conf){
                
                #初始化要回傳的內容
                $result=array();

                #取得當前函數的名稱
                $result["function"]=__FUNCTION__;

                #如果 $conf 不為陣列
                if(gettype($conf)!="array"){
                        
                        #設置執行失敗
                        $result["status"]="false";
                        
                        #設置執行錯誤訊息
                        $result["error"][]="\$conf變數須為陣列形態";

                        #如果傳入的參數為 null
                        if($conf==null){
                                
                                #設置執行錯誤訊息
                                $result["error"][]="\$conf變數不得為null,請檢查函數「".$result["function"]."」的參數設置有無正確!";
                                
                                }#if end

                        #回傳結果
                        return $result;
                        
                        }#if end
                
                #檢查參數
                #函式說明:
                #檢查陣列裡面的特定元素是否存在以及其變數型態是否正確,如果沒有設定則回傳提示訊息。
                #回傳結果:
                #$result["passed"],識別要檢查的全體變數是否存在以及型態是否正確的變數,"true"代表檢查全部通過;"false"代表檢查不通過
                #$result[$shouldBtCheckedVarName]["varExist"],所檢查的變數是否存在,"false"代表不存在;"true"代表存在
                #$result[$shouldBtCheckedVarName]["varType"],所檢查的變數型態是否正確,"false"代表錯誤;"true"代表正確
                #必填寫的參數:
                $conf["variableCheck"]["isexistMuti"]["varInput"]=$conf;#要檢查的陣列變數
                $conf["variableCheck"]["isexistMuti"]["variableCheck"]=array("phpFileAddress","functionName","fileArgu");#要檢查的變數名稱陣列,形態爲陣列變數,例如: $conf["variableCheck"] = array("id","account","password");
                #可以省略的參數:
                $conf["variableCheck"]["isexistMuti"]["variableType"]=array("string","array","string");#要檢查的陣列變數內的元素應該爲何種變數形態,形態爲陣列 例如: $conf[variableType] = array("string","int","double"); 
                $conf["variableCheck"]["isexistMuti"]["canBeEmptyString"]="true";#變數內容如果是空字串就不能算是有設置的話,請設為"false",預設為也算是有設置。
                $checkResult=variableCheck::isexistMulti($conf["variableCheck"]["isexistMuti"]);
                unset($conf["variableCheck"]["isexistMuti"]);
        
                # 如果 $checkResult["status"] 為 "fasle"
                if($checkResult["status"]=="false"){
                        
                        #設置執行錯誤的識別
                        $result["status"]="false";

                        #設置執行錯誤的訊息
                        $result["error"]=$checkResult;
                        
                        #回傳結果
                        return $result;
                        
                        }#if end
        
                # 如果 $checkResult["passed"] 為 "fasle"
                if($checkResult["passed"]=="false"){
                        
                        #設置執行錯誤的識別
                        $result["status"]="false";

                        #設置執行錯誤的訊息
                        $result["error"]=$checkResult;
                        
                        #回傳結果
                        return $result;
                        
                        }#if end
                        
                #針對每個要解析的函式
                foreach($conf["functionName"] as $functionName){
                                        
                        #debug
                        #var_dump($functionName);
                        
                        #如果涵式名稱是 "empty"
                        if($functionName==="empty"){
                        
                                #跳過
                                continue;
                        
                                }#if end
                                        
                        #函式說明:
                        #取得函式的結構
                        #回傳的結果:
                        #$result["status"],執行是否成功"true"代表執行成功,"false"代表執行失敗
                        #$result["error"],錯誤訊息陣列
                        #$result["comment"],函式說明
                        #$result["argvType"],傳入參數的型態,null表示不用參數
                        #$result["returnVarType"],回傳的變數型態,目前尚無法判斷其型態為string、int、float、double、boolean的哪一個,所以先一律視為"string"
                        #$result["return"]["name"],回傳的變數名稱
                        #$result["return"]["comment"],回傳的變數註解
                        #$result["mustBeFilled"]["dataCount"],不可省略的參數陣列元素數量 
                        #$result["optionalFilled"]["dataCount"],可省略的參數陣列元素數量
                        #$result["mustBeFilled"]["name"],不可省略的參數陣列
                        #$result["mustBeFilled"]["comment"],不可省略的參數註解陣列
                        #$result["optionalFilled"]["name"],可省略的參數陣列
                        #$result["optionalFilled"]["comment"],可省略的參數註解陣列
                        #$result["reference"]["addr"],參考資料的網址
                        #$result["reference"]["comment"],參考資料的說明
                        #必填參數:
                        $conf["phpLib"]["getFunctionConstruction"]["phpFileAddress"]=$conf["phpFileAddress"];#含有函式內容的php檔案位置與名稱
                        $conf["phpLib"]["getFunctionConstruction"]["functionName"]=$functionName;#函式的名稱
                        $conf["phpLib"]["getFunctionConstruction"]["fileArgu"]=$conf["fileArgu"];#函式的名稱
                        #備註:目前尚未開發完畢
                        $functionConstruction=phpLib::getFunctionConstruction($conf["phpLib"]["getFunctionConstruction"]);
                        #var_dump($conf["phpLib"]["getFunctionConstruction"]);
                        unset($conf["phpLib"]["getFunctionConstruction"]);
                        
                        #如果執行失敗
                        if($functionConstruction["status"]==="false"){
                        
                                #設置執行錯誤的識別
                                $result["status"]="false";

                                #設置執行錯誤的訊息
                                $result["error"]=$functionConstruction;
                                
                                #回傳結果
                                return $result;
                        
                                }#if end
                        
                        #debug
                        #var_dump($functionConstruction);
                        #exit;
                        
                        #取得函式說明
                        $result["comment"][]=$functionConstruction["comment"];
                        
                        #取得函式傳入參數型態
                        $result["argvType"][]=$functionConstruction["argvType"];
                        
                        #取得函式回傳變數型態
                        $result["returnVarType"][]=$functionConstruction["returnVarType"];
                
                        #取得函式回傳變數名稱陣列
                        $result["return"]["name"][]=$functionConstruction["return"]["name"];
                        
                        #取得函式回傳變數註解陣列
                        $result["return"]["comment"][]=$functionConstruction["return"]["comment"];
                        
                        }#foreach end           
                
                #執行到這邊代表執行成功
                
                #設置執行成功的識別
                $result["status"]="true";
                
                #回傳結果
                return $result;
                
                }#function getMutiFunctionConstruction end
                
        /*
        #函式說明:
        #提供將含有類別宣告的php檔案轉成類別圖的功能
        #回傳結果:
        #$result["status"],執行是否成功,"true"代表執行成功;"false"代表執行失敗。
        #$result["error"],錯誤訊息陣列.
        #$result["error"]["noFunction"],若為"true"則代表檔案裡面沒有涵式.
        #$result["function"],當前執行的函數名稱.
        #$result["diagramCode"],類別圖的網頁code
        #必填參數:
        #$conf["phpFileAddress"],字串,含有宣告類別的php檔案
        $conf["phpFileAddress"]="";
        #$conf["fileArgu"],字串,__FILE__的內容.
        $conf["fileArgu"]=__FILE__;
        #可省略參數:
        #無.
        #參考資料:
        #無.
        #備註:
        #無.
        */
        public static function classDiagramMaker(&$conf){
                
                #初始化要回傳的內容
                $result=array();

                #取得當前函數的名稱
                $result["function"]=__FUNCTION__;

                #如果 $conf 不為陣列
                if(gettype($conf)!="array"){
                        
                        #設置執行失敗
                        $result["status"]="false";
                        
                        #設置執行錯誤訊息
                        $result["error"][]="\$conf變數須為陣列形態";

                        #如果傳入的參數為 null
                        if($conf==null){
                                
                                #設置執行錯誤訊息
                                $result["error"][]="\$conf變數不得為null,請檢查函數「".$result["function"]."」的參數設置有無正確!";
                                
                                }#if end

                        #回傳結果
                        return $result;
                        
                        }#if end
                
                #初始化要暫存的函式結構陣列
                $functionConstruction=array();
                
                #參數檢查
                #檢查參數
                #函式說明:
                #檢查陣列裡面的特定元素是否存在以及其變數型態是否正確,如果沒有設定則回傳提示訊息。
                #回傳結果:
                #$result["passed"],識別要檢查的全體變數是否存在以及型態是否正確的變數,"true"代表檢查全部通過;"false"代表檢查不通過
                #$result[$shouldBtCheckedVarName]["varExist"],所檢查的變數是否存在,"false"代表不存在;"true"代表存在
                #$result[$shouldBtCheckedVarName]["varType"],所檢查的變數型態是否正確,"false"代表錯誤;"true"代表正確
                #必填寫的參數:
                $conf["variableCheck"]["isexistMuti"]["varInput"]=$conf;#要檢查的陣列變數
                $conf["variableCheck"]["isexistMuti"]["variableCheck"]=array("phpFileAddress","fileArgu");#要檢查的變數名稱陣列,形態爲陣列變數,例如: $conf["variableCheck"] = array("id","account","password");
                #可以省略的參數:
                $conf["variableCheck"]["isexistMuti"]["variableType"]=array("string","string");#要檢查的陣列變數內的元素應該爲何種變數形態,形態爲陣列 例如: $conf[variableType] = array("string","int","double"); 
                $conf["variableCheck"]["isexistMuti"]["canBeEmptyString"]="false";#變數內容如果是空字串就不能算是有設置的話,請設為"false",預設為也算是有設置。
                $checkResult=variableCheck::isexistMulti($conf["variableCheck"]["isexistMuti"]);
                unset($conf["variableCheck"]["isexistMuti"]);
        
                #如果 $checkResult["status"] 為 "fasle"
                if($checkResult["status"]==="false"){
                        
                        #設置執行錯誤的識別
                        $result["status"]="false";

                        #設置執行錯誤的訊息
                        $result["error"]=$checkResult;
                        
                        #回傳結果
                        return $result;
                        
                        }#if end
        
                #如果 $checkResult["passed"] 為 "fasle"
                if($checkResult["passed"]==="false"){
                        
                        #設置執行錯誤的識別
                        $result["status"]="false";

                        #設置執行錯誤的訊息
                        $result["error"]=$checkResult;
                        
                        #回傳結果
                        return $result;
                        
                        }#if end
                                
                #函數說明:
                #延長php的執行時間,每呼叫一次會初始化執行時間爲0,然後設定下次可以執行多久.
                #回傳結果:
                #$result["status"],執行是否正常,"true"為正常,"false"為不正常.
                #$result["error"],錯誤訊息陣列.
                #$result["function"],當前執行的函數名稱.
                #必填參數:
                #$conf["sec"],整數,要延長多少執行時間,單位爲秒
                $conf["config::delayRunTimeExectionMax"]["sec"]=300;
                #參考資料:
                #http://php.net/manual/en/function.set-time-limit.php
                $delayRunTimeExectionMax=config::delayRunTimeExectionMax($conf["config::delayRunTimeExectionMax"]);
                unset($conf["config::delayRunTimeExectionMax"]);
                
                #如果執行失敗
                if($delayRunTimeExectionMax["status"]==="false"){
                
                        #設定類別圖繪製失敗
                        $result["status"]="false";                      
                                                
                        #設定該檔案的類別圖繪製失敗提示
                        $result["error"]=$delayRunTimeExectionMax;
                        
                        #回傳結果
                        return $result;
                
                        }#if end                
                                        
                #函式說明:
                #取得php函式庫檔案裡面的結構
                #回傳的結果:
                #$result["status"],0表示取得成功;1表示取得失敗
                #$result["namesapceCount"],命名空間的筆數
                #$result["classCount"],類別的筆數
                #$result["functionCount"],函式的筆數
                #$result["namespace"],命名空間陣列 
                #$result["class"],類別的陣列
                #$result["function"],函式的陣列
                #必填參數:
                $conf["phpLib"]["getPhpLibConstruction"]["libFileAddress"]=$conf["phpFileAddress"];#要讀取的函式庫檔案位置
                $conf["phpLib"]["getPhpLibConstruction"]["fileArgu"]=$conf["fileArgu"];
                $classConstruction=phpLib::getPhpLibConstruction($conf["phpLib"]["getPhpLibConstruction"]);
                unset($conf["phpLib"]["getPhpLibConstruction"]);
                
                #如果 $classConstruction["status"] 為 "fasle"
                if($classConstruction["status"]==="false"){
                        
                        #設置執行錯誤的識別
                        $result["status"]="false";

                        #設置執行錯誤的訊息
                        $result["error"]=$classConstruction;
                        
                        #回傳結果
                        return $result;
                        
                        }#if end                        
                
                #如果裡面沒有函式
                if($classConstruction["functionCount"]===0){
                
                        #設置只有一個叫做emtpy的函數
                        $classConstruction["functions"][]["content"]="empty";
                
                        }#if end
                        
                #初始化記錄所有函數名稱
                $funcs=array();
                        
                #針對每個既有的函數名稱
                foreach($classConstruction["functions"] as $funcStr){
                
                        #記錄函數名稱
                        $funcs[]=$funcStr["content"];
                
                        }#foreach end           
                
                #取得每個函式的結構
                #函式說明:
                #取得多個函式的結構
                #回傳的結果:
                #$result["status"],執行是否成功"true"代表執行成功,"false"代表執行失敗
                #$result["error"],錯誤訊息陣列
                #$result["comment"],每個函式說明的陣列
                #$result["argvType"],每個函式傳入參數型態的陣列,null表示不用參數
                #$result["returnVarType"],每個函式回傳變數型態的陣列,目前尚無法判斷其型態為string、int、float、double、boolean的哪一個,所以先一律視為"string"
                #$result["return"]["name"][$i],第$i+1個函式回傳變數名稱的陣列
                #$result["return"]["comment"][$i],第$i+1個函式回傳變數註解的陣列
                #$result["mustBeFilled"]["dataCount"][$j],第j+1個函式不可省略參數數量的陣列 
                #$result["optionalFilled"]["dataCount"][$k],第$k+1每個函式可省略參數數量的陣列
                #$result["mustBeFilled"]["name"][$j],第$j+1個函式不可省略參數的陣列
                #$result["mustBeFilled"]["comment"][$j],第$j+1個函式不可省略參數註解的陣列
                #$result["optionalFilled"]["name"][$k],第$k+1個函式可省略參數的陣列
                #$result["optionalFilled"]["comment"][$k],第$k+1個函式可省略參數註解的陣列
                #$result["reference"]["addr"][$l],第$l+1個函式參考資料網址的陣列
                #$result["reference"]["comment"][$l],第$l+1個函式參考資料說明的陣列
                #必填參數:
                $conf["phpLib"]["getMutiFunctionConstruction"]["phpFileAddress"]=$conf["phpFileAddress"];#含有函式內容的php檔案位置與名稱
                $conf["phpLib"]["getMutiFunctionConstruction"]["functionName"]=$funcs;#函式的名稱
                $conf["phpLib"]["getMutiFunctionConstruction"]["fileArgu"]=$conf["fileArgu"];
                #備註:目前尚未開發完畢
                $functionConstruction=phpLib::getMutiFunctionConstruction($conf["phpLib"]["getMutiFunctionConstruction"]);
                 
                #如果 $classConstruction["status"] 為 "fasle"
                if($functionConstruction["status"]==="false"){
                        
                        #設置執行錯誤的識別
                        $result["status"]="false";

                        #設置執行錯誤的訊息
                        $result["error"]=$functionConstruction;
                        
                        #回傳結果
                        return $result;
                        
                        }#if end                
                 
                #debug
                #var_dump($functionConstruction); 
                 
                #由於每個函式都沒有指定屬性,所以都為public的函式
                                        
                #函式說明:
                #建立一個陣列,可以指派陣列的內容,然後回傳
                #回傳的結果:
                #$result,爲陣列變數內容
                #必填參數:
                $conf["arrays"]["create"]["arrayContent"]=array("+");#陣列元素的內容,須爲陣列值。
                #可省略的參數:
                $conf["arrays"]["create"]["arrayCounts"]=count($classConstruction["functions"]);#爲陣列的元素有幾個,若沒設定,則數量爲$conf["arrayContent"]裏的元素數量
                $conf["arrays"]["create"]["theSameAs"]="true";#若設爲"true",則所有元素內容都跟第一個元素內容相同
                $functionTypeArray=arrays::create($conf["arrays"]["create"]);
                unset($conf["arrays"]["create"]);
                
                #var_dump($functionTypeArray);
                #var_dump($classConstruction["class"][0]);
                #exit;
                
                #如果不存在 $classConstruction["class"][0]
                if(!isset($classConstruction["class"][0])){
                
                        #設置為 "empty"
                        $classConstruction["class"][0]["content"]="empty";
                
                        }#if end
                        
                #如果不存在 $functionConstruction["argvType"]
                if(!isset($functionConstruction["argvType"])){
                
                        #設置為 "array"
                        $functionConstruction["argvType"][0]="array";
                
                        }#if end

                #如果不存在 $functionConstruction["returnVarType"]
                if(!isset($functionConstruction["returnVarType"])){
                
                        #設置為 "array"
                        $functionConstruction["returnVarType"][0]="array";
                
                        }#if end
                
                #var_dump($classConstruction["functions"]);
                #exit;
                
                #建立類別圖表格
                #函式說明:
                #依據類別的名稱、裡面的函式存限制、函式名稱、函式參數、函式回傳型態來建立類別圖表格
                #回傳結果:
                #$result["status"],執行是否成功,"true"代表執行成功;"false"代表執行失敗。
                #$result["error"],錯誤訊息陣列
                #$result["classDiagramTable"],類別圖的網頁code
                #必填參數:
                $conf["table"]["classDiagramTable"]["className"]=$classConstruction["class"][0]["content"];#類別的名稱
                $conf["table"]["classDiagramTable"]["functionOpenAccessType"]=$functionTypeArray;#函式存取的限制,每個元素代表一個函式的設定,"+"代表開放存取
                $conf["table"]["classDiagramTable"]["functionName"]=$classConstruction["functions"];#各函式的名稱,每個元素代表一個函式的名稱
                $conf["table"]["classDiagramTable"]["functionArgv"]=$functionConstruction["argvType"];#各函式的傳入參數型態,每個元素代表一個函式的入參數型態,""代表沒有傳入參數;
                $conf["table"]["classDiagramTable"]["functionReturnType"]=$functionConstruction["returnVarType"];#各函式回傳的型態,每個元素代表一個函式回傳的型態,"void"代表沒有回傳變數
                $createClassDiagramTableResult=table::classDiagramTable($conf["table"]["classDiagramTable"]);
                unset($conf["table"]["classDiagramTable"]);
                 
                #如果類別圖表格建立失敗
                if($createClassDiagramTableResult["status"]==="false"){

                        #設置執行錯誤的識別
                        $result["status"]="false";
                        
                        #設置錯誤訊息提示
                        $result["error"]=$createClassDiagramTableResult["error"];
                        
                        #回傳結果
                        return $result;
                        
                        }#if end
                 
                #取得類別圖的html內容   
                $result["diagramCode"]=$createClassDiagramTableResult["classDiagramTable"];
                
                #執行到這邊代表執行成功
                $result["status"]="true";
                
                #回傳結果 
                return $result;
                                         
                }#function classDiagramMaker end
                
        /*
        #函式說明:
        #提供將目標目錄裡的所有php檔案轉成類別圖的功能
        #回傳結果:
        #$result["status"],執行是否成功,"true"代表執行成功;"false"代表執行失敗。
        #$result["error"],錯誤訊息陣列
        #$result["function"],當前執行的函數名稱.
        #$result["diagramCode"][$i],第$i+1個類別圖的網頁code
        #必填參數:
        #$conf["phpDirAddress"],字串,含有宣告類別的php檔案目錄,""代表當前目錄。
        $conf["phpDirAddress"]="";
        #$conf["fileArgu"],字串,__FILE__的內容.
        $conf["fileArgu"]=__FILE__;
        #可省略參數:
        #無.
        #參考資料:
        #無.
        #備註:
        #有bug...
        */
        public static function classDiagramsMaker(&$conf){
                
                #初始化要回傳的內容
                $result=array();

                #取得當前函數的名稱
                $result["function"]=__FUNCTION__;

                #如果 $conf 不為陣列
                if(gettype($conf)!="array"){
                        
                        #設置執行失敗
                        $result["status"]="false";
                        
                        #設置執行錯誤訊息
                        $result["error"][]="\$conf變數須為陣列形態";

                        #如果傳入的參數為 null
                        if($conf==null){
                                
                                #設置執行錯誤訊息
                                $result["error"][]="\$conf變數不得為null,請檢查函數「".$result["function"]."」的參數設置有無正確!";
                                
                                }#if end

                        #回傳結果
                        return $result;
                        
                        }#if end
                
                #參數檢查
                #檢查參數
                #函式說明:
                #檢查陣列裡面的特定元素是否存在以及其變數型態是否正確,如果沒有設定則回傳提示訊息。
                #回傳結果:
                #$result["passed"],識別要檢查的全體變數是否存在以及型態是否正確的變數,"true"代表檢查全部通過;"false"代表檢查不通過
                #$result[$shouldBtCheckedVarName]["varExist"],所檢查的變數是否存在,"false"代表不存在;"true"代表存在
                #$result[$shouldBtCheckedVarName]["varType"],所檢查的變數型態是否正確,"false"代表錯誤;"true"代表正確
                #必填寫的參數:
                $conf["variableCheck"]["isexistMuti"]["varInput"]=$conf;#要檢查的陣列變數
                $conf["variableCheck"]["isexistMuti"]["variableCheck"]=array("phpDirAddress","fileArgu");#要檢查的變數名稱陣列,形態爲陣列變數,例如: $conf["variableCheck"] = array("id","account","password");
                #可以省略的參數:
                $conf["variableType"]=array("string","string");#要檢查的陣列變數內的元素應該爲何種變數形態,形態爲陣列 例如: $conf[variableType] = array("string","int","double"); 
                $conf["variableCheck"]["isexistMuti"]["canBeEmptyString"]="false";#變數內容如果是空字串就不能算是有設置的話,請設為"false",預設為也算是有設置。
                $checkResult=variableCheck::isexistMulti($conf["variableCheck"]["isexistMuti"]);
                unset($conf["variableCheck"]["isexistMuti"]);
        
                #如果 $checkResult["status"] 為 "fasle"
                if($checkResult["status"]=="false"){
                        
                        #設置執行錯誤的識別
                        $result["status"]="false";

                        #設置執行錯誤的訊息
                        $result["error"]=$checkResult;
                        
                        #回傳結果
                        return $result;
                        
                        }#if end
                        
                #如果 $checkResult["passed"] 為 "fasle"
                if($checkResult["passed"]=="false"){
                        
                        #設置執行錯誤的識別
                        $result["status"]="false";

                        #設置執行錯誤的訊息
                        $result["error"]=$checkResult;
                        
                        #回傳結果
                        return $result;
                        
                        }#if end
                        
                #取得目標目錄底下的php檔案
                #函式說明:
                #取得目錄底下函式庫檔案清單
                #回傳的結果:
                #$result["status"],0表示有清單;1表示沒有清單
                #$result["dataCount"],有幾筆符合的資料
                #$result["neededList"],符合條件的檔案清單              
                #必填參數:
                $conf["phpLib"]["getLibFileList"]["folderAddress"]=$conf["phpDirAddress"];#要讀取的函式庫目錄
                #$conf["fileArgu"],字串__FILE__的內容.
                $conf["phpLib"]["getLibFileList"]["fileArgu"]=$conf["fileArgu"];
                #可省略的參數:
                $conf["phpLib"]["getLibFileList"]["readFileType"]=array("php");#要讀取具有該陣列底下副檔名的檔案
                #$conf["excludeFile"],陣列,要忽略的檔案.
                $conf["phpLib"]["getLibFileList"]["excludeFile"]=array("allInOne.php");
                $phpLib_getLibFileList=phpLib::getLibFileList($conf["phpLib"]["getLibFileList"]);
                unset($conf["phpLib"]["getLibFileList"]);
                
                #debug
                #var_dump($phpLib_getLibFileList);
                #exit;
                
                #如果執行失敗
                if($phpLib_getLibFileList["status"]==="false"){
                        
                        #設定執行失敗
                        $result["status"]="false";
                        
                        #設置錯誤訊息
                        $result["error"]="目標目錄下沒有任何php檔案";
                        
                        #回傳結果
                        return $result;
                        
                        }#if end
                
                #如果 $phpLib_getLibFileList["dataCount"] 等於 0,則代表目標目錄底下沒有php檔案。
                if($phpLib_getLibFileList["dataCount"]===0){
                        
                        #設定執行失敗
                        $result["status"]="false";
                        
                        #設置錯誤訊息
                        $result["error"]="目標目錄下沒有任何php檔案";
                        
                        #回傳結果
                        return $result;
                        
                        }#if end
                        
                #var_dump($phpLib_getLibFileList);
                        
                #根據每個php檔案
                for($i=0;$i<$phpLib_getLibFileList["dataCount"];$i++){
                        
                        #取得其類別函式結構
                        #函式說明:
                        #提供將含有類別宣告的php檔案轉成類別圖的功能
                        #回傳結果:
                        #$result["status"],執行是否成功,"true"代表執行成功;"false"代表執行失敗。
                        #$result["error"],錯誤訊息陣列
                        #$result["diagramCode"],類別圖的網頁code
                        #必填參數:
                        $conf["phpLib"]["classDiagramMaker"]["phpFileAddress"]=$conf["phpDirAddress"].$phpLib_getLibFileList["neededList"][$i];#含有宣告類別的php檔案
                        $conf["phpLib"]["classDiagramMaker"]["fileArgu"]=$conf["fileArgu"];
                        $classDiagram["diagramCode"][$i]=phpLib::classDiagramMaker($conf["phpLib"]["classDiagramMaker"]);
                        unset($conf["phpLib"]["classDiagramMaker"]);
                        
                        #如果該檔案的類別圖取得失敗
                        if($classDiagram["diagramCode"][$i]["status"]=="false"){
                                
                                #設定類別圖繪製失敗
                                $result["status"]="false";
                                
                                #設定錯誤訊息
                                $result["error"]=$classDiagram;
                                
                                #設定該檔案的類別圖繪製失敗提示
                                $result["error"][]="無法正確取得".$phpLib_getLibFileList["neededList"][$i]."檔案裡面的類別結構或該檔案非類別檔案";
                                
                                #回傳結果
                                return $result;
                                
                                }#if end
                                
                        #取得類別圖表格htmlCode
                        $result["diagramCode"][]=$classDiagram["diagramCode"][$i]["diagramCode"];       
                        
                        }#for end
                        
                #執行到這邊代表執行成功
                $result["status"]="true";
                
                #回傳結果
                return $result; 
                
                }#function classDiagramsMaker end
                
        /*
        #函式說明:
        #更新程式檔案開頭版權宣告的年份,以及作者清單,取得更新過後的檔案路徑.
        #回傳結果:
        #$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
        #$reuslt["error"],執行不正常結束的錯訊息陣列.
        #$result["function"],當前執行的函式名稱.
        #$result["argu"],本函式使用的參數.
        #$result["content"],有更新的檔案清單,其元素有被取代的檔案路徑與名稱跟replacedInfo,其中replacedInfo為陣列,其key為要變動的行號(從0開始算),其數值有"from"代表要被取代的原始內容,"to"代表要置換成的新內容.
        #$result["scannedFile"],陣列,有檢查過的檔案清單其完整路徑與檔案名稱.
        #必填參數:
        #$conf["fileArgu"],字串,php變數__FILE__的內容,亦即該檔案在檔案系統的絕對路徑
        $conf["fileArgu"]=__FILE__;
        #可省略參數:
        #$conf["replaceFrom"],陣列,目標關鍵字,每個元素代表一行的內容,預設內容可參照本檔案開頭的版權宣告文字.
        #$conf["replaceFrom"]=array();
        #$conf["yearFrom],字串,起始年份,預設為西元"2014"年.
        #$conf["yearFrom"]="2014";
        #$conf["yearTo],字串,結束年份,預設為西元"gmdate('Y')"年.
        #$conf["yearTo"]=gmdate('Y');
        #$conf["Authors"],陣列,該套件的參與者,預設為array("MIN-ZHI, CHEN");
        #$conf["Authors"]=array("MIN-ZHI, CHEN");
        #$conf["searchPath"],陣列,要搜尋哪些地方的檔案要更新版權宣告年份,預設為使用中的本套件位置.
        #$conf["searchPath"]=array("");
        #$conf["skipHiddenFolder"],字串,要略過隱藏的資料夾,預設為"true";反之為"false";
        #$conf["skipHiddenFolder"]="true";
        #$conf["includeHiddenFolder"],陣列,符合名稱的隱藏資料夾會存取,預設不指定;
        #$conf["includeHiddenFolder"]=array("");
        #$conf["excludeDirName"],陣列,哪些目錄名稱要忽略,預設有"free-lib"、"no-free-lib"、"composer".
        #$conf["excludeDirName"]=array("free-lib","no-free-lib","composer");
        #$conf["excludeMineType"],陣列,哪些檔案類型要忽略,預設有"image/*"、"video/*"、"audio/*"、"media/*"、"application/*".
        #$conf["excludeMineType"]=array("image/*","video/*","audio/*","media/*","application/*");
        #$conf["excludeSecondName"],陣列,哪些附檔名的檔案要忽略,預設有"log"、"csv"、"sql"、"js"、"css"、"html".
        #$conf["excludeSecondName"]=array("log"、,"csv","sql","js","css","html");
        #$conf["multiThread"],字串,是否要啟用多執行序,預設為"false",反之為"true".
        #$conf["multiThread"]="false";
        #$conf["threadType"],字串,當"multiThread"參數為"true"時,要使用的threas類型,預設為"socket",其他可能有"proc".
        #$conf["threadType"]="socket";
        #$conf["socket"],字串,unix domain socket 的位置與名稱,預設為 qbpwcf_usock_path;
        #$conf["socket"]=qbpwcf_usock_path;
        #$conf["log"],字串,log的檔案位置與名稱,預設不使用.
        #$conf["log"]="";
        #$conf["outputPath"],字串,更新後的檔案內容要存放到哪個路徑低下,預設為 /tmp 底下.
        #$conf["outputPath"]="";
        #參考資料:
        #無.
        #備註:
        #建構中...
        */
        public static function updateCopyRightYear(&$conf){
        
                #初始化要回傳的結果
                $result=array();

                #取得當前執行的函數名稱
                $result["function"]=__FUNCTION__;

                #如果沒有參數
                if(func_num_args()==0){

                        #設置執行失敗
                        $result["status"]="false";

                        #設置執行錯誤訊息
                        $result["error"]="函數".$result["function"]."需要參數";

                        #回傳結果
                        return $result;

                        }#if end

                #取得參數
                $result["argu"]=$conf;
                
                #debug,break point.
                #var_dump(__LINE__,$result);exit(1);

                #如果 $conf 不為陣列
                if(gettype($conf)!=="array"){

                        #設置執行失敗
                        $result["status"]="false";

                        #設置執行錯誤訊息
                        $result["error"][]="\$conf變數須為陣列形態";

                        #如果傳入的參數為 null
                        if(is_null($conf)){

                                #設置執行錯誤訊息
                                $result["error"][]="\$conf變數不得為null,請檢查函數「".$result["function"]."」的參數設置有無正確!";

                                }#if end

                        #回傳結果
                        return $result;

                        }#if end
                
                #設置要取代的內容關鍵字陣列 - start
                
                $replaceFromArray=array();
                
                $replaceFromArray[]="        QBPWCF, Quick Build PHP website Component base on Fedora Linux.";
                
                $replaceFromArray[]="    Copyright (C) \${yearFrom}~\${yearTo} \${Authors}";
                
                $replaceFromArray[]="";
                
                $replaceFromArray[]="    This file is part of QBPWCF.";
                
                $replaceFromArray[]="";
                
                $replaceFromArray[]="    QBPWCF is free software: you can redistribute it and/or modify";
                
                $replaceFromArray[]="    it under the terms of the GNU General Public License as published by";
                
                $replaceFromArray[]="    the Free Software Foundation, either version 3 of the License, or";
                
                $replaceFromArray[]="    (at your option) any later version.";

                $replaceFromArray[]="";
                
                $replaceFromArray[]="    QBPWCF is distributed in the hope that it will be useful,";
                
                $replaceFromArray[]="    but WITHOUT ANY WARRANTY; without even the implied warranty of";
                
                $replaceFromArray[]="    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the";

                $replaceFromArray[]="    GNU General Public License for more details.";
                
                $replaceFromArray[]="";
                
                $replaceFromArray[]="    You should have received a copy of the GNU General Public License";
                
                $replaceFromArray[]="    along with QBPWCF.  If not, see <http://www.gnu.org/licenses/>.";
                
                #設置要取代的內容關鍵字陣列 - end
                
                #函式說明:
                #取得檔案路徑字串的路徑與檔案的名稱與檔案副檔名
                #回傳的結果:
                #$result["status"],執行是否正常,"true"正常,"false"代表不正常.
                #$result["error"],錯誤訊息.
                #$result["function"],當前執行的函式名稱.
                #$result["filePath"],路徑字串.
                #$result["fileName"],檔案名稱字串.
                #$result["fileExtention"],檔案的副檔名.
                #$result["fullFileName"],含副檔名的檔案名稱.
                #$result["fullFilePathAndName"],完整的檔案路徑(含副檔名).
                #必填參數:
                #$conf["fileAddressAndName"],字串,檔案名稱與其路徑.
                $conf["fileAccess::getFileAddressAndNameAndFileExtention"]["fileAddressAndName"]=__FILE__;
                #可省略參數:
                #無.
                #參考資料:
                #無.
                #備註:
                #無.
                $getFileAddressAndNameAndFileExtention=fileAccess::getFileAddressAndNameAndFileExtention($conf["fileAccess::getFileAddressAndNameAndFileExtention"]);
                unset($conf["fileAccess::getFileAddressAndNameAndFileExtention"]);
                
                #如果執行失敗
                if($getFileAddressAndNameAndFileExtention["status"]==="false"){
                        
                        #設置錯誤識別
                        $result["status"]="false";
                        
                        #設置錯誤訊息
                        $result["error"]=$getFileAddressAndNameAndFileExtention;
                        
                        #回傳結果
                        return $result;
                        
                        }#if end
                
                #取得當前使用套件的路徑
                $libPath=$getFileAddressAndNameAndFileExtention["filePath"]."../../../";
                
                #debug,break point.
                #var_dump(__LINE__,$libPath);exit(1);
                
                #函式說明:
                #將檔案目錄的絕對位置中的 "../" 剔除變成直觀的路徑.
                #回傳結果:
                #$result["status"],執行是否成功,"true"代表執行成功,"false"代表執行失敗.
                #$result["function"],當前執行的函數.
                #$result["error"],錯誤訊息陣列.
                #$result["argu"],使用者參數.
                #$result["changedPath"],處理完後回傳的目錄字串.
                #$result["oriPath"],原始的路徑字串
                #必填參數:
                #$conf["dirStr"],字串,要處理的檔案目錄字串.
                $conf["stringProcess::changeDirByDotDotSolidus"]["dirStr"]=$libPath;
                #可省略參數:
                #無.
                #參考資料:
                #無.
                #備註:
                #考慮用realpath取代
                $changeDirByDotDotSolidus=stringProcess::changeDirByDotDotSolidus($conf["stringProcess::changeDirByDotDotSolidus"]);
                unset($conf["stringProcess::changeDirByDotDotSolidus"]);
                
                #如果執行失敗
                if($changeDirByDotDotSolidus["status"]==="false"){
                        
                        #設置錯誤識別
                        $result["status"]="false";
                        
                        #設置錯誤訊息
                        $result["error"]=$changeDirByDotDotSolidus;
                        
                        #回傳結果
                        return $result;
                        
                        }#if end
                
                #取得直觀的絕對路徑
                $libRootPath=$changeDirByDotDotSolidus["changedPath"];
                
                #取得 lib folder
                exec("php -f ".escapeshellarg(pathinfo(__FILE__)["dirname"]."/../../bin/libexec/folderOfUsrLib.php"),$output,$status);

                #如果執行失敗
                if($status!==0){

                        #debug
                        var_dump(__LINE__,$output);

                        #結束執行,回傳shell 1.
                        exit(1);

                        }#if end

                #儲存 lib folder
                $folderOfUsrLib=$output[0];
                
                #儲存 lib path
                #$libPath=$libRootPath."/usr/".$folderOfUsrLib;
                
                #debug
                #var_dump(__LINE__,$libPath);exit(1);
                
                #函式說明:
                #使用 linux 的 uuid 指令來產生 uuid 字串
                #回傳結果:
                #$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
                #$result["error"],錯誤訊息.
                #$result["function"],當前執行的函式名稱.
                #$result["content"],uuid.
                #必填參數:
                #無.
                #可省略參數:
                #無.
                #參考資料:
                #無.
                #備註:
                #無.
                $uuid=cmd::uuid();

                #如果執行失敗
                if($uuid["status"]==="false"){

                        #debug
                        var_dump($uuid);
                        
                        #結束執行回傳代碼1給shell
                        exit(1);

                        }#if end
                
                #預設的輸出目錄
                $outputPath="/tmp/".$uuid["content"]."-phpLib::updateCopyRightYear/";
                
                #檢查參數
                #函式說明:
                #檢查必填與可省略的參數,可省略參數可指定預設要給與什麼數值內容.
                #回傳結果:
                #$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
                #$result["error"],執行不正常結束的錯訊息陣列.
                #$result["simpleError"],簡單表示的錯誤訊息.
                #$result["function"],當前執行的函式名稱.
                #$result["argu"],設置給予的參數.
                #$result["passed"],識別要檢查的全體變數是否存在以及型態是否正確的變數,"true"代表檢查全部通過;"false"代表檢查不通過
                #$result[$shouldBeCheckedVarName]["varExist"],所檢查的變數是否存在,"false"代表不存在;"true"代表存在
                #$result[$shouldBeCheckedVarName]["varType"],所檢查的變數型態是否正確,"false"代表錯誤;"true"代表正確
                #$result[$shouldBeCheckedVarName]["error"],每個參數設定的錯誤訊息
                #$result["shouldNotBeEmpty"],不應該為空字串或控陣列的變數.
                #$result["argu"],字串陣列,目前輸入的參數名稱陣列.
                #$result["legalVarName"],字串陣列,合法可用的參數名稱陣列.
                #$result["notNeedVar"],字串陣列,多餘的參數名稱.
                #必填參數:
                #$conf["varInput"],陣列變數,要檢查的陣列變數,請在要檢查的參數前面加上&,這樣變動的結果才能被套用。
                $conf["variableCheck::checkArguments"]["varInput"]=&$conf;
                #$conf["referenceVarKey"],字串,$conf參數後面的key值,用於移除不要的參考陣列.
                $conf["variableCheck::checkArguments"]["referenceVarKey"]="variableCheck::checkArguments";
                #可省略參數:
                #$conf["mustBeFilledVariableName"],爲必填參數的變數名稱陣列,形態爲陣列變數,元素數量需要跟"mustBeFilledVariableType"參數的元素數量一致,例如: $conf["mustBeFilledVariableName"] = array("id","account","password");
                $conf["variableCheck::checkArguments"]["mustBeFilledVariableName"]=array("fileArgu");
                #$conf["mustBeFilledVariableType"],爲必填參數的變數陣列應該爲何種變數形態,形態爲陣列,元素數量需要跟"mustBeFilledVariableName"參數的元素數量一致,例如: $conf["mustBeFilledVariableType"] = array("string",integer,"double","resource","object"); , null、any代表不指定變數形態.其中 resource也包含"resource (closed)".
                $conf["variableCheck::checkArguments"]["mustBeFilledVariableType"]=array("string");
                #$conf["canBeEmptyString"],字串,必填變數內容如果是空字串就不能算是有設置的話,請設為"false",預設爲"true",可以為空字串.
                $conf["variableCheck::checkArguments"]["canBeEmptyString"]="false";
                #$conf["canNotBeEmpty"],字串陣列,哪些必填參數的內容不得為空字串或空陣列,僅當$conf["canBeEmptyString"]為"true"時會生效.
                #$conf["canNotBeEmpty"]=array();
                #$conf["canBeEmpty"],字串陣列,哪些必填參數的內容可為空字串或空陣列,僅當$conf["canBeEmptyString"]為"false"時會生效.
                #$conf["canBeEmpty"]=array();
                #$conf["skipableVariableCanNotBeEmpty"],字串陣列,哪些可省略參數不可以為空字串或空陣列.
                #$conf["skipableVariableCanNotBeEmpty"]=array();
                #$conf["skipableVariableName"],陣列字串,爲可省略參數的變數名稱陣列,形態爲陣列變數,例如: $conf["skipableVariableName"] = array("id","account","password");
                $conf["variableCheck::checkArguments"]["skipableVariableName"]=array("replaceFrom","yearFrom","yearTo","Authors","searchPath","skipHiddenFolder","includeHiddenFolder","excludeDirName","excludeMineType","excludeSecondName","multiThread","threadType","socket","log","outputPath");
                #$conf["skipableVariableType"],陣列字串,爲可省略參數的變數名稱陣列,形態爲陣列變數,例如: $conf["skipableVariableType"] = array("string",integer,"double");
                $conf["variableCheck::checkArguments"]["skipableVariableType"]=array("array","string","string","array","array","string","array","array","array","array","string","string","string","string","string");
                #$conf["skipableVarDefaultValue"],字串陣列,每個不存在的可省略變數要初始化為什麼,null與代表不指定,若預設值是參數之一,請將$conf["mustBeFilledVar"]改成"\$conf["\mustBeFilledVar\"]".
                $conf["variableCheck::checkArguments"]["skipableVarDefaultValue"]=array($replaceFromArray,"2014",gmdate("Y"),array("MIN ZHI, CHEN"),array($libRootPath),"true",null,array("free-lib","no-free-lib","composer"),array("image/*","video/*","audio/*","media/*","application/*"),array("log","csv","sql","js","css","html"),"false","socket",qbpwcf_usock_path,null,$outputPath);
                #$conf["disallowAllSkipableVarIsEmpty"],字串,是否允許每個可省略參數都為空字串,預設為"true"允許,反之為"false".
                #$conf["disallowAllSkipableVarIsEmpty"]="";
                #$conf["disallowAllSkipableVarIsEmptyArray"],字串,是否允許每個可省略參數都為空陣列,預設為"true"允許,反之為"false".
                #$conf["disallowAllSkipableVarIsEmptyArray"]="";
                #$conf["disallowAllSkipableVarNotExist"],字串,是否不允許每個可省略參數都不存在,預設為"false"代表允許,反之為"true".
                #$conf["disallowAllSkipableVarNotExist"]="";
                #$conf["arrayCountEqualCheck"],字串陣列,為檢查哪些陣列參數的元素數量要一樣,$conf["arrayCountEqualCheck"][$i]=array()為第$i組key為哪些的變數其元素數量要相等.
                #$conf["arrayCountEqualCheck"][]=array();
                #參考資料:
                #array_keys=>http://php.net/manual/en/function.array-keys.php
                #備註:
                #無.
                $checkArguments=variableCheck::checkArguments($conf["variableCheck::checkArguments"]);
                unset($conf["variableCheck::checkArguments"]);
                
                #如果執行異常
                if($checkArguments["status"]==="false"){
                
                        #設置錯誤識別
                        $result["status"]="false";
                        
                        #設置錯誤訊息
                        $result["error"]=$checkArguments;
                        
                        #回傳結果
                        return $result;
                
                        }#if end
                        
                #如果參數檢查不通過
                if($checkArguments["passed"]==="false"){
                
                        #設置錯誤識別
                        $result["status"]="false";
                        
                        #設置錯誤訊息
                        $result["error"]=$checkArguments;
                        
                        #回傳結果
                        return $result;
                
                        }#if end
                
                #函式說明:
                #取得檔案路徑字串的路徑與檔案的名稱與檔案副檔名
                #回傳的結果:
                #$result["status"],執行是否正常,"true"正常,"false"代表不正常.
                #$result["error"],錯誤訊息.
                #$result["function"],當前執行的函式名稱.
                #$result["filePath"],路徑字串.
                #$result["fileName"],檔案名稱字串.
                #$result["fileExtention"],檔案的副檔名.
                #$result["fullFileName"],含副檔名的檔案名稱.
                #$result["fullFilePathAndName"],完整的檔案路徑(含副檔名).
                #必填參數:
                #$conf["fileAddressAndName"],字串,檔案名稱與其路徑.
                $conf["fileAccess::getFileAddressAndNameAndFileExtention"]["fileAddressAndName"]=__FILE__;
                #可省略參數:
                #無.
                #參考資料:
                #無.
                #備註:
                #無.
                $getFileAddressAndNameAndFileExtention=fileAccess::getFileAddressAndNameAndFileExtention($conf["fileAccess::getFileAddressAndNameAndFileExtention"]);
                unset($conf["fileAccess::getFileAddressAndNameAndFileExtention"]);
                
                #debug,break point.
                #var_dump(__LINE__,$getFileAddressAndNameAndFileExtention);exit;
                
                #如果執行失敗
                if($getFileAddressAndNameAndFileExtention["status"]==="false"){
                        
                        #設置錯誤識別
                        $result["status"]="false";
                        
                        #設置錯誤訊息
                        $result["error"]=$getFileAddressAndNameAndFileExtention;
                        
                        #回傳結果
                        return $result;
                        
                        }#if end
                
                #初始化有異動的檔案清單
                $result["content"]=array();
                
                #函式說明:
                #使用 linux 的 uuid 指令來產生 uuid 字串
                #回傳結果:
                #$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
                #$result["error"],錯誤訊息.
                #$result["function"],當前執行的函式名稱.
                #$result["content"],uuid.
                #必填參數:
                #無.
                #可省略參數:
                #無.
                #參考資料:
                #無.
                #備註:
                #無.
                $uuid=cmd::uuid();

                #如果執行失敗
                if($uuid["status"]==="false"){

                        #debug
                        var_dump($uuid);
                        
                        #結束執行回傳代碼1給shell
                        exit(1);

                        }#if end
                
                #取得 uuid
                $uuid=$uuid["content"];
                
                #針對 $conf["searchPath"] 的每個路徑
                foreach($conf["searchPath"] as $path){
                
                        #debug
                        #var_dump(__LINE__,"searching path:".$path);
                
                        #取得 $path 底下的所有檔案.
                        #函式說明:
                        #取得目錄底下的詳細資訊.
                        #回傳結果:
                        #$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
                        #$result["error"],錯誤訊息.
                        #$result["function"],當前執行的函數名稱.
                        #$result["size"],該清單的大小,單位為bytes.
                        #$result["dataCount"],該清單的長度.
                        #$result["content"],指定目錄底下的所有檔案資訊.
                        #$result["content"][$i]["nType&permission"],第$i個節點類型、權限.
                        #$result["content"][$i]["nType"],第$i個節點類型,"-"代表檔案,"d"代表資料夾.
                        #$result["content"][$i]["permission"],第$i個節點權限.
                        #$result["content"][$i]["ownByUser"],第$i個節點擁有者賬號.
                        #$result["content"][$i]["ownByGroup"],第$i個節點擁有者群組.
                        #$result["content"][$i]["bytes"],第$i個節點大小.
                        #$result["content"][$i]["date"],第$i個節點最後變更日期.
                        #$result["content"][$i]["time"],第$i個節點最後異動時間.
                        #$result["content"][$i]["timeDetail"],第$i個節點最後異動詳細時間.
                        #$result["content"][$i]["timezone"],第$i個節點的時區.
                        #$result["content"][$i]["secondName"],第$i個節點為檔案時,若有附檔名,會記錄在這.
                        #$result["content"][$i]["name"],第$i個節點的名稱.
                        #$result["content"][$i]["mimeType"],第$i個節點為檔案且可以讀取時,會有 mime type 可取得.
                        #必填參數:
                        #$conf["path"],字串,要檢視的路徑,若非"/"結尾,會自動補上.
                        $conf["fileAccess::ls"]["path"]=$path;
                        #可省略參數:
                        #無.
                        #參考資料:
                        #https://www.businessweekly.com.tw/careers/Blog/14307
                        #備註:
                        #無.
                        $ls=fileAccess::ls($conf["fileAccess::ls"]);
                        unset($conf["fileAccess::ls"]);
                        
                        #如果執行失敗
                        if($ls["status"]==="false"){
                                
                                #設置錯誤識別
                                $result["status"]="false";
                                
                                #設置錯誤訊息
                                $result["error"]=$ls;
                                
                                #回傳結果
                                return $result;
                                
                                }#if end
                        
                        #如果沒資料
                        if($ls["dataCount"]===0){
                        
                                #跳過
                                continue;
                        
                                }#if end
                        
                        #針對每個節點
                        foreach($ls["content"] as $node){
                        
                                #取得節點的路徑與名稱
                                $NodePathAndName=$ls["path"].$node["name"];
                        
                                #儲存該節點需要取代的行號相關資訊
                                $replacedInfo=array();
                        
                                #預設該節點檔案不需要更新
                                $shouldReplace="false";
                        
                                #debug
                                #var_dump(__LINE__,$node);
                        
                                #如果是資料夾
                                if($node["nType"]==="d"){
                                
                                        #如果要忽略隱藏資料夾
                                        if($conf["skipHiddenFolder"]==="true"){
                                        
                                                #如果開頭為 "."
                                                if(strpos($node["name"],".")===0){
                                                
                                                        #如果有設定要包含特定的隱藏目錄
                                                        if(isset($conf["includeHiddenFolder"])){
                                                        
                                                                #如果不是需要的特定隱藏目錄
                                                                if(!(in_array($node["name"],$conf["includeHiddenFolder"]))){
                                                                
                                                                        #跳過
                                                                        continue;
                                                                
                                                                        }#if end
                                                        
                                                                }#if end
                                                
                                                        #反之
                                                        else{
                                                        
                                                                #跳過
                                                                continue;
                                                        
                                                                }#else end
                                                
                                                        }#if end
                                        
                                                }#if end
                                                
                                        #如果是要跳過的資料夾名稱
                                        if(in_array($node["name"],$conf["excludeDirName"])){
                                        
                                                #跳過
                                                continue;
                                        
                                                }#if end
                                
                                        #跳過 
                                        #continue;
                                
                                        #如果為單執行序
                                        if($conf["multiThread"]==="false"){
                                        
                                                #繼承本函式參數
                                                $conf["self::updateCopyRightYear"]=$conf;
                                                
                                                #置換要執行的路徑
                                                $conf["self::updateCopyRightYear"]["searchPath"]=array($NodePathAndName);
                                                
                                                #遞迴呼叫
                                                $updateCopyRightYear=self::updateCopyRightYear($conf["self::updateCopyRightYear"]);
                                                
                                                #移除參數,避免出錯.
                                                unset($conf["self::updateCopyRightYear"]);
                                                
                                                #如果執行失敗
                                                if($updateCopyRightYear["status"]==="false"){
                                                
                                                        #設置錯誤識別
                                                        $result["status"]="false";
                                                        
                                                        #設置錯誤訊息
                                                        $result["error"]=$updateCopyRightYear;
                                                        
                                                        #回傳結果
                                                        return $result;
                                                
                                                        }#if end
                                                
                                                #記錄有掃描的資料夾路徑與名稱 
                                                $result["scannedFile"][]=$NodePathAndName;
                                                
                                                #debug
                                                var_dump(__LINE__,"seartched node(folder):".$NodePathAndName);
                                                
                                                #合併 content - start
                                                
                                                #函式說明:
                                                #將多個一維陣列串聯起來,key從0開始排序.
                                                #回傳的結果:
                                                #$result["status"],"true"表執行正常,"false"代表執行不正常.
                                                #$result["error"],錯誤訊息陣列.
                                                #$result["function"],當前執行的函數.
                                                #$result["content"],合併好的一維陣列.
                                                #必填參數
                                                #$conf["inputArray"],陣列,要合併的一維陣列變數,例如:=array($array1,$array2);
                                                $conf["arrays::mergeArray"]["inputArray"]=array($result["content"],$updateCopyRightYear["content"]);
                                                #可省略參數:
                                                #$conf["allowRepeat"],字串,預設為"true",允許重複的結果;若為"false"則不會出現重複的元素內容.
                                                #$conf["allowRepeat"]="true";
                                                #參考資料:
                                                #無.
                                                #備註:
                                                #無.
                                                $mergeArray=arrays::mergeArray($conf["arrays::mergeArray"]);
                                                unset($conf["arrays::mergeArray"]);
                                                
                                                #如果執行失敗
                                                if($mergeArray["status"]==="false"){
                                                
                                                        #設置錯誤識別
                                                        $result["status"]="false";
                                                        
                                                        #設置錯誤訊息
                                                        $result["error"]=$mergeArray;
                                                        
                                                        #回傳結果
                                                        return $result;
                                                
                                                        }#if end
                                                        
                                                #取得合併好的有異動檔案結果
                                                $result["content"]=$mergeArray["content"];
                                                
                                                #合併 content - end
                                                
                                                #合併 scannedFile - start
                                                
                                                if(isset($updateCopyRightYear["scannedFile"])){
                                                
                                                        #函式說明:
                                                        #將多個一維陣列串聯起來,key從0開始排序.
                                                        #回傳的結果:
                                                        #$result["status"],"true"表執行正常,"false"代表執行不正常.
                                                        #$result["error"],錯誤訊息陣列.
                                                        #$result["function"],當前執行的函數.
                                                        #$result["content"],合併好的一維陣列.
                                                        #必填參數
                                                        #$conf["inputArray"],陣列,要合併的一維陣列變數,例如:=array($array1,$array2);
                                                        $conf["arrays::mergeArray"]["inputArray"]=array($result["scannedFile"],$updateCopyRightYear["scannedFile"]);
                                                        #可省略參數:
                                                        #$conf["allowRepeat"],字串,預設為"true",允許重複的結果;若為"false"則不會出現重複的元素內容.
                                                        #$conf["allowRepeat"]="true";
                                                        #參考資料:
                                                        #無.
                                                        #備註:
                                                        #無.
                                                        $mergeArray=arrays::mergeArray($conf["arrays::mergeArray"]);
                                                        unset($conf["arrays::mergeArray"]);
                                                        
                                                        #如果執行失敗
                                                        if($mergeArray["status"]==="false"){
                                                        
                                                                #設置錯誤識別
                                                                $result["status"]="false";
                                                                
                                                                #設置錯誤訊息
                                                                $result["error"]=$mergeArray;
                                                                
                                                                #回傳結果
                                                                return $result;
                                                        
                                                                }#if end
                                                                
                                                        #取得合併好的有異動檔案結果
                                                        $result["scannedFile"]=$mergeArray["content"];
                                                        
                                                        }#if end
                                                
                                                #合併 scannedFile - end
                                        
                                                }#if end
                                        
                                        #反之為多執行程
                                        else{
                                        
                                                /* 
                                                
                                                預想的程式 - start
                                        
                                                #繼承本函式參數
                                                $conf["self::updateCopyRightYear"]=$conf;
                                                
                                                #置換要執行的路徑
                                                $conf["self::updateCopyRightYear"]["searchPath"]=array($NodePathAndName);
                                                
                                                #遞迴呼叫
                                                $updateCopyRightYear=self::updateCopyRightYear($conf["self::updateCopyRightYear"]);
                                                
                                                預想的程式 - end
                                                
                                                */
                                                
                                                #要執行的php程式內容
                                                $cmdString=<<<'PHP'
/*

        QBPWCF, Quick Build PHP website Component base on Fedora Linux.
    Copyright (C) 2014~2025 MIN-ZHI, CHEN

    This file is part of QBPWCF.

    QBPWCF is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    QBPWCF is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with QBPWCF.  If not, see <http://www.gnu.org/licenses/>.

*/

#使用命名空間qbpwcf
namespace qbpwcf;

#匯入套件
PHP;

                                                #匯入套件的路徑
                                                $cmdString=$cmdString.PHP_EOL."require_once(\"".$libPath."/qbpwcf/allInOne.php\");";

                                                #要執行的php程式內容,設定建議的 log 位置.
                                                $cmdString=$cmdString.PHP_EOL.<<<'PHP'

#建議的log位置
$logFile=$_SERVER["DOCUMENT_ROOT"].$_SERVER["PHP_SELF"].".log";

PHP;

                                                #要執行的php程式內容,繼承本函式參數
                                                $cmdString=$cmdString.PHP_EOL."\$conf=(array)(json_decode(urldecode(base64_decode(\"".base64_encode(urlencode(json_encode($conf)))."\"))));";

                                                #要執行的php程式內容,置換要執行的路徑
                                                $cmdString=$cmdString.PHP_EOL."\$conf[\"searchPath\"]=array(\"".$NodePathAndName."\");";

                                                #要執行的php程式內容
                                                $cmdString=$cmdString.PHP_EOL.<<<'PHP'

#函式說明:
#更新程式檔案開頭版權宣告的年份
#回傳結果:
#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
#$reuslt["error"],執行不正常結束的錯訊息陣列.
#$result["function"],當前執行的函式名稱.
#$result["content"],有更新的檔案清單,其元素有被取代的檔案路徑與名稱跟replacedInfo,其中replacedInfo為陣列,其key為要變動的行號(從0開始算),其數值有"from"代表要被取代的原始內容,"to"代表要置換成的新內容.
#$result["scannedFile"],陣列,有檢查過的檔案清單其完整路徑與檔案名稱.
#必填參數:
#$conf["fileArgu"],字串,php變數__FILE__的內容,亦即該檔案在檔案系統的絕對路徑
#$conf["fileArgu"]=__FILE__;
#可省略參數:
#$conf["replaceFrom"],陣列,目標關鍵字,每個元素代表一行的內容,預設內容可參照本檔案開頭的版權宣告文字.
#$conf["replaceFrom"]=array();
#$conf["yearFrom],字串,起始年份,預設為西元"2014"年.
#$conf["yearFrom"]="2014";
#$conf["yearTo],字串,結束年份,預設為西元"gmdate('Y')"年.
#$conf["yearTo"]=gmdate('Y');
#$conf["Authors"],陣列,該套件的參與者,預設為array("MIN-ZHI, CHEN");
#$conf["Authors"]=array("MIN-ZHI, CHEN");
#$conf["searchPath"],陣列,要搜尋哪些地方的檔案要更新版權宣告年份,預設為使用中的本套件位置.
#$conf["searchPath"]=array("");
#$conf["skipHiddenFolder"],字串,要略過隱藏的資料夾,預設為"true";反之為"false";
#$conf["skipHiddenFolder"]="true";
#$conf["includeHiddenFolder"],陣列,符合名稱的隱藏資料夾會存取,預設不指定;
#$conf["includeHiddenFolder"]=array("");
#$conf["excludeDirName"],陣列,哪些目錄名稱要忽略,預設有"free-lib"、"no-free-lib"、"composer".
#$conf["excludeDirName"]=array("free-lib","no-free-lib","composer");
#$conf["excludeMineType"],陣列,哪些檔案類型要忽略,預設有"image/*"、"video/*"、"audio/*"、"media/*"、"application/*".
#$conf["excludeMineType"]=array("image/*","video/*","audio/*","media/*","application/*");
#$conf["excludeSecondName"],陣列,哪些附檔名的檔案要忽略,預設有"log"、"csv"、"sql"、"js"、"css"、"html".
#$conf["excludeSecondName"]=array("log"、,"csv","sql","js","css","html");
#$conf["multiThread"],字串,是否要啟用多執行序,預設為"false",反之為"true".
#$conf["multiThread"]="false";
#參考資料:
#無.
#備註:
#無.
$updateCopyRightYear=phpLib::updateCopyRightYear($conf);
unset($conf);

#輸出json結果
echo json_encode($updateCopyRightYear);
PHP;
                                        
                                                #設置多執行序的類型
                                                $threadType=$conf["threadType"];
                                                
                                                #debug,break point
                                                #var_dump(__LINE__,$threadType);exit(1);
                                                
                                                #判斷多執行序的類型
                                                switch($threadType){
                                                
                                                        #若是直接用 proc
                                                        case "proc":
                                                
                                                                #函式說明:
                                                                #透過proc來多執行序運作.
                                                                #回傳結果:
                                                                #$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
                                                                #$reuslt["error"],執行不正常結束的錯訊息陣列.
                                                                #$result["function"],當前執行的函式名稱.
                                                                #$result["argu"],使用的參數.
                                                                #$result["content"],陣列,每個元素為其指令執行的結果訊息陣列,key為"status"代表執行是否正常的識別;key為"statusCode"代表程式結束後回傳給對應executeBy程式的數值;key為"output"代表標準輸出,若為resource,則代表為pipe;key為"error"代表非標準輸出,若為resource,則代表為pipe;key為"input"代表成功輸入的指令;key為"process"代表該程序經proc_open後的process source;key為"proc_get_status"代表程序的資訊.
                                                                #必填參數:
                                                                #$conf["cmds"],字串陣列,每個元素代表要執行的指令與參數.
                                                                $conf["threads::proc"]["cmds"]=array("php -r ".escapeshellarg($cmdString));
                                                                #可省略參數:
                                                                #$conf["wait"],字串,是否需要等待所有程序結束,預設為"true"要等待;反之為"false"不要等待.
                                                                $conf["threads::proc"]["wait"]="false";
                                                                #$conf["workingDir"],字串陣列,個別程式執行時的家目錄,預設不指定.
                                                                $conf["threads::proc"]["workingDir"]=array($NodePathAndName);
                                                                #$conf["envs"],2維字串陣列,每個元素代表個別程式執行時的指定環境變數,key變數名稱;value為變數內容.預設為array("QBPWCF" => "Quick Build PHP Website Componment base on Fedora Linux");
                                                                #$conf["envs"]=array(array("key"=>"value"));
                                                                #$conf["executeBy"],字串陣列,每個元素代表個別指令要用什麼程式執行,預設為"bash".
                                                                #$conf["threads::proc"]["executeBy"]=array("php");
                                                                #參考資料:
                                                                #https://www.php.net/manual/en/function.proc-open.php
                                                                #https://www.php.net/manual/en/function.proc-get-status.php
                                                                #備註:
                                                                #無.
                                                                $proc=threads::proc($conf["threads::proc"]);
                                                                unset($conf["threads::proc"]);
                                                                
                                                                #如果執行失敗
                                                                if($proc["status"]==="false"){
                                                                
                                                                        #設置錯誤識別
                                                                        $result["status"]="false";
                                                                        
                                                                        #設置錯誤訊息
                                                                        $result["error"]=$proc;
                                                                        
                                                                        #回傳結果
                                                                        return $result;
                                                                
                                                                        }#if end
                                                                
                                                                #如果有開啟 log
                                                                if(isset($conf["log"])){
                                                                
                                                                        #函式說明:
                                                                        #撰寫log
                                                                        #回傳結果:
                                                                        #$result["status"],狀態,"true"或"false".
                                                                        #$result["error"],錯誤訊息陣列.
                                                                        #$result["function"],當前函式的名稱.
                                                                        #$result["argu"],使用的參數.
                                                                        #必填參數:
                                                                        #$conf["path"],字串,log檔案的路徑與名稱.
                                                                        $conf["logs::record"]["path"]=$conf["log"];
                                                                        #$conf["content"],any,要寫的內容,若內容不為字串則會用var_dump的格式寫入.
                                                                        $conf["logs::record"]["content"]=$proc;
                                                                        #$conf["fileArgu"],字串,php變數__FILE__的內容,亦即該檔案在檔案系統的絕對路徑
                                                                        $conf["logs::record"]["fileArgu"]=$conf["fileArgu"];
                                                                        #可省略參數:
                                                                        #$conf["rewrite"],預設為"false",接續寫入;反之"true"代表重新寫入.
                                                                        #$conf["rewrite"]="false";
                                                                        #參考資料:
                                                                        #無.
                                                                        #備註:
                                                                        #無.
                                                                        $record=logs::record($conf["logs::record"]);
                                                                        unset($conf["logs::record"]);
                                                                        
                                                                        #如果出錯
                                                                        if($record["status"]==="false"){
                                                                
                                                                                #設置錯誤識別
                                                                                $result["status"]="false";
                                                                                
                                                                                #設置錯誤訊息
                                                                                $result["error"]=$record;
                                                                                
                                                                                #印出json
                                                                                echo json_encode($result);
                                                                                
                                                                                #結束執行,回傳1給shell,代表異常,
                                                                                exit(1);
                                                                
                                                                                }#if end
                                                                        
                                                                        }#if end
                                                                
                                                                #儲存要執行的程序
                                                                $procs[]=$proc;
                                                
                                                                #結束 switch
                                                                break;
                                                                
                                                        #如果是要透過 socket 來執行
                                                        case "socket":
                                                        
                                                                #函式說明:
                                                                #透過 unix socket 來多執行序運作.
                                                                #回傳結果:
                                                                #$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
                                                                #$reuslt["error"],執行不正常結束的錯訊息陣列.
                                                                #$result["function"],當前執行的函式名稱.
                                                                #$result["argu"],使用的參數.
                                                                #$result["content"],陣列,每個元素為cmds參數中個別元素其指令傳送後得到的uuid,可透過sock::getProcInfo來查詢結果.
                                                                #必填參數:
                                                                #$conf["cmds"],字串陣列,每個元素代表要執行的指令與參數.
                                                                $conf["threads::socket"]["cmds"]=array("php -r ".escapeshellarg($cmdString));
                                                                #可省略參數:
                                                                #$conf["sock"],字串,要連線的 usr/bin/qbpwcf-sock.php 所產生的 unix domain socket 路徑與名稱,預設為 qbpwcf_usock_path.
                                                                $conf["threads::socket"]["sock"]=$conf["socket"];
                                                                #參考資料:
                                                                #無
                                                                #備註:
                                                                #需要透過sock::unixDomainSockServer來運行.
                                                                $socket=threads::socket($conf["threads::socket"]);
                                                                unset($conf["threads::socket"]);
                                                        
                                                                #如果執行失敗
                                                                if($socket["status"]==="false"){
                                                                
                                                                        #設置錯誤識別
                                                                        $result["status"]="false";
                                                                        
                                                                        #設置錯誤訊息
                                                                        $result["error"]=$socket;
                                                                        
                                                                        #回傳結果
                                                                        return $result;
                                                                
                                                                        }#if end
                                                                
                                                                #如果有開啟 log
                                                                if(isset($conf["log"])){
                                                                
                                                                        #函式說明:
                                                                        #撰寫log
                                                                        #回傳結果:
                                                                        #$result["status"],狀態,"true"或"false".
                                                                        #$result["error"],錯誤訊息陣列.
                                                                        #$result["function"],當前函式的名稱.
                                                                        #$result["argu"],使用的參數.
                                                                        #必填參數:
                                                                        #$conf["path"],字串,log檔案的路徑與名稱.
                                                                        $conf["logs::record"]["path"]=$conf["log"];
                                                                        #$conf["content"],any,要寫的內容,若內容不為字串則會用var_dump的格式寫入.
                                                                        $conf["logs::record"]["content"]=$socket;
                                                                        #$conf["fileArgu"],字串,php變數__FILE__的內容,亦即該檔案在檔案系統的絕對路徑
                                                                        $conf["logs::record"]["fileArgu"]=$conf["fileArgu"];
                                                                        #可省略參數:
                                                                        #$conf["rewrite"],預設為"false",接續寫入;反之"true"代表重新寫入.
                                                                        #$conf["rewrite"]="false";
                                                                        #參考資料:
                                                                        #無.
                                                                        #備註:
                                                                        #無.
                                                                        $record=logs::record($conf["logs::record"]);
                                                                        unset($conf["logs::record"]);
                                                                        
                                                                        #如果出錯
                                                                        if($record["status"]==="false"){
                                                                
                                                                                #設置錯誤識別
                                                                                $result["status"]="false";
                                                                                
                                                                                #設置錯誤訊息
                                                                                $result["error"]=$record;
                                                                                
                                                                                #印出json
                                                                                echo json_encode($result);
                                                                                
                                                                                #結束執行,回傳1給shell,代表異常,
                                                                                exit(1);
                                                                
                                                                                }#if end
                                                                        
                                                                        }#if end
                                                        
                                                                #儲存要執行的程序
                                                                $procs[]=$socket;
                                                        
                                                                #結束 switch
                                                                break;
                                                        
                                                        #其他類型
                                                        default:
                                                        
                                                                #設置錯誤識別
                                                                $result["status"]="false";
                                                                
                                                                #設置錯誤訊息
                                                                $result["error"][]="not supported multi threads type ".$threadType;
                                                                
                                                                #印出json
                                                                echo json_encode($result);
                                                                
                                                                #結束執行,回傳1給shell,代表異常,
                                                                exit(1);
                                                
                                                        }#switch end
                                                
                                                }#else end
                                
                                        }#if end
                                        
                                #反之如果是檔案
                                else if($node["nType"]==="-"){
                                        
                                        #針對每個要忽略的 mime type
                                        foreach($conf["excludeMineType"] as $mimeType){
                
                                                #取得 "/*" 的位置
                                                $positionOfSlashStar=strpos($mimeType,"/*");
                
                                                #如果是含有 "/*" 的廣義 mime 類型
                                                if($positionOfSlashStar!==false){
                                                
                                                        #取得 廣義類型的內容
                                                        $ignoredWileMimeTypeWithSlash=substr($mimeType,0,$positionOfSlashStar+1);
                                                
                                                        #debug
                                                        #var_dump(__LINE__,$ignoredWileMimeTypeWithSlash);
                                                
                                                        #如果是要忽略的 廣義類型內容
                                                        if(strpos($node["mimeType"],$ignoredWileMimeTypeWithSlash)===0){
                                                        
                                                                #跳過之
                                                                continue 2;
                                                        
                                                                }#if end
                                                
                                                        }#if end
                                        
                                                #反之
                                                else{
                                                
                                                        #如果是要忽略的 mime 類型
                                                        if($mimeType===$node["mimeType"]){
                                                        
                                                                #跳過之
                                                                continue 2;
                                                                
                                                                }#if end
                                                
                                                        }#else end
                                        
                                                }#foreach end
                                                
                                        #如果有副檔案名存在
                                        if(isset($node["secondName"])){
                                        
                                                #如果是要忽略的附檔名
                                                if(in_array($node["secondName"],$conf["excludeSecondName"])){
                                                
                                                        #跳過檔案
                                                        continue;
                                                
                                                        }#if end
                                        
                                                }#if end
                                        
                                        #記錄有掃描的檔案路徑與名稱 
                                        $result["scannedFile"][]=$NodePathAndName;
                                        
                                        #debug
                                        #var_dump(__LINE__,"found file:".$NodePathAndName." mimeType:".$node["mimeType"]);
                                
                                        #如果沒有用多執行序
                                        if($conf["multiThread"]==="false"){
                                        
                                                #設置起始年份
                                                $replaceTo[1]["yearFrom"]=$conf["yearFrom"];
                                                
                                                #設置到的年份
                                                $replaceTo[1]["yearTo"]=$conf["yearTo"];
                                                
                                                #將作者陣列變成字串.
                                                #函式說明:
                                                #將一維陣列轉換為用特定符號間隔的字串,ex:array("1","2","3") to "a;b;c;".
                                                #回傳的結果:
                                                #$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
                                                #$result["function"],當前執行的function名稱
                                                #$result["error"],錯誤訊息陣列.
                                                #$result["content"],處理好的字串.
                                                #$result["argu"],使用的參數.
                                                #必填參數:
                                                #$conf["inputArray"],字串陣列,要轉成字串的一維陣列.
                                                $conf["arrays::arrayToString"]["inputArray"]=$conf["Authors"];
                                                #可省略參數:
                                                #$conf["spiltSymbol"],字串,用來區隔字串的符號,預設為;
                                                $conf["arrays::arrayToString"]["spiltSymbol"]=", ";
                                                #$conf["skipEnd"],字串,結尾是否不要加上符號,預設為"false",要加上符號,"true"代表不要加上符號.
                                                $conf["arrays::arrayToString"]["skipEnd"]="true";
                                                #$conf["spiltSymbolAtStart"],字串,是否要在開頭加上spiltSymbol,預設為"false",代表不要;反之為“true”.
                                                #$conf["spiltSymbolAtStart"]="";
                                                #參考資料:
                                                #無.
                                                #備註:
                                                #無.
                                                $arrayToString=arrays::arrayToString($conf["arrays::arrayToString"]);
                                                unset($conf["arrays::arrayToString"]);
                                                
                                                #如果執行異常
                                                if($arrayToString["status"]==="false"){
                                                
                                                        #設置執行異常的識別
                                                        $result["status"]="false";
                                                
                                                        #設置執行錯誤訊息
                                                        $result["error"]=$arrayToString;
                                                        
                                                        #回傳結果
                                                        return $result;
                                                
                                                        }#if end
                                                
                                                #設置作者清單字串
                                                $replaceTo[1]["Authors"]=$arrayToString["content"];
                                        
                                                #函式說明:
                                                #置換檔案內容中符合的內容.
                                                #回傳結果:
                                                #$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
                                                #$reuslt["error"],執行不正常結束的錯訊息陣列.
                                                #$result["function"],當前執行的函式名稱.
                                                #$result["argu"],本函式使用的參數.
                                                #$result["content"],更新後的檔案內容陣列.每個元素代表一行的內容.
                                                #$result["found"],字串,是否有找到符合條件需要置換的內容.
                                                #$result["relaceInfo"],陣列,記錄需要置換的行資訊,元素的key為需要置換的行號,第 $i 行用 $i+1 表示.
                                                #$result["relaceInfo"][$i]["ori"],字串,第 $i+1 行原始的內容.
                                                #$result["relaceInfo"][$i]["new"],字串,第 $i+1 行要置換成的內容.
                                                #$result["content"],陣列,替換完後的每行內容.
                                                #必填參數:
                                                #$conf["fileArgu"],字串,php變數__FILE__的內容,亦即該檔案在檔案系統的絕對路徑
                                                $conf["phpLib::replaceMatchContent"]["fileArgu"]=__FILE__;
                                                #$conf["file"],字串,要置換內容的檔案路徑與名稱.
                                                $conf["phpLib::replaceMatchContent"]["file"]=$NodePathAndName;
                                                #$conf["formats"],陣列,連續的關鍵字字串.
                                                $conf["phpLib::replaceMatchContent"]["formats"]=$conf["replaceFrom"];
                                                #$conf["replaceTo"],陣列,原始內容要如何置換,每個元素的索引對應到formats參數的每個元素,若其索引不存在則代表對應的行不異動.
                                                $conf["phpLib::replaceMatchContent"]["replaceTo"]=$replaceTo;
                                                #可省略參數:
                                                #無.
                                                #參考資料:
                                                #無.
                                                #備註:
                                                #參數設定 $conf["replaceTo"][$i]=$replaceStr; 代表符合格式的連續字串中的 $i+1 行內容要置換成 $replaceStr.
                                                #參數設定 $conf["replaceTo"][$i]=array("varName1"=>$replaceStr1,"varName2"=>$replaceStr2); 代表符合格式的連續字串中的 $i+1 行內容中的變數 varName1 要置換成 $replaceStr1;變數 varName2 要置換成 $replaceStr2.
                                                $replaceMatchContent=phpLib::replaceMatchContent($conf["phpLib::replaceMatchContent"]);
                                                unset($conf["phpLib::replaceMatchContent"]);
                                        
                                                #如果執行異常
                                                if($replaceMatchContent["status"]==="false"){
                                                
                                                        #設置執行異常的識別
                                                        $result["status"]="false";
                                                
                                                        #設置執行錯誤訊息
                                                        $result["error"]=$replaceMatchContent;
                                                        
                                                        #回傳結果
                                                        return $result;
                                                
                                                        }#if end
                                                
                                                #如果有需要更新檔案內容的識別
                                                if($replaceMatchContent["found"]==="true"){
                                                
                                                        #$replaceMatchContent["relaceInfo"][$i]["new"],第 $i+1 行的新內容.
                                                
                                                        #初始化給予 fileAccess::updateFile 的參數
                                                        $replaceSpecifyLine=array();
                                                
                                                        #針對每個要更新的行
                                                        foreach($replaceMatchContent["relaceInfo"] as $lineIndex => $info){
                                                        
                                                                #設置給予 fileAccess::updateFile 的參數
                                                                $replaceSpecifyLine[$lineIndex]=$info["new"];
                                                        
                                                                }#foreach end
                                                
                                                        #更新檔案內容
                                                        #函式說明:
                                                        #更新檔案的內容.
                                                        #回傳結果:
                                                        #$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
                                                        #$result["error"],錯誤訊息.
                                                        #$result["function"],當前執行的函數名稱.
                                                        #$result["content"],更新的資訊.
                                                        #必填參數:
                                                        #$conf["fileArgu"],字串,變數__FILE__的內容.
                                                        $conf["fileAccess::updateFile"]["fileArgu"]=__FILE__;
                                                        #$conf["file"],字串,要更新的檔案位置與名稱.
                                                        $conf["fileAccess::updateFile"]["file"]=$NodePathAndName;
                                                        #可省略參數:
                                                        #$conf["overWriteWith"],字串陣列,要置換成什麼樣的內容,每個元素代表一行內容.
                                                        $conf["fileAccess::updateFile"]["overWriteWith"]=$replaceMatchContent["content"];
                                                        #$conf["replaceWith"],字串陣列,要將什麼內容置換成什麼內容.
                                                        #$conf["replaceWith"]=array(array("ori content","new content"),array("ori content","new content"),...);
                                                        #$conf["replaceLike"],字串,預設為"false",代表要完全符合關鍵字才能進行整行替換;反之為"true".
                                                        #$conf["replaceLike"]="false";
                                                        #$conf["addToTailWhenNoMatch"],字串,預設為"false"不做事;若為"true",則代表若使用 "replaceWith" 參數但沒有符合條件的內容出現,則新增到檔案的尾端.
                                                        #$conf["addToTailWhenNoMatch"]="false";
                                                        #$conf["addToTailBeforeThat"],字串,當 "replaceWith" 參數有使用,且 "addToTailWhenNoMatch" 為 "true" 時,若有使用該參數,則會從尾端尋找符合條件的行內容,然後將 沒有符合 "replaceWith" 條件的內容新增在此之前.
                                                        #$conf["addToTailBeforeThat"]="?\>";
                                                        #$conf["replaceSpecifyLine"],字串陣列,將指定的行取代成指定的內容,元素的key為原始檔案的行索引,若key為$i+1,則代表第$i行;元素的數值就為該行的新內容.
                                                        #$conf["fileAccess::updateFile"]["replaceSpecifyLine"]=$replaceSpecifyLine;
                                                        #$conf["outputPath"],字串,檔案要輸出到哪個位置,預設不指定,直接取代原始檔案的內容.
                                                        $conf["fileAccess::updateFile"]["outputPath"]=$conf["outputPath"];
                                                        #參考資料:
                                                        #無.
                                                        #備註:
                                                        #無.
                                                        $updateFile=fileAccess::updateFile($conf["fileAccess::updateFile"]);
                                                        unset($conf["fileAccess::updateFile"]);
                                                
                                                        #如果出錯
                                                        if($updateFile["status"]==="false"){
                                                
                                                                #設置錯誤識別
                                                                $result["status"]="false";
                                                                
                                                                #設置錯誤訊息
                                                                $result["error"]=$updateFile;
                                                                
                                                                #回傳結果
                                                                return $result;
                                                
                                                                }#if end
                                                                
                                                        #如果沒有既有的記錄
                                                        if(!isset($result["content"][$NodePathAndName])){
                                                        
                                                                #記錄有更新的檔案路徑與名稱與其次數為1
                                                                $result["content"][$NodePathAndName]["time"]=1;
                                                        
                                                                }#if end
                                                        
                                                        #反之
                                                        else{
                                                        
                                                                #記錄有更新的檔案路徑與名稱與的次數+1
                                                                $result["content"][$NodePathAndName]["time"]++;
                                                        
                                                                }#else end
                                                        
                                                        #記錄更新的相關資訊,用太多記憶體.
                                                        #$result["content"][$NodePathAndName]["replacedInfo"]=$updateFile["content"];
                                                
                                                        }#if end
                                        
                                                }#if end
                                                
                                        #反之為多執行序
                                        else{
                                        
                                                #...
                                                #待實作
                                        
                                                }#else end
                                                
                                        }#if end
                                        
                                }#foreach end
                        
                        }#foreach end
                
                #debug
                #var_dump(__FUNCTION__,__LINE__,print_r($conf,true));exit;
                
                #如果有啟用多執行序
                if($conf["multiThread"]==="true"){
                        
                        #debug
                        #var_dump($conf);exit;
                        
                        #如果有執行的程序要確認回饋
                        if(isset($procs)){
                        
                                #debug
                                #var_dump($procs);exit;
                        
                                #如果有要log
                                if(isset($conf["log"])){
                        
                                        #log for run time of start and end info
                                        $logPathForRunTimeOfStartAndEnd="/tmp/".basename($conf["log"]).":".$uuid."-runTimeOfStartAndEnd.log";
                                        
                                        #函式說明:
                                        #撰寫log
                                        #回傳結果:
                                        #$result["status"],狀態,"true"或"false".
                                        #$result["error"],錯誤訊息陣列.
                                        #$result["function"],當前函式的名稱.
                                        #$result["argu"],使用的參數.
                                        #必填參數:
                                        #$conf["path"],字串,log檔案的路徑與名稱.
                                        $conf["logs::record"]["path"]=$logPathForRunTimeOfStartAndEnd;
                                        #$conf["content"],any,要寫的內容,若內容不為字串則會用var_dump的格式寫入.
                                        $conf["logs::record"]["content"]="start at ".gmdate("Y-m-d H:i:s");
                                        #$conf["fileArgu"],字串,php變數__FILE__的內容,亦即該檔案在檔案系統的絕對路徑
                                        $conf["logs::record"]["fileArgu"]=__FILE__;
                                        #可省略參數:
                                        #$conf["rewrite"],預設為"false",接續寫入;反之"true"代表重新寫入.
                                        #$conf["rewrite"]="false";
                                        #參考資料:
                                        #無.
                                        #備註:
                                        #無.
                                        $record=logs::record($conf["logs::record"]);
                                        unset($conf["logs::record"]);
                                
                                        #如果出錯
                                        if($record["status"]==="false"){
                                
                                                #設置錯誤識別
                                                $result["status"]="false";
                                                
                                                #設置錯誤訊息
                                                $result["error"]=$record;
                                                
                                                #印出json
                                                echo json_encode($result);
                                                
                                                #結束執行,回傳1給shell,代表異常,
                                                exit(1);
                                
                                                }#if end
                                                
                                        }#if end
                                
                                #無窮迴圈
                                while(true){
                                
                                        #如果有開啟 log
                                        if(isset($conf["log"])){
                                        
                                                #要記錄的log
                                                $log="There are ".count($procs)." process under path of ".$conf["searchPath"][0]." unend.".PHP_EOL;
                                        
                                                #log的路徑與名稱
                                                $path="/tmp/".basename($conf["log"]).":".$uuid.".log";
                                        
                                                #log for latest running 的路徑與名稱
                                                $logPathForLatestRunning="/tmp/".basename($conf["log"]).":".$uuid."-latest.log";
                                                
                                                #函式說明:
                                                #撰寫log
                                                #回傳結果:
                                                #$result["status"],狀態,"true"或"false".
                                                #$result["error"],錯誤訊息陣列.
                                                #$result["function"],當前函式的名稱.
                                                #$result["argu"],使用的參數.
                                                #必填參數:
                                                #$conf["path"],字串,log檔案的路徑與名稱.
                                                $conf["logs::record"]["path"]=$path;
                                                #$conf["content"],any,要寫的內容,若內容不為字串則會用var_dump的格式寫入.
                                                $conf["logs::record"]["content"]=$log;
                                                #$conf["fileArgu"],字串,php變數__FILE__的內容,亦即該檔案在檔案系統的絕對路徑
                                                $conf["logs::record"]["fileArgu"]=__FILE__;
                                                #可省略參數:
                                                #$conf["rewrite"],預設為"false",接續寫入;反之"true"代表重新寫入.
                                                #$conf["rewrite"]="false";
                                                #參考資料:
                                                #無.
                                                #備註:
                                                #無.
                                                $record=logs::record($conf["logs::record"]);
                                                unset($conf["logs::record"]);
                                        
                                                #如果出錯
                                                if($record["status"]==="false"){
                                        
                                                        #設置錯誤識別
                                                        $result["status"]="false";
                                                        
                                                        #設置錯誤訊息
                                                        $result["error"]=$record;
                                                        
                                                        #印出json
                                                        echo json_encode($result);
                                                        
                                                        #結束執行,回傳1給shell,代表異常,
                                                        exit(1);
                                        
                                                        }#if end
                                        
                                                }#if end
                                        
                                        #針對每個要確認的程序
                                        foreach($procs as $procIndex => $procValue){
                                                
                                                #判斷多執行序的類型
                                                switch($threadType){
                                                
                                                        #如果是直接透過 proc
                                                        case "proc":
                                                        
                                                                #函式說明:
                                                                #更新透過proc執行的多程序資訊.
                                                                #回傳結果:
                                                                #$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
                                                                #$reuslt["error"],執行不正常結束的錯訊息陣列.
                                                                #$result["function"],當前執行的函式名稱.
                                                                #$result["argu"],使用的參數.
                                                                #$result["content"],陣列,每個元素為其指令執行的結果訊息陣列,key為"status"代表執行是否正常的識別;key為"statusCode"代表程式結束後回傳給對應executeBy程式的數值;key為"output"代表標準輸出,若為resource,則代表為pipe;key為"error"代表非標準輸出,若為resource,則代表為pipe;key為"input"代表成功輸入的指令;key為"process"代表該程序經proc_open後的process source;key為"proc_get_status"代表程序的資訊.
                                                                #必填參數:
                                                                #$conf["procs"],陣列,運行self::proc後回傳的content.
                                                                $conf["threads::proc_update"]["procs"]=$procValue["content"];
                                                                #可省略參數:
                                                                #無.
                                                                #參考資料:
                                                                #無.
                                                                #備註:
                                                                #無.
                                                                $proc_update=threads::proc_update($conf["threads::proc_update"]);
                                                                unset($conf["threads::proc_update"]);
                                                                
                                                                #如果執行失敗
                                                                if($proc_update["status"]==="false"){
                                                                
                                                                        #關閉程序
                                                                        proc_close($procs[$procIndex]["content"][0]["process"]);
                                                                
                                                                        #設置錯誤識別
                                                                        $result["status"]="false";
                                                                        
                                                                        #設置錯誤訊息
                                                                        $result["error"]=$procValue;
                                                                        
                                                                        #印出json
                                                                        echo json_encode($result);
                                                                        
                                                                        #卸除異常的程序
                                                                        unset($procs[$procIndex]);
                                                                        
                                                                        #結束執行,回傳1給shell,代表異常,
                                                                        exit(1);
                                                                
                                                                        }#if end
                                                                
                                                                #debug
                                                                #var_dump($procValue["content"][0]["statusCode"]);exit;
                                                                
                                                                #如果執行失敗
                                                                if($procValue["content"][0]["status"]==="false"){
                                                                
                                                                        #關閉程序
                                                                        proc_close($procs[$procIndex]["content"][0]["process"]);
                                                                        
                                                                        #設置錯誤識別
                                                                        $result["status"]="false";
                                                                        
                                                                        #設置錯誤訊息
                                                                        $result["error"]=$procValue;
                                                                        
                                                                        #印出json
                                                                        echo json_encode($result);
                                                                        
                                                                        #卸除異常的程序
                                                                        unset($procs[$procIndex]);
                                                                        
                                                                        #結束執行,回傳1給shell,代表異常,
                                                                        exit(1);
                                                                
                                                                        }#if end
                                                                
                                                                #如果可能尚在執行中
                                                                if($procValue["content"][0]["statusCode"]==="?"){
                                                                
                                                                        #debug
                                                                        #var_dump($procValue["content"][0]["statusCode"]);exit(1);
                                                                
                                                                        #如果有要log
                                                                        if(isset($conf["log"])){
                                                                                
                                                                                #要記錄的log
                                                                                $log=$procValue["content"][0];
                                                                        
                                                                                #函式說明:
                                                                                #撰寫log
                                                                                #回傳結果:
                                                                                #$result["status"],狀態,"true"或"false".
                                                                                #$result["error"],錯誤訊息陣列.
                                                                                #$result["function"],當前函式的名稱.
                                                                                #$result["argu"],使用的參數.
                                                                                #必填參數:
                                                                                #$conf["path"],字串,log檔案的路徑與名稱.
                                                                                $conf["logs::record"]["path"]=$logPathForLatestRunning;
                                                                                #$conf["content"],any,要寫的內容,若內容不為字串則會用var_dump的格式寫入.
                                                                                $conf["logs::record"]["content"]=$log;
                                                                                #$conf["fileArgu"],字串,php變數__FILE__的內容,亦即該檔案在檔案系統的絕對路徑
                                                                                $conf["logs::record"]["fileArgu"]=__FILE__;
                                                                                #可省略參數:
                                                                                #$conf["rewrite"],預設為"false",接續寫入;反之"true"代表重新寫入.
                                                                                $conf["logs::record"]["rewrite"]="true";
                                                                                #參考資料:
                                                                                #無.
                                                                                #備註:
                                                                                #無.
                                                                                $record=logs::record($conf["logs::record"]);
                                                                                unset($conf["logs::record"]);
                                                                        
                                                                                #如果出錯
                                                                                if($record["status"]==="false"){
                                                                        
                                                                                        #關閉程序
                                                                                        proc_close($procs[$procIndex]["content"][0]["process"]);
                                                                                        
                                                                                        #卸除異常的程序
                                                                                        unset($procs[$procIndex]);
                                                                        
                                                                                        #設置錯誤識別
                                                                                        $result["status"]="false";
                                                                                        
                                                                                        #設置錯誤訊息
                                                                                        $result["error"]=$record;
                                                                                        
                                                                                        #印出json
                                                                                        echo json_encode($result);
                                                                                        
                                                                                        #結束執行,回傳1給shell,代表異常,
                                                                                        exit(1);
                                                                        
                                                                                        }#if end
                                                                        
                                                                                }#if end
                                                                        
                                                                        #$result["content"],陣列,每個元素為其指令執行的結果訊息陣列,key為"status"代表執行是否正常的識別;key為"statusCode"代表程式結束後回傳給對應executeBy程式的數值;key為"output"代表標準輸出,若為resource,則代表為pipe;key為"error"代表非標準輸出,若為resource,則代表為pipe;key為"input"代表成功輸入的指令;key為"process"代表該程序經proc_open後的process source;key為"proc_get_status"代表程序的資訊.
                                                                        
                                                                        #如果錯誤訊息目前為resource,亦即pipe
                                                                        if(gettype($procValue["content"][0]["error"])==="resource"){
                                                                        
                                                                                #取得錯誤輸出
                                                                                $stderr=stream_get_contents($procValue["content"][0]["error"]);
                                                                        
                                                                                #如果有錯誤訊息存在
                                                                                if(!empty($stderr)){
                                                                                
                                                                                        #如果有要log
                                                                                        if(isset($conf["log"])){
                                                                                        
                                                                                                #要記錄的log
                                                                                                $log=$stderr;
                                                                                        
                                                                                                #函式說明:
                                                                                                #撰寫log
                                                                                                #回傳結果:
                                                                                                #$result["status"],狀態,"true"或"false".
                                                                                                #$result["error"],錯誤訊息陣列.
                                                                                                #$result["function"],當前函式的名稱.
                                                                                                #$result["argu"],使用的參數.
                                                                                                #必填參數:
                                                                                                #$conf["path"],字串,log檔案的路徑與名稱.
                                                                                                $conf["logs::record"]["path"]=$conf["log"];
                                                                                                #$conf["content"],any,要寫的內容,若內容不為字串則會用var_dump的格式寫入.
                                                                                                $conf["logs::record"]["content"]=$log;
                                                                                                #$conf["fileArgu"],字串,php變數__FILE__的內容,亦即該檔案在檔案系統的絕對路徑
                                                                                                $conf["logs::record"]["fileArgu"]=__FILE__;
                                                                                                #可省略參數:
                                                                                                #$conf["rewrite"],預設為"false",接續寫入;反之"true"代表重新寫入.
                                                                                                #$conf["rewrite"]="false";
                                                                                                #參考資料:
                                                                                                #無.
                                                                                                #備註:
                                                                                                #無.
                                                                                                $record=logs::record($conf["logs::record"]);
                                                                                                unset($conf["logs::record"]);
                                                                                        
                                                                                                #如果出錯
                                                                                                if($record["status"]==="false"){
                                                                                        
                                                                                                        #關閉程序
                                                                                                        proc_close($procs[$procIndex]["content"][0]["process"]);
                                                                                                        
                                                                                                        #設置錯誤識別
                                                                                                        $result["status"]="false";
                                                                                                        
                                                                                                        #設置錯誤訊息
                                                                                                        $result["error"]=$record;
                                                                                                        
                                                                                                        #印出json
                                                                                                        echo json_encode($result);
                                                                                                        
                                                                                                        #卸除異常的程序
                                                                                                        unset($procs[$procIndex]);
                                                                                                        
                                                                                                        #結束執行,回傳1給shell,代表異常,
                                                                                                        exit(1);
                                                                                        
                                                                                                        }#if end
                                                                                                        
                                                                                                #關閉程序
                                                                                                proc_close($procs[$procIndex]["content"][0]["process"]);
                                                                                                
                                                                                                #設置錯誤識別
                                                                                                $result["status"]="false";
                                                                                                
                                                                                                #設置錯誤訊息
                                                                                                $result["error"][]=$record;
                                                                                                
                                                                                                #設置錯誤訊息
                                                                                                $result["error"][]=$stderr;
                                                                                                
                                                                                                #印出json
                                                                                                echo json_encode($result);
                                                                                                
                                                                                                #卸除異常的程序
                                                                                                unset($procs[$procIndex]);
                                                                                                
                                                                                                #結束執行,回傳1給shell,代表異常,
                                                                                                exit(1);
                                                                                        
                                                                                                }#if end
                                                                                
                                                                                        }#if ene
                                                                        
                                                                                }#if end
                                                                
                                                                        #反之為字串
                                                                        else{
                                                                                
                                                                                #取得錯誤輸出
                                                                                $stderr=$procValue["content"][0]["error"];
                                                                                
                                                                                #如果有錯誤訊息存在
                                                                                if(!empty($stderr)){
                                                                                
                                                                                        #如果有要log
                                                                                        if(isset($conf["log"])){
                                                                                        
                                                                                                #要記錄的log
                                                                                                $log=$stderr;
                                                                                        
                                                                                                #函式說明:
                                                                                                #撰寫log
                                                                                                #回傳結果:
                                                                                                #$result["status"],狀態,"true"或"false".
                                                                                                #$result["error"],錯誤訊息陣列.
                                                                                                #$result["function"],當前函式的名稱.
                                                                                                #$result["argu"],使用的參數.
                                                                                                #必填參數:
                                                                                                #$conf["path"],字串,log檔案的路徑與名稱.
                                                                                                $conf["logs::record"]["path"]=$conf["log"];
                                                                                                #$conf["content"],any,要寫的內容,若內容不為字串則會用var_dump的格式寫入.
                                                                                                $conf["logs::record"]["content"]=$log;
                                                                                                #$conf["fileArgu"],字串,php變數__FILE__的內容,亦即該檔案在檔案系統的絕對路徑
                                                                                                $conf["logs::record"]["fileArgu"]=__FILE__;
                                                                                                #可省略參數:
                                                                                                #$conf["rewrite"],預設為"false",接續寫入;反之"true"代表重新寫入.
                                                                                                #$conf["rewrite"]="false";
                                                                                                #參考資料:
                                                                                                #無.
                                                                                                #備註:
                                                                                                #無.
                                                                                                $record=logs::record($conf["logs::record"]);
                                                                                                unset($conf["logs::record"]);
                                                                                        
                                                                                                #如果出錯
                                                                                                if($record["status"]==="false"){
                                                                                        
                                                                                                        #關閉程序
                                                                                                        proc_close($procs[$procIndex]["content"][0]["process"]);
                                                                                                        
                                                                                                        #設置錯誤識別
                                                                                                        $result["status"]="false";
                                                                                                        
                                                                                                        #設置錯誤訊息
                                                                                                        $result["error"]=$record;
                                                                                                        
                                                                                                        #印出json
                                                                                                        echo json_encode($result);
                                                                                                        
                                                                                                        #卸除異常的程序
                                                                                                        unset($procs[$procIndex]);
                                                                                                        
                                                                                                        #結束執行,回傳1給shell,代表異常,
                                                                                                        exit(1);
                                                                                        
                                                                                                        }#if end
                                                                                                        
                                                                                                #關閉程序
                                                                                                proc_close($procs[$procIndex]["content"][0]["process"]);
                                                                                                
                                                                                                #設置錯誤識別
                                                                                                $result["status"]="false";
                                                                                                
                                                                                                #設置錯誤訊息
                                                                                                $result["error"][]=$record;
                                                                                                
                                                                                                #設置錯誤訊息
                                                                                                $result["error"][]=$stderr;
                                                                                                
                                                                                                #印出json
                                                                                                echo json_encode($result);
                                                                                                
                                                                                                #卸除異常的程序
                                                                                                unset($procs[$procIndex]);
                                                                                                
                                                                                                #結束執行,回傳1給shell,代表異常,
                                                                                                exit(1);
                                                                                        
                                                                                                }#if end
                                                                                
                                                                                        }#if ene
                                                                        
                                                                                }#else end
                                                                
                                                                        #跳過該子程序
                                                                        continue 2;
                                                                
                                                                        }#if end
                                                                
                                                                #反之可能為執行結束了,且執行異常
                                                                else if($procValue["content"][0]["statusCode"]!==0){
                                                                
                                                                        #關閉程序
                                                                        proc_close($procs[$procIndex]["content"][0]["process"]);
                                                                
                                                                        #設置錯誤識別
                                                                        $result["status"]="false";
                                                                        
                                                                        #設置錯誤訊息
                                                                        $result["error"]=$procValue;
                                                                        
                                                                        #印出json
                                                                        echo json_encode($result);
                                                                        
                                                                        #卸除異常的程序
                                                                        unset($procs[$procIndex]);
                                                                        
                                                                        #結束執行,回傳1給shell,代表異常,
                                                                        exit(1);
                                                                
                                                                        }#if end
                                                                
                                                                #反之執行正常
                                                                else{
                                                                
                                                                        #debug
                                                                        #var_dump($procValue["content"][0]["statusCode"]);
                                                                
                                                                        #儲存程序執行的標準輸出
                                                                        $threadStdOut=$procValue["content"][0]["content"];
                                                                
                                                                        #如果標準輸出不是json
                                                                        if(json_validate($threadStdOut)===false){
                                                                        
                                                                                #關閉程序
                                                                                proc_close($procs[$procIndex]["content"][0]["process"]);
                                                                                
                                                                                #設置錯誤識別
                                                                                $result["status"]="false";
                                                                                
                                                                                #設置錯誤訊息
                                                                                $result["error"]=$procValue;
                                                                                
                                                                                #印出json
                                                                                echo json_encode($result);
                                                                                
                                                                                #卸除異常的程序
                                                                                unset($procs[$procIndex]);
                                                                                
                                                                                #結束執行,回傳1給shell,代表異常,
                                                                                exit(1);
                                                                        
                                                                                }#if end
                                                                        
                                                                        #取得解析的json
                                                                        $updateCopyRightYear=(array)(json_decode($threadStdOut));
                                                                
                                                                        #如果執行失敗
                                                                        if($updateCopyRightYear["status"]==="false"){
                                                                        
                                                                                #關閉程序
                                                                                proc_close($procs[$procIndex]["content"][0]["process"]);
                                                                                
                                                                                #設置錯誤識別
                                                                                $result["status"]="false";
                                                                                
                                                                                #設置錯誤訊息
                                                                                $result["error"]=$updateCopyRightYear;
                                                                                
                                                                                #印出json
                                                                                echo json_encode($result);
                                                                                
                                                                                #卸除異常的程序
                                                                                unset($procs[$procIndex]);
                                                                                
                                                                                #結束執行,回傳1給shell,代表異常,
                                                                                exit(1);
                                                                        
                                                                                }#if end
                                                                                
                                                                        #記錄有掃描的資料夾路徑與名稱 
                                                                        $result["scannedFile"][]=$NodePathAndName;
                                                                        
                                                                        #合併 content - start
                                                                        
                                                                        #函式說明:
                                                                        #將多個一維陣列串聯起來,key從0開始排序.
                                                                        #回傳的結果:
                                                                        #$result["status"],"true"表執行正常,"false"代表執行不正常.
                                                                        #$result["error"],錯誤訊息陣列.
                                                                        #$result["function"],當前執行的函數.
                                                                        #$result["content"],合併好的一維陣列.
                                                                        #必填參數
                                                                        #$conf["inputArray"],陣列,要合併的一維陣列變數,例如:=array($array1,$array2);
                                                                        $conf["arrays::mergeArray"]["inputArray"]=array($result["content"],$updateCopyRightYear["content"]);
                                                                        #可省略參數:
                                                                        #$conf["allowRepeat"],字串,預設為"true",允許重複的結果;若為"false"則不會出現重複的元素內容.
                                                                        #$conf["allowRepeat"]="true";
                                                                        #參考資料:
                                                                        #無.
                                                                        #備註:
                                                                        #無.
                                                                        $mergeArray=arrays::mergeArray($conf["arrays::mergeArray"]);
                                                                        unset($conf["arrays::mergeArray"]);
                                                                        
                                                                        #如果執行失敗
                                                                        if($mergeArray["status"]==="false"){
                                                                        
                                                                                #關閉程序
                                                                                proc_close($procs[$procIndex]["content"][0]["process"]);
                                                                        
                                                                                #設置錯誤識別
                                                                                $result["status"]="false";
                                                                                
                                                                                #設置錯誤訊息
                                                                                $result["error"]=$mergeArray;
                                                                                
                                                                                #印出json
                                                                                echo json_encode($result);
                                                                                
                                                                                #卸除異常的程序
                                                                                unset($procs[$procIndex]);
                                                                                
                                                                                #結束執行,回傳1給shell,代表異常,
                                                                                exit(1);
                                                                        
                                                                                }#if end
                                                                                
                                                                        #取得合併好的有異動檔案結果
                                                                        $result["content"]=$mergeArray["content"];
                                                                        
                                                                        #合併 content - end
                                                                        
                                                                        #合併 scannedFile - start
                                                                        
                                                                        if(isset($updateCopyRightYear["scannedFile"])){
                                                                        
                                                                                #函式說明:
                                                                                #將多個一維陣列串聯起來,key從0開始排序.
                                                                                #回傳的結果:
                                                                                #$result["status"],"true"表執行正常,"false"代表執行不正常.
                                                                                #$result["error"],錯誤訊息陣列.
                                                                                #$result["function"],當前執行的函數.
                                                                                #$result["content"],合併好的一維陣列.
                                                                                #必填參數
                                                                                #$conf["inputArray"],陣列,要合併的一維陣列變數,例如:=array($array1,$array2);
                                                                                $conf["arrays::mergeArray"]["inputArray"]=array($result["scannedFile"],$updateCopyRightYear["scannedFile"]);
                                                                                #可省略參數:
                                                                                #$conf["allowRepeat"],字串,預設為"true",允許重複的結果;若為"false"則不會出現重複的元素內容.
                                                                                #$conf["allowRepeat"]="true";
                                                                                #參考資料:
                                                                                #無.
                                                                                #備註:
                                                                                #無.
                                                                                $mergeArray=arrays::mergeArray($conf["arrays::mergeArray"]);
                                                                                unset($conf["arrays::mergeArray"]);
                                                                                
                                                                                #如果執行失敗
                                                                                if($mergeArray["status"]==="false"){
                                                                                
                                                                                        #關閉程序
                                                                                        proc_close($procs[$procIndex]["content"][0]["process"]);
                                                                                        
                                                                                        #設置錯誤識別
                                                                                        $result["status"]="false";
                                                                                        
                                                                                        #設置錯誤訊息
                                                                                        $result["error"]=$mergeArray;
                                                                                        
                                                                                        #印出json
                                                                                        echo json_encode($result);
                                                                                        
                                                                                        #卸除異常的程序
                                                                                        unset($procs[$procIndex]);
                                                                                        
                                                                                        #結束執行,回傳1給shell,代表異常,
                                                                                        exit(1);
                                                                                
                                                                                        }#if end
                                                                                        
                                                                                #取得合併好的有異動檔案結果
                                                                                $result["scannedFile"]=$mergeArray["content"];
                                                                                
                                                                                }#if end
                                                                        
                                                                        #合併 scannedFile - end
                                                                
                                                                        #關閉程序
                                                                        proc_close($procs[$procIndex]["content"][0]["process"]);
                                                                        
                                                                        #卸除做好的程序
                                                                        unset($procs[$procIndex]);
                                                                
                                                                        }#else end
                                                        
                                                                #end switch
                                                                break;
                                                                
                                                        #如果是透過socket
                                                        case "socket":
                                                        
                                                                #取得 proc 的 uuid
                                                                $procUuid=$procValue["content"][0]["content"];
                                                                
                                                                #函式說明:
                                                                #詢問透過 sock::unixDomainSockServer 執行的程序狀況
                                                                #回傳結果:
                                                                #$result["status"],"true"代表執行正常;"false"代表執行不正常.
                                                                #$result["error"],錯誤訊息陣列.
                                                                #$result["function"],當前執行的函式名稱.
                                                                #$result["argu"],使用的參數.
                                                                #$result["content"],陣列,程序的資訊.
                                                                #$result["content"]["pid"],字串,程序的pid.
                                                                #$result["content"]["running"],字串,是否正常執行中.
                                                                #$result["content"]["statusCode"],字串,回傳給 shell 的代碼.
                                                                #$result["content"]["input"],字串,輸入的內容.
                                                                #$result["content"]["output"],字串,標準輸出的內容.
                                                                #$result["content"]["error"],字串,錯誤輸出的內容.
                                                                #必填參數:
                                                                #$conf["uuid"],字串,proc的uuid.
                                                                $conf["sock::getProcInfo"]["uuid"]=$procUuid;
                                                                #可省略參數:
                                                                #$conf["sock"],字串,要連線的 usr/bin/qbpwcf-sock.php(sock::unixDomainSockServer) 所產生的 unix domain socket 路徑與名稱,預設為 qbpwcf_usock_path.
                                                                $conf["sock::getProcInfo"]["sock"]=$conf["socket"];
                                                                #參考資料:
                                                                #無.
                                                                #備註:
                                                                #無.
                                                                $getProcInfo=sock::getProcInfo($conf["sock::getProcInfo"]);
                                                                unset($conf["sock::getProcInfo"]);

                                                                #debug
                                                                if($getProcInfo["status"]==="false"){

                                                                        #設置錯誤識別
                                                                        $result["status"]="false";
                                                                        
                                                                        #設置錯誤訊息
                                                                        $result["error"][]="get process info by uuid failed";
                                                                        
                                                                        #設置錯誤訊息
                                                                        $result["error"][]=$getProcInfo;
                                                                        
                                                                        #印出json
                                                                        echo json_encode($result);

                                                                        }#if end
                                                                
                                                                #如果已經停止運行
                                                                if($getProcInfo["content"]["running"]==="false"){
                                                                
                                                                        #儲存程序執行的標準輸出
                                                                        $threadStdOut=$getProcInfo["content"]["output"];
                                                                
                                                                        #如果標準輸出不是json
                                                                        if(json_validate($threadStdOut)===false){
                                                                        
                                                                                #設置錯誤識別
                                                                                $result["status"]="false";
                                                                                
                                                                                #設置錯誤訊息
                                                                                $result["error"]=$procValue;
                                                                                
                                                                                #印出json
                                                                                echo json_encode($result);
                                                                                
                                                                                #卸除異常的程序
                                                                                unset($procs[$procIndex]);
                                                                                
                                                                                #結束執行,回傳1給shell,代表異常,
                                                                                exit(1);
                                                                        
                                                                                }#if end
                                                                        
                                                                        #取得解析的json
                                                                        $updateCopyRightYear=(array)(json_decode($threadStdOut));
                                                                
                                                                        #如果執行失敗
                                                                        if($updateCopyRightYear["status"]==="false"){
                                                                        
                                                                                #設置錯誤識別
                                                                                $result["status"]="false";
                                                                                
                                                                                #設置錯誤訊息
                                                                                $result["error"]=$updateCopyRightYear;
                                                                                
                                                                                #印出json
                                                                                echo json_encode($result);
                                                                                
                                                                                #卸除異常的程序
                                                                                unset($procs[$procIndex]);
                                                                                
                                                                                #結束執行,回傳1給shell,代表異常,
                                                                                exit(1);
                                                                        
                                                                                }#if end
                                                                                
                                                                        #記錄有掃描的資料夾路徑與名稱 
                                                                        $result["scannedFile"][]=$NodePathAndName;
                                                                        
                                                                        #合併 content - start
                                                                        
                                                                        #函式說明:
                                                                        #將多個一維陣列串聯起來,key從0開始排序.
                                                                        #回傳的結果:
                                                                        #$result["status"],"true"表執行正常,"false"代表執行不正常.
                                                                        #$result["error"],錯誤訊息陣列.
                                                                        #$result["function"],當前執行的函數.
                                                                        #$result["content"],合併好的一維陣列.
                                                                        #必填參數
                                                                        #$conf["inputArray"],陣列,要合併的一維陣列變數,例如:=array($array1,$array2);
                                                                        $conf["arrays::mergeArray"]["inputArray"]=array($result["content"],$updateCopyRightYear["content"]);
                                                                        #可省略參數:
                                                                        #$conf["allowRepeat"],字串,預設為"true",允許重複的結果;若為"false"則不會出現重複的元素內容.
                                                                        #$conf["allowRepeat"]="true";
                                                                        #參考資料:
                                                                        #無.
                                                                        #備註:
                                                                        #無.
                                                                        $mergeArray=arrays::mergeArray($conf["arrays::mergeArray"]);
                                                                        unset($conf["arrays::mergeArray"]);
                                                                        
                                                                        #如果執行失敗
                                                                        if($mergeArray["status"]==="false"){
                                                                        
                                                                                #設置錯誤識別
                                                                                $result["status"]="false";
                                                                                
                                                                                #設置錯誤訊息
                                                                                $result["error"]=$mergeArray;
                                                                                
                                                                                #印出json
                                                                                echo json_encode($result);
                                                                                
                                                                                #卸除異常的程序
                                                                                unset($procs[$procIndex]);
                                                                                
                                                                                #結束執行,回傳1給shell,代表異常.
                                                                                exit(1);
                                                                        
                                                                                }#if end
                                                                        
                                                                        #取得合併好的有異動檔案結果
                                                                        $result["content"]=$mergeArray["content"];
                                                                        
                                                                        #合併 content - end
                                                                        
                                                                        #合併 scannedFile - start
                                                                        
                                                                        if(isset($updateCopyRightYear["scannedFile"])){
                                                                        
                                                                                #函式說明:
                                                                                #將多個一維陣列串聯起來,key從0開始排序.
                                                                                #回傳的結果:
                                                                                #$result["status"],"true"表執行正常,"false"代表執行不正常.
                                                                                #$result["error"],錯誤訊息陣列.
                                                                                #$result["function"],當前執行的函數.
                                                                                #$result["content"],合併好的一維陣列.
                                                                                #必填參數
                                                                                #$conf["inputArray"],陣列,要合併的一維陣列變數,例如:=array($array1,$array2);
                                                                                $conf["arrays::mergeArray"]["inputArray"]=array($result["scannedFile"],$updateCopyRightYear["scannedFile"]);
                                                                                #可省略參數:
                                                                                #$conf["allowRepeat"],字串,預設為"true",允許重複的結果;若為"false"則不會出現重複的元素內容.
                                                                                #$conf["allowRepeat"]="true";
                                                                                #參考資料:
                                                                                #無.
                                                                                #備註:
                                                                                #無.
                                                                                $mergeArray=arrays::mergeArray($conf["arrays::mergeArray"]);
                                                                                unset($conf["arrays::mergeArray"]);
                                                                                
                                                                                #如果執行失敗
                                                                                if($mergeArray["status"]==="false"){
                                                                                
                                                                                        #設置錯誤識別
                                                                                        $result["status"]="false";
                                                                                        
                                                                                        #設置錯誤訊息
                                                                                        $result["error"]=$mergeArray;
                                                                                        
                                                                                        #印出json
                                                                                        echo json_encode($result);
                                                                                        
                                                                                        #卸除異常的程序
                                                                                        unset($procs[$procIndex]);
                                                                                        
                                                                                        #結束執行,回傳1給shell,代表異常,
                                                                                        exit(1);
                                                                                
                                                                                        }#if end
                                                                                        
                                                                                #取得合併好的有異動檔案結果
                                                                                $result["scannedFile"]=$mergeArray["content"];
                                                                                
                                                                                }#if end
                                                                        
                                                                        #合併 scannedFile - end
                                                                        
                                                                        #卸除做好的程序
                                                                        unset($procs[$procIndex]);
                                                                
                                                                        }#if end
                                                        
                                                                #end switch
                                                                break;
                                                                
                                                        #其他類型
                                                        default:
                                                        
                                                                #設置錯誤識別
                                                                $result["status"]="false";
                                                                
                                                                #設置錯誤訊息
                                                                $result["error"][]="not supported multi threads type ".$threadType;
                                                                
                                                                #印出json
                                                                echo json_encode($result);
                                                                
                                                                #結束執行,回傳1給shell,代表異常,
                                                                exit(1);
                                                
                                                        }#switch end
                                                
                                                }#foreach end
                                                
                                        #如果已經執行完所有子程序
                                        if(empty($procs)){
                                        
                                                #如果有要log
                                                if(isset($conf["log"])){
                                        
                                                        #函式說明:
                                                        #撰寫log
                                                        #回傳結果:
                                                        #$result["status"],狀態,"true"或"false".
                                                        #$result["error"],錯誤訊息陣列.
                                                        #$result["function"],當前函式的名稱.
                                                        #$result["argu"],使用的參數.
                                                        #必填參數:
                                                        #$conf["path"],字串,log檔案的路徑與名稱.
                                                        $conf["logs::record"]["path"]=$logPathForRunTimeOfStartAndEnd;
                                                        #$conf["content"],any,要寫的內容,若內容不為字串則會用var_dump的格式寫入.
                                                        $conf["logs::record"]["content"]="end at ".gmdate("Y-m-d H:i:s");
                                                        #$conf["fileArgu"],字串,php變數__FILE__的內容,亦即該檔案在檔案系統的絕對路徑
                                                        $conf["logs::record"]["fileArgu"]=__FILE__;
                                                        #可省略參數:
                                                        #$conf["rewrite"],預設為"false",接續寫入;反之"true"代表重新寫入.
                                                        #$conf["rewrite"]="false";
                                                        #參考資料:
                                                        #無.
                                                        #備註:
                                                        #無.
                                                        $record=logs::record($conf["logs::record"]);
                                                        unset($conf["logs::record"]);
                                                
                                                        #如果出錯
                                                        if($record["status"]==="false"){
                                                
                                                                #設置錯誤識別
                                                                $result["status"]="false";
                                                                
                                                                #設置錯誤訊息
                                                                $result["error"]=$record;
                                                                
                                                                #印出json
                                                                echo json_encode($result);
                                                                
                                                                #結束執行,回傳1給shell,代表異常,
                                                                exit(1);
                                                
                                                                }#if end
                                                                
                                                        }#if end
                                                
                                                #結束子程序的檢查
                                                break;
                                        
                                                }#if end
                                        
                                        #執行到這邊,代表尚有程序再執行.
                                        
                                        #如果要log
                                        if(isset($conf["log"])){
                                        
                                                
                                        
                                                }#if end
                                                
                                        #休息1秒鐘
                                        sleep(1);
                                
                                        }#while end
                        
                                }#if end
                
                        }#if end
                
                #設置執行正常
                $result["status"]="true";
                
                #如果是透過多執行序執行
                if($conf["multiThread"]==="true"){
                
                        #印出json結果
                        echo json_encode($result);
                        
                        }#if end
                
                #反之
                else{
                
                        #回傳結果
                        return $result;
                
                        }#else end
                
                }#function updateCopyRightYear end
                
        /*
        #函式說明:
        #置換檔案內容中符合的內容.
        #回傳結果:
        #$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
        #$reuslt["error"],執行不正常結束的錯訊息陣列.
        #$result["function"],當前執行的函式名稱.
        #$result["argu"],本函式使用的參數.
        #$result["content"],更新後的檔案內容陣列.每個元素代表一行的內容.
        #$result["found"],字串,是否有找到符合條件需要置換的內容.
        #$result["relaceInfo"],陣列,記錄需要置換的行資訊,元素的key為需要置換的行號,第 $i 行用 $i+1 表示.
        #$result["relaceInfo"][$i]["deletedOriHead"],字串,第 $i+1 行原始的內容,前面的空白或tab.
        #$result["relaceInfo"][$i]["ori"],字串,第 $i+1 行剔除前面的空白或tab後的原始內容.
        #$result["relaceInfo"][$i]["new"],字串,第 $i+1 行剔除前面的空白或tab後的要置換成的內容.
        #$result["content"],陣列,替換完後的每行內容.
        #必填參數:
        #$conf["fileArgu"],字串,php變數__FILE__的內容,亦即該檔案在檔案系統的絕對路徑
        $conf["fileArgu"]=__FILE__;
        #$conf["file"],字串,要置換內容的檔案路徑與名稱.
        $conf["file"]="";
        #$conf["formats"],陣列,連續的關鍵字字串.
        $conf["formats"]=array();
        #$conf["replaceTo"],陣列,原始內容要如何置換,每個元素的索引對應到formats參數的每個元素,若其索引不存在則代表對應的行不異動.
        $conf["replaceTo"]=array();
        #可省略參數:
        #無.
        #參考資料:
        #無.
        #備註:
        #參數設定 $conf["replaceTo"][$i]=$replaceStr; 代表符合格式的連續字串中的 $i+1 行內容要置換成 $replaceStr.
        #參數設定 $conf["replaceTo"][$i]=array("varName1"=>$replaceStr1,"varName2"=>$replaceStr2); 代表符合格式的連續字串中的 $i+1 行內容中的變數 varName1 要置換成 $replaceStr1;變數 varName2 要置換成 $replaceStr2.
        */
        public static function replaceMatchContent(&$conf){
                
                #初始化要回傳的結果
                $result=array();

                #取得當前執行的函數名稱
                $result["function"]=__FUNCTION__;

                #如果沒有參數
                if(func_num_args()==0){

                        #設置執行失敗
                        $result["status"]="false";

                        #設置執行錯誤訊息
                        $result["error"]="函數".$result["function"]."需要參數";

                        #回傳結果
                        return $result;

                        }#if end

                #取得參數
                $result["argu"]=$conf;
                
                #如果 $conf 不為陣列
                if(gettype($conf)!=="array"){

                        #設置執行失敗
                        $result["status"]="false";

                        #設置執行錯誤訊息
                        $result["error"][]="\$conf變數須為陣列形態";

                        #如果傳入的參數為 null
                        if(is_null($conf)){

                                #設置執行錯誤訊息
                                $result["error"][]="\$conf變數不得為null,請檢查函數「".$result["function"]."」的參數設置有無正確!";

                                }#if end

                        #回傳結果
                        return $result;

                        }#if end
                
                #參數檢查
                #函式說明:
                #檢查必填與可省略的參數,可省略參數可指定預設要給與什麼數值內容.
                #回傳結果:
                #$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
                #$result["error"],執行不正常結束的錯訊息陣列.
                #$result["simpleError"],簡單表示的錯誤訊息.
                #$result["function"],當前執行的函式名稱.
                #$result["argu"],設置給予的參數.
                #$result["passed"],識別要檢查的全體變數是否存在以及型態是否正確的變數,"true"代表檢查全部通過;"false"代表檢查不通過
                #$result[$shouldBeCheckedVarName]["varExist"],所檢查的變數是否存在,"false"代表不存在;"true"代表存在
                #$result[$shouldBeCheckedVarName]["varType"],所檢查的變數型態是否正確,"false"代表錯誤;"true"代表正確
                #$result[$shouldBeCheckedVarName]["error"],每個參數設定的錯誤訊息
                #$result["shouldNotBeEmpty"],不應該為空字串或控陣列的變數.
                #$result["argu"],字串陣列,目前輸入的參數名稱陣列.
                #$result["legalVarName"],字串陣列,合法可用的參數名稱陣列.
                #$result["notNeedVar"],字串陣列,多餘的參數名稱.
                #必填參數:
                #$conf["varInput"],陣列變數,要檢查的陣列變數,請在要檢查的參數前面加上&,這樣變動的結果才能被套用。
                $conf["variableCheck::checkArguments"]["varInput"]=&$conf;
                #$conf["referenceVarKey"],字串,$conf參數後面的key值,用於移除不要的參考陣列.
                $conf["variableCheck::checkArguments"]["referenceVarKey"]="variableCheck::checkArguments";
                #可省略參數:
                #$conf["mustBeFilledVariableName"],爲必填參數的變數名稱陣列,形態爲陣列變數,元素數量需要跟"mustBeFilledVariableType"參數的元素數量一致,例如: $conf["mustBeFilledVariableName"] = array("id","account","password");
                $conf["variableCheck::checkArguments"]["mustBeFilledVariableName"]=array("fileArgu","file","formats","replaceTo");
                #$conf["mustBeFilledVariableType"],爲必填參數的變數陣列應該爲何種變數形態,形態爲陣列,元素數量需要跟"mustBeFilledVariableName"參數的元素數量一致,例如: $conf["mustBeFilledVariableType"] = array("string",integer,"double","resource","object"); , null、any代表不指定變數形態.其中 resource也包含"resource (closed)".
                $conf["variableCheck::checkArguments"]["mustBeFilledVariableType"]=array("string","string","array","array");
                #$conf["canBeEmptyString"],字串,必填變數內容如果是空字串就不能算是有設置的話,請設為"false",預設爲"true",可以為空字串.
                $conf["variableCheck::checkArguments"]["canBeEmptyString"]="false";
                #$conf["canNotBeEmpty"],字串陣列,哪些必填參數的內容不得為空字串或空陣列,僅當$conf["canBeEmptyString"]為"true"時會生效.
                #$conf["canNotBeEmpty"]=array();
                #$conf["canBeEmpty"],字串陣列,哪些必填參數的內容可為空字串或空陣列,僅當$conf["canBeEmptyString"]為"false"時會生效.
                #$conf["canBeEmpty"]=array();
                #$conf["skipableVariableCanNotBeEmpty"],字串陣列,哪些可省略參數不可以為空字串或空陣列.
                #$conf["skipableVariableCanNotBeEmpty"]=array();
                #$conf["skipableVariableName"],陣列字串,爲可省略參數的變數名稱陣列,形態爲陣列變數,例如: $conf["skipableVariableName"] = array("id","account","password");
                #$conf["skipableVariableName"]=array();
                #$conf["skipableVariableType"],陣列字串,爲可省略參數的變數名稱陣列,形態爲陣列變數,例如: $conf["skipableVariableType"] = array("string",integer,"double");
                #$conf["skipableVariableType"]=array();
                #$conf["skipableVarDefaultValue"],字串陣列,每個不存在的可省略變數要初始化為什麼,null與代表不指定,若預設值是參數之一,請將$conf["mustBeFilledVar"]改成"\$conf["\mustBeFilledVar\"]".
                #$conf["skipableVarDefaultValue"]=array("");
                #$conf["disallowAllSkipableVarIsEmpty"],字串,是否允許每個可省略參數都為空字串,預設為"true"允許,反之為"false".
                #$conf["disallowAllSkipableVarIsEmpty"]="";
                #$conf["disallowAllSkipableVarIsEmptyArray"],字串,是否允許每個可省略參數都為空陣列,預設為"true"允許,反之為"false".
                #$conf["disallowAllSkipableVarIsEmptyArray"]="";
                #$conf["disallowAllSkipableVarNotExist"],字串,是否不允許每個可省略參數都不存在,預設為"false"代表允許,反之為"true".
                #$conf["disallowAllSkipableVarNotExist"]="";
                #$conf["arrayCountEqualCheck"],字串陣列,為檢查哪些陣列參數的元素數量要一樣,$conf["arrayCountEqualCheck"][$i]=array()為第$i組key為哪些的變數其元素數量要相等.
                #$conf["arrayCountEqualCheck"][]=array();
                #參考資料:
                #array_keys=>http://php.net/manual/en/function.array-keys.php
                #備註:
                #無.
                $checkArguments=variableCheck::checkArguments($conf["variableCheck::checkArguments"]);
                unset($conf["variableCheck::checkArguments"]);
                
                #如果執行失敗
                if($checkArguments["status"]==="false"){
                
                        #設置錯誤識別
                        $result["status"]="false";
                        
                        #設置錯誤訊息
                        $result["error"]=$checkArguments;
                        
                        #回傳結果
                        return $result;
                
                        }#if end
                        
                #如果檢查參數不通過
                if($checkArguments["passed"]==="false"){
                
                        #設置錯誤識別
                        $result["status"]="false";
                        
                        #設置錯誤訊息
                        $result["error"]=$checkArguments;
                        
                        #回傳結果
                        return $result;
                
                        }#if end
                
                #取得檔案的內容
                #函式說明:
                #依據行號分隔抓取檔案的內容,結果會回傳一個陣列
                #回傳的變數說明:
                #$result["status"],執行是否成功,"true"代表成功;"fasle"代表失敗.
                #$result["error"],錯誤訊息提示.
                #$result["warning"],警告訊息.
                #$result["function"],當前執行的函數名稱.
                #$result["fileContent"],爲檔案的內容陣列.
                #$result["lineCount"],爲檔案內容總共的行數.
                #$result["fullContent"],為檔案的完整內容.
                #$result["base64data"],為檔案的base64內容.
                #$result["mimeType"],為檔案的mime type.
                #必填參數:
                #$conf["filePositionAndName"],字串,爲檔案的位置以及名稱.
                $conf["fileAccess::getFileContent"]["filePositionAndName"]=$conf["file"];
                #$conf["fileArgu"],字串,php變數__FILE__的內容,亦即該檔案在檔案系統的絕對路徑
                $conf["fileAccess::getFileContent"]["fileArgu"]=$conf["fileArgu"];
                #可省略參數:
                #$conf["web"],是要取得網路上的檔案則為"true";反之預設為"false".
                #$conf["web"]="true";
                #$conf["createIfnotExist"],字串,預設為"false"代表檔案不存在也不需要建立;反之為"true".
                #$conf["createIfnotExist"]="false";
                #$conf["autoDeleteSpaceOnEachLineStart"],字串,預設為"false",不做額外處理;反之為"true"
                #$conf["autoDeleteSpaceOnEachLineStart"]="false";
                #參考資料:
                #file(),取得檔案內容的行數.
                #file=>http:#php.net/manual/en/function.file.php
                #rtrim(),剔除透過file()取得每行內容結尾的換行符號.
                #filesize=>http://php.net/manual/en/function.filesize.php
                #參考資料:
                #無.
                #備註:
                #無.
                $getFileContent=fileAccess::getFileContent($conf["fileAccess::getFileContent"]);
                unset($conf["fileAccess::getFileContent"]);
        
                #如果執行失敗
                if($getFileContent["status"]==="false"){
                
                        #設置錯誤識別
                        $result["status"]="false";
                        
                        #設置錯誤訊息
                        $result["error"]=$getFileContent;
                        
                        #回傳結果
                        return $result;
                
                        }#if end
                        
                #尋找連續的多行字串是否依順含有符合格式的內容,且回傳解析好的變數數值.
                #回傳結果:
                #$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
                #$reuslt["error"],執行不正常結束的錯訊息陣列.
                #$result["function"],當前執行的函式名稱.
                #$result["argu"],所使用的參數.
                #$result["found"],是否有找到符合格式的連續字串內容,"true"代表有找到,"false"代表沒有找到.
                #$result["content"],陣列,每段符合格式的段落資訊.
                #$result["content"][$i]["lineS"],字串,為第 $i+1 個符合格式的段落起始行數.
                #$result["content"][$i]["ori"],字串,為第 $i+1 個符合格式的段落每行原始內容資訊.
                #$result["content"][$i]["deletedHead"],字串,為第 $i+1 個符合格式的段落每行原始內容被剔除的開頭資訊.
                #$result["content"][$i]["new"],字串,為第 $i+1 個符合格式的段落每行關鍵字內容.
                #$result["content"][$i]["vars"],陣列,為第 $i+1 個符合格式的段落每行變數解析的結果.
                #必填參數:
                #$conf["input"],字串陣列,要檢查的每行字串.
                $conf["search::findConMatchStrs"]["input"]=$getFileContent["fileContent"];
                #$conf["format"],格式字串陣列,要尋找的每行格式字串集合.格式為固定的字串("fixedStr format")與變數("${keyWordVarName}")組成.
                $conf["search::findConMatchStrs"]["formats"]=$conf["formats"];
                #可省略參數:
                #無.
                #參考資料:
                #無.
                #備註:
                #回傳結果 $result["content"][$i]["ori"][$j]=array("index"=>$oriLineIndex,"value"=>$oriLineContent) 代表第 $i+1 個符合格式的段落中第 $j+1 個原始內容對應的行數($oriLineIndex+1),其原始內容為 $oriLineContent.
                $findConMatchStrs=search::findConMatchStrs($conf["search::findConMatchStrs"]);
                unset($conf["search::findConMatchStrs"]);
        
                #如果執行失敗
                if($findConMatchStrs["status"]==="false"){
                
                        #設置錯誤識別
                        $result["status"]="false";
                        
                        #設置錯誤訊息
                        $result["error"]=$findConMatchStrs;
                        
                        #回傳結果
                        return $result;
                
                        }#if end
                
                #如果沒有符合的連續字串格式
                if($findConMatchStrs["found"]==="false"){
                
                        #設置執行正常的識別
                        $result["status"]="true";
                        
                        #設置沒有找到符合格式內容
                        $result["found"]="false";
                        
                        #回傳結果
                        return $result;
                
                        }#if end
                
                #初始化儲存內容置換資訊的變數
                $result["relaceInfo"]=array();
                
                #debug
                #var_dump(__LINE__,$findConMatchStrs["content"]);exit;
                
                #執行到這邊代表有遇到符合的連續字串格式
                foreach($findConMatchStrs["content"] as $matchSectionIndex => $sInfo){
                
                        #針對符合的每行內容
                        foreach($sInfo["ori"] as $index => $lInfo){
                        
                                #取得對應的原始行索引
                                $oriLineNo=$lInfo["index"];
                                
                                #取得對應的原始行內容
                                $oriLineContent=$lInfo["value"];
                                
                                #儲存被剔除的開頭部分
                                $deletedOriHead=$lInfo["deletedHead"];
                        
                                #如果沒有對應的要取代格式
                                if(!isset($conf["replaceTo"][$index])){
                                
                                        #不處理
                                        continue;
                                
                                        }#if end
                        
                                #如果解析的結果有變數
                                if(empty($sInfo["vars"][$index])){
                                        
                                        #debug
                                        #var_dump(__LINE__,$index,$sInfo["vars"][$index]);
                                        
                                        #執行到這邊代表有對應的要取代格式
                                        
                                        #debug
                                        #var_dump(__LINE__,$index,gettype($conf["replaceTo"][$index]),$conf["replaceTo"]);
                                        
                                        #如果取代格式不為字串
                                        if(gettype($conf["replaceTo"][$index])!=="string"){
                                        
                                                #設置執行不正常的識別
                                                $result["status"]="false";
                                                
                                                #設置錯誤訊息
                                                $result["error"]="參數 formats 跟 replaceTo 的對應有錯誤.";
                                                
                                                #回傳結果
                                                return $result;
                                        
                                                }#if end
                                        
                                        #執行到這邊代表檢查通過
                                        
                                        #記錄取代的資訊
                                        $result["relaceInfo"][$oriLineNo]=array("deletedOriHead"=>$deletedOriHead,"ori"=>$oriLineContent,"new"=>$conf["replaceTo"][$index]);
                                
                                        }#if end
                                        
                                #反之代表有解析出變數
                                else{
                                
                                        #debug
                                        #var_dump(__LINE__,gettype($conf["replaceTo"][$index]));
                                
                                        #如果取代格式不為陣列
                                        if(gettype($conf["replaceTo"][$index])!=="array"){
                                        
                                                #設置執行不正常的識別
                                                $result["status"]="false";
                                                
                                                #設置錯誤訊息
                                                $result["error"]="參數 formats 跟 replaceTo 的對應有錯誤.";
                                                
                                                #回傳結果
                                                return $result;
                                        
                                                }#if end
                                                
                                        #執行到這邊代表檢查通過
                                        
                                        #初始化替換好的內容
                                        $newLineContent=$oriLineContent;
                                        
                                        #針對每個解析出來的變數
                                        foreach($conf["replaceTo"][$index] as $varName => $newVal){
                                                
                                                #取得原始解析出來的內容
                                                $oriVal=$sInfo["vars"][$index][$varName][0];
                                                
                                                #將關鍵字取代
                                                #函式說明:
                                                #將字串中的特定內容取代.
                                                #回傳結果:
                                                #$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
                                                #$result["function"],當前執行的函數.
                                                #$result["content"],爲處理好的字串.
                                                #$result["error"],錯誤訊息陣列.
                                                #$result["argu"],使用的參數. 
                                                #必填參數:
                                                #$conf["stringIn"],字串,爲要處理的字串
                                                $conf["stringProcess::replaceOnce"]["stringIn"]=$newLineContent;
                                                #$conf["selectedCharacter"],字串,爲被選擇要處理的字串/字元,\n」代表換行,「\t」代表tab鍵的間隔.
                                                $conf["stringProcess::replaceOnce"]["selectedCharacter"]=$oriVal;
                                                #$conf["changeTo"],字串,爲被選擇的字元要換成什麼字串/字元.
                                                $conf["stringProcess::replaceOnce"]["changeTo"]=$newVal;
                                                #參考資料:
                                                #無.
                                                #備註:
                                                #無.
                                                $replaceOnce=stringProcess::replaceOnce($conf["stringProcess::replaceOnce"]);
                                                unset($conf["stringProcess::replaceOnce"]);
                                        
                                                #debug
                                                #var_dump(__LINE__,$replaceOnce);
                                        
                                                #如果執行失敗
                                                if($replaceOnce["status"]==="false"){
                                                
                                                        #設置錯誤識別
                                                        $result["status"]="false";
                                                        
                                                        #設置錯誤訊息
                                                        $result["error"]=$replaceOnce;
                                                        
                                                        #回傳結果
                                                        return $result;
                                                
                                                        }#if end
                                                
                                                #儲存該階段替換好的內容
                                                $newLineContent=$replaceOnce["content"];
                                                
                                                }#foreach end
                                        
                                        #記錄取代的資訊
                                        $result["relaceInfo"][$oriLineNo]=array("deletedOriHead"=>$deletedOriHead,"ori"=>$oriLineContent,"new"=>$newLineContent);
                                        
                                        }#else end
                                
                                }#foreach end
                                
                        }#foreach end
                
                #初始化替換好的內容為原始內容
                $result["content"]=$getFileContent["fileContent"];
                
                #依照內容替代的資訊
                foreach($result["relaceInfo"] as $lineIndex =>$info){
                
                        #儲存新的行內容
                        $newLine=$info["new"];
                        
                        #儲存被剔除的開頭字串
                        $deletedOriHead=$info["deletedOriHead"];
                
                        #debug
                        #var_dump(__FILE__,__LINE__,$lineIndex,$deletedOriHead,$newLine);
                
                        #儲存置換好的行
                        $result["content"][$lineIndex]=$deletedOriHead.$newLine;
                
                        }#foreach end
                
                #設置有找到要取代的內容
                $result["found"]="true";
                
                #設置執行正常
                $result["status"]="true";
                
                #回傳結果
                return $result;
                        
                }#function replaceMatchContent end
        
        }#class phpLib end

?>