Subversion Repositories qbpwcf-lib(archive)

Rev

Rev 915 | Blame | Compare with Previous | Last modification | View Log | RSS feed

<?php

/*

        QBPWCF, Quick Build PHP website Component base on Fedora Linux.
    Copyright (C) 2015~2024 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;

/*
類別說明:
跟 xml 處理的類別.
備註:
無.
*/
class xml{

        /*
        #函式說明:
        #當前類別被呼叫的靜態方法不存在時,將會執行該函數,回報該方法不存在.
        #回傳結果:
        #$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,陣列,為呼叫方法時所用的參數.
        #參考資料:
        #__call=>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

        /*
        #函式說明:
        #讀取xml檔案,儲存所有標籤的內容,目前尚不能讀取屬性的資訊
        #回傳結果:
        #$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
        #$reuslt["error"],執行不正常結束的錯訊息陣列.
        #$result["function"],當前執行的函式名稱.
        #$result["founded"],是否有抓到xml檔案,"true"代表有抓到,"false"代表沒有抓到.
        #$result["content"],xml的物件內容.
        #$result["argu"],所使用的參數.
        #必填參數:
        #$conf["xmlPosition"],字串,xml檔案的位置.
        $conf["xmlPosition"]="";
        #$conf["fileArgu"],字串,php變數__FILE__的內容,亦即該檔案在檔案系統的絕對路徑
        $conf["fileArgu"]=__FILE__;
        #可省略參數:
        #無.
        #參考資料來源:
        #XML範例檔=>http://msdn.microsoft.com/zh-tw/library/bb387025.aspx
        #simplexml-load-file=>http://php.net/manual/en/function.simplexml-load-file.php
        #取得xml檔案內容的示範=>http://php.net/manual/en/simplexml.examples-basic.php
        #啟用處理xml的錯誤處理=>http://php.net/manual/en/function.libxml-use-internal-errors.php
        #取得處理xml的錯誤訊息=>http://php.net/manual/en/function.libxml-get-errors.php
        #備註:
        #無.
        */
        public static function getContent(&$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["argu"]=$conf;
                
                #檢查參數
                #函式說明:
                #檢查必填與可省略的參數,可省略參數可指定預設要給與什麼數值內容。
                #$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
                #$reuslt["error"],執行不正常結束的錯訊息陣列.
                #$result["function"],當前執行的函式名稱.
                #$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["mustBeFilledVariableName"],爲必填參數的變數名稱陣列,形態爲陣列變數,元素數量需要跟"mustBeFilledVariableType"參數的元素數量一致,例如: $conf["mustBeFilledVariableName"] = array("id","account","password");
                $conf["variableCheck::checkArguments"]["mustBeFilledVariableName"]=array("fileArgu","xmlPosition");
                #$conf["mustBeFilledVariableType"],爲必填參數的變數陣列應該爲何種變數形態,形態爲陣列,元素數量需要跟"mustBeFilledVariableName"參數的元素數量一致,例如: $conf["mustBeFilledVariableType"] = array("string",integer,"double","resource","object"); 
                $conf["variableCheck::checkArguments"]["mustBeFilledVariableType"]=array("string","string");
                #$conf["referenceVarKey"],字串,$conf參數後面的key值,用於移除不要的參考陣列.
                $conf["variableCheck::checkArguments"]["referenceVarKey"]="variableCheck::checkArguments";
                #可以省略的參數:
                #$conf["canBeEmptyString"],字串,必填變數內容如果是空字串就不能算是有設置的話,請設為"false",預設爲"true",可以為空字串.
                #$conf["canBeEmptyString"]="false";
                #$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["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」目錄開始的路徑.
                #$result["fileSystemRelativePosition"],針對伺服器檔案系統的相對位置.
                #必填參數:
                #$conf["address"],字串,檔案的相對位置,若為絕對位置則會自動轉換成相對位置.
                $conf["fileAccess::getInternetAddressV2"]["address"]=$conf["xmlPosition"];
                #$conf["fileArgu"],字串,php變數__FILE__的內容,亦即該檔案在檔案系統的絕對路徑.
                $conf["fileAccess::getInternetAddressV2"]["fileArgu"]=$conf["fileArgu"];
                #可省略參數:
                #$conf["web"],字串,"true"代表檔案是放在web環境;"false"是代表在檔案系統環境.
                $conf["fileAccess::getInternetAddressV2"]["web"]="false";
                #備註:
                #建構中,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["xmlPosition"]=$getInternetAddressV2["fileSystemAbsoulutePosition"];
                
                #檢查xml檔案是否存在
                #函式說明:檢查多個檔案與資料夾是否存在.
                #回傳的結果:
                #$result["status"],執行正常與否,"true"代表正常,"false"代表不正常.
                #$result["error"],錯誤訊息陣列.
                #$resutl["function"],當前執行的涵式名稱.
                #$result["allExist"],所有檔案皆存在的識別,"true"代表皆存在,"false"代表沒有全部都存在.
                #$result["varName"][$i],爲第$i個資料夾或檔案的名稱。
                #$result["varExist"][$i],爲第$i個資料夾或檔案是否存在,"true"代表存在,"false"代表不存在。
                #必填的參數:
                $conf["fileAccess::checkMultiFileExist"]["fileArray"]=array($conf["xmlPosition"]);#要檢查書否存在的檔案有哪些,須爲一維陣列數值。
                #$conf["fileArgu"],字串,php變數__FILE__的內容,亦即該檔案在檔案系統的絕對路徑
                $conf["fileAccess::checkMultiFileExist"]["fileArgu"]=$conf["fileArgu"];
                #參考資料來源:
                $conf["fileAccess::checkMultiFileExist"]["web"]="false";
                #http://php.net/manual/en/function.file-exists.php
                #http://php.net/manual/en/control-structures.foreach.php
                $checkMultiFileExist=fileAccess::checkMultiFileExist($conf["fileAccess::checkMultiFileExist"]);
                unset($conf["fileAccess::checkMultiFileExist"]);
                
                #如果檢查檔案是否存在失敗
                if($checkMultiFileExist["status"]==="false"){
                        
                        #設置錯誤識別
                        $result["status"]="false";
                        
                        #設置錯誤訊息
                        $result["error"]=$checkMultiFileExist;
                        
                        #回傳結果
                        return $result;
                        
                        }#if end
                        
                #如果xml檔案不存在
                if($checkMultiFileExist["varExist"][0]==="false"){
                        
                        #設置錯誤識別
                        $result["status"]="false";
                        
                        #設置錯誤訊息
                        $result["error"][]="檔案路徑為「".$checkMultiFileExist["varName"][0]."」的xml檔案不存在!";
                        
                        #設置沒有找到 xml 檔案
                        $result["founded"]="false";
                        
                        #回傳結果
                        return $result;
                        
                        }#if end
                
                #啟用 xml 的錯誤處理
                libxml_use_internal_errors(true);
                
                #讀取目標xml檔案
                $xml = simplexml_load_file($conf["xmlPosition"]);
                
                #如果讀取 xml 檔案失敗
                if($xml===false){
                        
                        #設置錯誤識別
                        $result["status"]="false";
                        
                        #設置錯誤訊息
                        $result["error"][]="讀取xml檔案失敗!";
                        
                        #解析讀取xml所得到的每個錯誤
                        foreach (libxml_get_errors() as $error){
                                                        
                                #取得每個錯誤訊息
                                $result["error"][]=$error;
                                
                                }#foreache end
                        
                        #回傳結果
                        return $result;
                        
                        }#if end
                
                #取得 xml 的內容
                $result["content"]=$xml;
                        
                #設置有找到 xml 檔案
                $result["founded"]="true";      
                                                                
                #設置執行正常
                $result["status"]="true";
                        
                #回傳抓取到的解果
                return $result;
                
                }#function getContent end

        /*
        #函式說明:
        #取得xml特定標籤的內容
        #回傳結果:
        #$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
        #$reuslt["error"],執行不正常結束的錯訊息陣列.
        #$result["warning"],警告訊息陣列.
        #$result["function"],當前執行的函式名稱.
        #$result["tagExist"],"true"代表目標標籤存在,"false"代表標籤不存在.
        #$result["content"],xml物件的標籤內容.
        #$result["tag"],修正名稱格式後取得目標標籤內容的階層陣列.
        #必填參數:
        #$conf["xmlPosition"],字串,xml檔案的位置.
        $conf["xmlPosition"]="";
        #$conf["fileArgu"],字串,php變數__FILE__的內容,亦即該檔案在檔案系統的絕對路徑
        $conf["fileArgu"]=__FILE__;
        #$conf["tag"],陣列,目標標籤的名稱,每個元素代表層級的名稱.
        $conf["tag"]=array("");
        #可省略參數:
        #無.
        #備註:
        #無.
        */
        static function getTagInfo(&$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($conf==null){
                                
                                #設置執行錯誤訊息
                                $result["error"][]="\$conf變數不得為null,請檢查函數「".$result["function"]."」的參數設置有無正確!";
                                
                                }#if end

                        #回傳結果
                        return $result;
                        
                        }#if end
        
                #檢查參數
                #函式說明:
                #檢查必填與可省略的參數,可省略參數可指定預設要給與什麼數值內容。
                #$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
                #$reuslt["error"],執行不正常結束的錯訊息陣列.
                #$result["function"],當前執行的函式名稱.
                #$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["mustBeFilledVariableName"],爲必填參數的變數名稱陣列,形態爲陣列變數,元素數量需要跟"mustBeFilledVariableType"參數的元素數量一致,例如: $conf["mustBeFilledVariableName"] = array("id","account","password");
                $conf["variableCheck::checkArguments"]["mustBeFilledVariableName"]=array("xmlPosition","fileArgu","tag");
                #$conf["mustBeFilledVariableType"],爲必填參數的變數陣列應該爲何種變數形態,形態爲陣列,元素數量需要跟"mustBeFilledVariableName"參數的元素數量一致,例如: $conf["mustBeFilledVariableType"] = array("string",integer,"double","resource","object"); , null代表不指定變數形態.
                $conf["variableCheck::checkArguments"]["mustBeFilledVariableType"]=array("string","string","array");
                #$conf["referenceVarKey"],字串,$conf參數後面的key值,用於移除不要的參考陣列.
                $conf["variableCheck::checkArguments"]["referenceVarKey"]="variableCheck::checkArguments";
                #可以省略的參數:
                #$conf["canBeEmptyString"],字串,必填變數內容如果是空字串就不能算是有設置的話,請設為"false",預設爲"true",可以為空字串.
                $conf["variableCheck::checkArguments"]["canBeEmptyString"]="false";
                #$conf["skipableVariableCanNotBeEmpty"],字串陣列,哪些可省略參數不可以為空字串或集合.
                #$conf["skipableVariableCanNotBeEmpty"]=array();
                #$conf["skipableVariableName"],陣列字串,爲可省略參數的變數名稱陣列,形態爲陣列變數,例如: $conf["skipableVariableName"] = array("id","account","password");
                #$conf["variableCheck::checkArguments"]["skipableVariableName"]=array("fileArgu","conf","commentsArray");
                #$conf["skipableVariableType"],陣列字串,爲可省略參數的變數名稱陣列,形態爲陣列變數,例如: $conf["skipableVariableType"] = array("string",integer,"double"); 
                #$conf["variableCheck::checkArguments"]["skipableVariableType"]=array("string","string","array");
                #$conf["skipableVarDefaultValue"],字串陣列,每個不存在的可省略變數要初始化為什麼,null與代表不指定,若預設值是參數之一,請將$conf["mustBeFilledVar"]改成"\$conf["\mustBeFilledVar\"]".
                #$conf["variableCheck::checkArguments"]["skipableVarDefaultValue"]=array(__FILE__,".qbpwcf_tmp/cmd/getFromConf/conf.xml",array("請輸入變數 ".$conf["readVarName"]." 的內容"));
                #$conf["arrayCountEqualCheck"],字串陣列,為檢查哪些陣列參數的元素數量要一樣,$conf["arrayCountEqualCheck"][$i]=array()為第$i組key為哪些的變數其元素數量要相等.
                #$conf["variableCheck::checkArguments"]["arrayCountEqualCheck"][]=array("conName","conVal");
                #$conf["variableCheck::checkArguments"]["arrayCountEqualCheck"][]=array("target","styleAttr","styleVal");
                #參考資料來源:
                #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
                
                #過濾 $conf["tag"] 陣列元素的 「::」 字元
                #函式說明:
                #處理多個字串避免網頁出錯
                #回傳的結果:
                #$result["status"],"true"代表執行成功,"false"代表執行失敗。
                #$result["function"],當前執行的函數.
                #$result["error"],錯誤訊息
                #$result["processedStrArray"],處理好的字串陣列
                #必填的參數:
                $conf["stringProcess::correctMutiStrCharacter"]["stringIn"]=$conf["tag"];#爲要處理的字串陣列
                #可省略的參數:
                $conf["stringProcess::correctMutiStrCharacter"]["selectedCharacter"]=array("<",">","=","//","'","$","%","&","|","/*","*","#","\"",":");#爲被選擇要處理的字串/字元,須爲陣列值。
                        #若不設定則預設爲要將這些字串作替換 ("<",">","=","//","'","$","%","&","|","/*","*","#","\"").
                        #特殊字元,「\n」代表換行,「\t」代表tab鍵的間隔
                #$conf["changeTo"]=array();#爲被選擇的字元要換成什麼字串/字元,須爲陣列值。若不設定,則預設爲更換成""(空字串).
                $correctMutiStrCharacter=stringProcess::correctMutiStrCharacter($conf["stringProcess::correctMutiStrCharacter"]);
                unset($conf["stringProcess::correctMutiStrCharacter"]);
                                        
                #如果修正標籤名稱失敗
                if($correctMutiStrCharacter["status"]==="false"){
                        
                        #設置執行不正常
                        $result["status"]="false";
                        
                        #設置執行錯誤
                        $result["error"]=$correctMutiStrCharacter;
                        
                        #回傳結果
                        return $result;
                        
                        }#if end
                        
                #取得修正好的tag名稱
                $result["tag"]=$conf["tag"]=$correctMutiStrCharacter["processedStrArray"];
                
                #函數說明:
                #將檔案的位置名稱變成網址,也可以取得檔案位於伺服器上檔案系統的絕對位置.
                #回傳結果:
                #$result["status"],"true"爲建立成功,"false"爲建立失敗.
                #$result["error"],錯誤訊息陣列.
                #$result["function"],函數名稱. 
                #$result["argu"],使用的參數.
                #$result["content"],網址,若是在命令列執行,則為"null".
                #$result["webPathFromRoot"],相對於網頁根目錄的路徑.
                #$result["fileSystemAbsoulutePosition"],針對伺服器端的絕對位置,亦即從網頁「document_root」目錄開始的路徑.
                #$result["fileSystemRelativePosition"],針對伺服器檔案系統的相對位置.
                #必填參數:
                #$conf["address"],字串,檔案的相對位置,若為絕對位置則會自動轉換成相對位置.
                $conf["fileAccess::getInternetAddressV2"]["address"]=$conf["xmlPosition"];
                #$conf["fileArgu"],字串,php變數__FILE__的內容,亦即該檔案在檔案系統的絕對路徑.
                $conf["fileAccess::getInternetAddressV2"]["fileArgu"]=$conf["fileArgu"];
                #可省略參數:
                #$conf["web"],字串,"true"代表檔案是放在web環境;"false"是代表在檔案系統環境,預設為"true".
                $conf["fileAccess::getInternetAddressV2"]["web"]="false";
                #備註:
                #建構中,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["xmlPosition"]=$getInternetAddressV2["fileSystemAbsoulutePosition"];
                
                #函式說明:
                #讀取xml檔案,儲存所有標籤的內容,目前尚不能讀取屬性的資訊
                #回傳結果:
                #$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
                #$reuslt["error"],執行不正常結束的錯訊息陣列.
                #$result["function"],當前執行的函式名稱.
                #$result["founded"],是否有抓到xml檔案,"true"代表有抓到,"false"代表沒有抓到.
                #$result["content"],xml的物件內容.
                #必填參數:
                #$conf["xmlPosition"],字串,xml檔案的位置.
                $conf["xml::getContent"]["xmlPosition"]=$conf["xmlPosition"];
                #$conf["fileArgu"],字串,php變數__FILE__的內容,亦即該檔案在檔案系統的絕對路徑
                $conf["xml::getContent"]["fileArgu"]=$conf["fileArgu"];
                #參考資料來源:
                #XML範例檔=>http://msdn.microsoft.com/zh-tw/library/bb387025.aspx
                #simplexml-load-file=>http://php.net/manual/en/function.simplexml-load-file.php
                #取得xml檔案內容的示範=>http://php.net/manual/en/simplexml.examples-basic.php
                #啟用處理xml的錯誤處理=>http://php.net/manual/en/function.libxml-use-internal-errors.php
                #取得處理xml的錯誤訊息=>http://php.net/manual/en/function.libxml-get-errors.php
                $getContent=xml::getContent($conf["xml::getContent"]);
                unset($conf["xml::getContent"]);
                
                #如果取得 xml 內容失敗
                if($getContent["status"]==="false"){
                                                
                        #設置執行不正常
                        $result["status"]="false";
                        
                        #設置執行錯誤
                        $result["error"]=$getContent;
                        
                        #回傳結果
                        return $result;
                        
                        }#if end
                
                #儲存目前所指的tag內容
                $tagPointer="";
                                        
                #針對每層 $conf["tag"]
                foreach($conf["tag"] as $tag){
                        
                        #過濾標籤
                        
                        #如果 $tagPointer 為 ""
                        if($tagPointer===""){
                                
                                #如果 $tag 存在 
                                if(isset($getContent["content"]->$tag)){
                                        
                                        #取得tag的pointer
                                        $tagPointer=$getContent["content"]->$tag;
                                        
                                        }#if end
                                        
                                #反之
                                else{
                                        
                                        #設置執行不正常
                                        $result["status"]="true";
                                        
                                        #設置執行錯誤
                                        $result["warning"][]="標籤 ".$tag." 不存在";
                                        
                                        #設置tag不存在
                                        $result["tagExist"]="false";
                                        
                                        #回傳結果
                                        return $result;
                                        
                                        }#else end
                                
                                }#if end
                                                
                        #如果標籤不存在
                        else if(isset($tagPointer->$tag)){
                                
                                #取得tag pointer
                                $tagPointer=$tagPointer->$tag;
                                
                                }#if end
                        
                        #反之標籤存在
                        else{                           
                                                                                        
                                #設置執行不正常
                                $result["status"]="true";
                                
                                #設置執行錯誤
                                $result["warning"][]="標籤 ".$tag." 不存在";
                                
                                #設置tag不存在
                                $result["tagExist"]="false";
                                
                                #回傳結果
                                return $result;                                                         
                                                                                                
                                }#else end
                        
                        }#foreach end   
                        
                #設置tag存在
                $result["tagExist"]="true";
                
                #設置tag內容
                $result["content"]=$tagPointer; 
                        
                #設置執行正常
                $result["status"]="true";                               
                        
                #回傳結果
                return $result;
                
                }#function getTagInfo end

        /*
        #函式說明:
        #建立空的xml檔案
        #回傳結果:
        #$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
        #$reuslt["error"],執行不正常結束的錯訊息陣列.
        #$result["function"],當前執行的函式名稱.
        #$result["content"],xml檔案的路徑.
        #必填參數:
        #$conf["xmlPosition"],字串,xml檔案的位置.
        $conf["xmlPosition"]="";
        #$conf["fileArgu"],字串,php變數__FILE__的內容,亦即該檔案在檔案系統的絕對路徑
        $conf["fileArgu"]=__FILE__; 
        #可省略參數:
        #無.
        #參考資料:
        #simplexmlelement=>http://php.net/manual/en/simplexmlelement.asxml.php
        #備註:
        #無.
        */
        static function createEmptyXml(&$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($conf==null){
                                
                                #設置執行錯誤訊息
                                $result["error"][]="\$conf變數不得為null,請檢查函數「".$result["function"]."」的參數設置有無正確!";
                                
                                }#if end

                        #回傳結果
                        return $result;
                        
                        }#if end
        
                #檢查參數
                #函式說明:
                #檢查必填與可省略的參數,可省略參數可指定預設要給與什麼數值內容。
                #$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
                #$reuslt["error"],執行不正常結束的錯訊息陣列.
                #$result["function"],當前執行的函式名稱.
                #$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["mustBeFilledVariableName"],爲必填參數的變數名稱陣列,形態爲陣列變數,元素數量需要跟"mustBeFilledVariableType"參數的元素數量一致,例如: $conf["mustBeFilledVariableName"] = array("id","account","password");
                $conf["variableCheck::checkArguments"]["mustBeFilledVariableName"]=array("xmlPosition","fileArgu");
                #$conf["mustBeFilledVariableType"],爲必填參數的變數陣列應該爲何種變數形態,形態爲陣列,元素數量需要跟"mustBeFilledVariableName"參數的元素數量一致,例如: $conf["mustBeFilledVariableType"] = array("string",integer,"double","resource","object"); , null代表不指定變數形態.
                $conf["variableCheck::checkArguments"]["mustBeFilledVariableType"]=array("string","string");
                #$conf["referenceVarKey"],字串,$conf參數後面的key值,用於移除不要的參考陣列.
                $conf["variableCheck::checkArguments"]["referenceVarKey"]="variableCheck::checkArguments";
                #可以省略的參數:
                #$conf["canBeEmptyString"],字串,必填變數內容如果是空字串就不能算是有設置的話,請設為"false",預設爲"true",可以為空字串.
                $conf["variableCheck::checkArguments"]["canBeEmptyString"]="false";
                #$conf["skipableVariableCanNotBeEmpty"],字串陣列,哪些可省略參數不可以為空字串或集合.
                #$conf["skipableVariableCanNotBeEmpty"]=array();
                #$conf["skipableVariableName"],陣列字串,爲可省略參數的變數名稱陣列,形態爲陣列變數,例如: $conf["skipableVariableName"] = array("id","account","password");
                #$conf["variableCheck::checkArguments"]["skipableVariableName"]=array("fileArgu","conf","commentsArray");
                #$conf["skipableVariableType"],陣列字串,爲可省略參數的變數名稱陣列,形態爲陣列變數,例如: $conf["skipableVariableType"] = array("string",integer,"double"); 
                #$conf["variableCheck::checkArguments"]["skipableVariableType"]=array("string","string","array");
                #$conf["skipableVarDefaultValue"],字串陣列,每個不存在的可省略變數要初始化為什麼,null與代表不指定,若預設值是參數之一,請將$conf["mustBeFilledVar"]改成"\$conf["\mustBeFilledVar\"]".
                #$conf["variableCheck::checkArguments"]["skipableVarDefaultValue"]=array(__FILE__,".qbpwcf_tmp/cmd/getFromConf/conf.xml",array("請輸入變數 ".$conf["readVarName"]." 的內容"));
                #$conf["arrayCountEqualCheck"],字串陣列,為檢查哪些陣列參數的元素數量要一樣,$conf["arrayCountEqualCheck"][$i]=array()為第$i組key為哪些的變數其元素數量要相等.
                #$conf["variableCheck::checkArguments"]["arrayCountEqualCheck"][]=array("conName","conVal");
                #$conf["variableCheck::checkArguments"]["arrayCountEqualCheck"][]=array("target","styleAttr","styleVal");
                #參考資料來源:
                #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["content"],網址,若是在命令列執行,則為"null".
                #$result["webPathFromRoot"],相對於網頁根目錄的路徑.
                #$result["fileSystemAbsoulutePosition"],針對伺服器端的絕對位置,亦即從網頁「/」目錄開始的路徑.
                #$result["fileSystemRelativePosition"],針對伺服器檔案系統的相對位置.
                #必填參數:
                #$conf["address"],字串,檔案的相對位置,若為絕對位置則會自動轉換成相對位置.
                $conf["csInformation::getInternetAddress"]["address"]=$conf["xmlPosition"];
                #$conf["fileArgu"],字串,php變數__FILE__的內容,亦即該檔案在檔案系統的絕對路徑.
                $conf["csInformation::getInternetAddress"]["fileArgu"]=$conf["fileArgu"];
                #可省略參數:
                #$conf["userDir"],字串,網頁是否置放於家目錄底下,"true"為是,"false"為不是,預設為"true".
                $conf["csInformation::getInternetAddress"]["userDir"]="true";
                #備註:
                #在命令列執行,所得的路徑是錯誤的。
                $getInternetAddress=fileAccess::getInternetAddress($conf["csInformation::getInternetAddress"]);
                unset($conf["csInformation::getInternetAddress"]);
                
                #如果轉換位置失敗
                if($getInternetAddress["status"]=="false"){
                        
                        #設置執行不正常
                        $result["status"]="false";
                        
                        #設置執行錯誤
                        $result["error"]=$getInternetAddress;
                        
                        #回傳結果
                        return $result;
                        
                        }#if end
                
                #取得轉換好的絕對位置
                $conf["xmlPosition"]=$getInternetAddress["fileSystemAbsoulutePosition"];
                
                #建立xml樣本        
                $xmlStr = <<<XML
<root></root>
XML;
                
                #建立xml物件
                $xml = new \SimpleXMLElement($xmlStr);
                
                #轉換成xml字串
                $xml=$xml->asXML();
                
                #檢查xml檔有存在
                #函式說明:檢查多個檔案與資料夾是否存在.
                #回傳的結果:
                #$result["status"],執行正常與否,"true"代表正常,"false"代表不正常.
                #$result["error"],錯誤訊息陣列.
                #$resutl["function"],當前執行的涵式名稱.
                #$result["allExist"],所有檔案皆存在的識別,"true"代表皆存在,"false"代表沒有全部都存在.
                #$result["varName"][$i],爲第$i個資料夾或檔案的路徑與名稱。
                #$result["varNameFullPath"][$i],爲第$i個資料夾或檔案的完整檔案系統路徑與名稱。
                #$result["varNameWebPath"][$i],為第$i個資料夾或檔案的網址
                #$result["varExist"][$i],爲第$i個資料夾或檔案是否存在,"true"代表存在,"false"代表不存在。
                #必填參數:
                #$conf["fileArray"],陣列字串,要檢查是否存在的檔案有哪些,須爲一維陣列數值。
                $conf["fileAccess::checkMultiFileExist"]["fileArray"]=array($conf["xmlPosition"]);
                #$conf["fileArgu"],字串,php變數__FILE__的內容,亦即該檔案在檔案系統的絕對路徑
                $conf["fileAccess::checkMultiFileExist"]["fileArgu"]=$conf["fileArgu"];
                #可省略參數
                #$conf["disableWebSearch"],"字串",是否取消「當檔案找不到時,改用catchWebContent類別的wget函數來檢查檔案是否存在於網路上」的功能,"false"不取消,若要取消該功能請設為"true",若抓到的內容為空字串則會視為檔案不存在,預設為"true".
                #$conf["disableWebSearch"]="false";
                #$conf["userDir"],字串,網頁是否置放於家目錄底下,"true"為是,"false"為不是,預設為"true".
                #$conf["userDir"]="true";
                #參考資料來源:
                #http://php.net/manual/en/function.file-exists.php
                #http://php.net/manual/en/control-structures.foreach.php
                #備註:
                #函數file_exists檢查的路徑為檔案系統的路徑
                $checkMultiFileExist=fileAccess::checkMultiFileExist($conf["fileAccess::checkMultiFileExist"]);
                unset($conf["fileAccess::checkMultiFileExist"]);
                
                #如果檢查xml檔是否存在失敗
                if($checkMultiFileExist["status"]=="false"){
                        
                        #設置執行不正常
                        $result["status"]="false";
                        
                        #設置執行錯誤
                        $result["error"]=$checkMultiFileExist;
                        
                        #回傳結果
                        return $result;
                        
                        }#if end
                        
                #如果xml檔不存在
                if($checkMultiFileExist["allExist"]=="false"){
                        
                        #建立xml檔的路徑
                        #函式說明:
                        #確保路徑存在.
                        #回傳的結果:
                        #$result["status"],執行正常與否,"true"代表正常,"false"代表不正常.
                        #$result["error"],錯誤訊息陣列.
                        #$resutl["function"],當前執行的涵式名稱.
                        #$result["path"],建立好的路徑字串.
                        #$result["fileName"],檔案名稱,若 $conf["haveFileName"] 為 "true" 則會回傳.
                        #必填的參數:
                        #$conf["path"],要檢查的路徑
                        $conf["fileAccess::validatePath"]["path"]=$conf["xmlPosition"];         
                        #$conf["fileArgu"],字串,php變數__FILE__的內容,亦即該檔案在檔案系統的絕對路徑
                        $conf["fileAccess::validatePath"]["fileArgu"]=$conf["fileArgu"];
                        #可省略參數:
                        #$conf["haveFileName"],字串,"true"代表有$conf["path"]檔案名稱,"false"代表$conf["path"]為純路徑,預設為"false".
                        $conf["fileAccess::validatePath"]["haveFileName"]="true";
                        #$conf["dirPermission"],字串,新建資料夾的權限設定,預設爲0770,亦即擁有者,同群組者可以讀,寫,存取,其他人僅能存取.
                        #$conf["dirPermission"]="";
                        $validatePath=fileAccess::validatePath($conf["fileAccess::validatePath"]);
                        unset($conf["fileAccess::validatePath"]);
                        
                        #如果確保xml檔路徑失敗
                        if($validatePath["status"]=="false"){
                                
                                #設置執行不正常
                                $result["status"]="false";
                                
                                #設置執行錯誤
                                $result["error"]=$validatePath;
                                
                                #回傳結果
                                return $result;
                                
                                }#if end
                        
                        #建立xml檔
                        #函式說明:
                        #檢查要建立的檔案路徑是否存在,若不存在則建立新檔案,若檔案已存在則會在原檔名後面加上從(1)開始的編號,再度嘗試建立檔案,以避免資料異常.
                        #回傳的結果:
                        #$result["status"],執行狀態,"true"代表執行正常,"false"代表執行失敗.
                        #$result["error"],錯誤訊息陣列.
                        #$result["function"],當前執行的函數名稱.
                        #$result["createdFileName"],建立好的檔案名稱.
                        #$result["createdFilePath"],檔案建立的路徑.
                        #$result["createdFilePathAndName"].建立好的檔案名稱與路徑.
                        #必填的參數:
                        #$conf["checkedFileAndPath"],字串陣列,要建立的檔案路徑
                        $conf["fileAccess::createFileAfterCheck"]["checkedFileAndPath"]=$conf["xmlPosition"];
                        #$conf["fileArgu"],字串,php變數__FILE__的內容,亦即該檔案在檔案系統的絕對路徑
                        $conf["fileAccess::createFileAfterCheck"]["fileArgu"]=$conf["fileArgu"];
                        $createFileAfterCheck=fileAccess::createFileAfterCheck($conf["fileAccess::createFileAfterCheck"]);
                        unset($conf["fileAccess::createFileAfterCheck"]);
                        
                        #如果建立xml檔案失敗
                        if($createFileAfterCheck["status"]=="false"){
                                
                                #設置執行不正常
                                $result["status"]="false";
                                
                                #設置執行錯誤
                                $result["error"]=$createFileAfterCheck;
                                
                                #回傳結果
                                return $result;
                                
                                }#if end
                                
                        #取得建立好的檔案路徑與名稱
                        $conf["xmlPosition"]=$createFileAfterCheck["createdFilePathAndName"];
                                
                        #寫入xml檔案
                        #函式說明:
                        #將字串寫入到檔案
                        #回傳的結果:
                        #$result["status"],"true"表示檔案寫入成功,"false"表示檔案寫入失敗.
                        #$result["error"],錯誤訊息陣列.
                        #$result["function"],當前執行的函數名稱
                        #必填的參數:
                        $conf["xml::writeTextIntoFile"]["fileName"]=$conf["xmlPosition"];#爲要編輯的檔案名稱
                        $conf["xml::writeTextIntoFile"]["inputString"]=$xml;#爲要寫入到裏面的內容,若要每筆資料寫入後換行,則可以在字串內容後面加上 \r\n 即可。
                        #$conf["fileArgu"],字串,php變數__FILE__的內容,亦即該檔案在檔案系統的絕對路徑
                        $conf["xml::writeTextIntoFile"]["fileArgu"]=$conf["fileArgu"];
                        #可省略的參數:
                        #$conf["writeMethod"]="a";#爲檔案撰寫的方式,可省略,是複寫'a'還是,重新寫入'w',預設爲'w',重新寫入。
                        $writeTextIntoFile=fileAccess::writeTextIntoFile($conf["xml::writeTextIntoFile"]);
                        unset($conf["xml::writeTextIntoFile"]);
                        
                        #如果寫入xml資料到xml檔案裡面失敗
                        if($writeTextIntoFile["status"]=="false"){
                                
                                #設置執行不正常
                                $result["status"]="false";
                                
                                #設置執行錯誤
                                $result["error"]=$createFileAfterCheck;
                                
                                #回傳結果
                                return $result;
                                
                                }#if end
                                
                        #設置執行正常
                        $result["status"]="true";
                        
                        #設置xml檔案的路徑
                        $result["content"]=$conf["xmlPosition"];
                        
                        #回傳結果
                        return $result;
                        
                        }#if end
                
                #反之xml檔案已經存在
                else{
                        
                        #設置執行失敗
                        $result["status"]="false";
                        
                        #設置錯誤訊息
                        $result["error"][]="xml檔案 ".$conf["xmlPosition"]." 已經存在!";
                        
                        #回傳結果
                        return $result;
                        
                        }#else end
                
                }#function createEmptyXml end

        /*
        #函式說明:
        #在目標層級新增標籤與內容
        #回傳結果:
        #$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
        #$reuslt["error"],執行不正常結束的錯訊息陣列.
        #$result["function"],當前執行的函式名稱.
        #必填參數:
        #$conf["xmlPosition"],字串,xml檔案的位置.
        $conf["xmlPosition"]="";
        #$conf["fileArgu"],字串,php變數__FILE__的內容,亦即該檔案在檔案系統的絕對路徑
        $conf["fileArgu"]=__FILE__;
        #$conf["tag"],陣列,目標標籤的名稱,每個元素代表層級的名稱.
        $conf["tag"]=array("");
        #$conf["tagValue"],字串,目標標籤的內容要放什麼.
        $conf["tagValue"]="";
        #可省略參數:
        #無.
        #參考資料:
        #addchild->http://php.net/manual/en/simplexmlelement.addchild.php
        #備註:
        #物件的名稱如果是多維陣列變數,則會出錯,請改用變數儲存.
        */
        static function addTag(&$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($conf==null){
                                
                                #設置執行錯誤訊息
                                $result["error"][]="\$conf變數不得為null,請檢查函數「".$result["function"]."」的參數設置有無正確!";
                                
                                }#if end

                        #回傳結果
                        return $result;
                        
                        }#if end
        
                #檢查參數
                #函式說明:
                #檢查必填與可省略的參數,可省略參數可指定預設要給與什麼數值內容。
                #$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
                #$reuslt["error"],執行不正常結束的錯訊息陣列.
                #$result["function"],當前執行的函式名稱.
                #$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["mustBeFilledVariableName"],爲必填參數的變數名稱陣列,形態爲陣列變數,元素數量需要跟"mustBeFilledVariableType"參數的元素數量一致,例如: $conf["mustBeFilledVariableName"] = array("id","account","password");
                $conf["variableCheck::checkArguments"]["mustBeFilledVariableName"]=array("xmlPosition","fileArgu","tag");
                #$conf["mustBeFilledVariableType"],爲必填參數的變數陣列應該爲何種變數形態,形態爲陣列,元素數量需要跟"mustBeFilledVariableName"參數的元素數量一致,例如: $conf["mustBeFilledVariableType"] = array("string",integer,"double","resource","object"); , null代表不指定變數形態.
                $conf["variableCheck::checkArguments"]["mustBeFilledVariableType"]=array("string","string","array");
                #$conf["referenceVarKey"],字串,$conf參數後面的key值,用於移除不要的參考陣列.
                $conf["variableCheck::checkArguments"]["referenceVarKey"]="variableCheck::checkArguments";
                #可以省略的參數:
                #$conf["canBeEmptyString"],字串,必填變數內容如果是空字串就不能算是有設置的話,請設為"false",預設爲"true",可以為空字串.
                $conf["variableCheck::checkArguments"]["canBeEmptyString"]="false";
                #$conf["skipableVariableCanNotBeEmpty"],字串陣列,哪些可省略參數不可以為空字串或集合.
                #$conf["skipableVariableCanNotBeEmpty"]=array();
                #$conf["skipableVariableName"],陣列字串,爲可省略參數的變數名稱陣列,形態爲陣列變數,例如: $conf["skipableVariableName"] = array("id","account","password");
                $conf["variableCheck::checkArguments"]["skipableVariableName"]=array("tagValue");
                #$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("");
                #$conf["arrayCountEqualCheck"],字串陣列,為檢查哪些陣列參數的元素數量要一樣,$conf["arrayCountEqualCheck"][$i]=array()為第$i組key為哪些的變數其元素數量要相等.
                #$conf["variableCheck::checkArguments"]["arrayCountEqualCheck"][]=array("conName","conVal");
                #$conf["variableCheck::checkArguments"]["arrayCountEqualCheck"][]=array("target","styleAttr","styleVal");
                #參考資料來源:
                #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["content"],網址,若是在命令列執行,則為"null".
                #$result["webPathFromRoot"],相對於網頁根目錄的路徑.
                #$result["fileSystemAbsoulutePosition"],針對伺服器端的絕對位置,亦即從網頁「/」目錄開始的路徑.
                #$result["fileSystemRelativePosition"],針對伺服器檔案系統的相對位置.
                #必填參數:
                #$conf["address"],字串,檔案的相對位置,若為絕對位置則會自動轉換成相對位置.
                $conf["csInformation::getInternetAddress"]["address"]=$conf["xmlPosition"];
                #$conf["fileArgu"],字串,php變數__FILE__的內容,亦即該檔案在檔案系統的絕對路徑.
                $conf["csInformation::getInternetAddress"]["fileArgu"]=$conf["fileArgu"];
                #可省略參數:
                #$conf["userDir"],字串,網頁是否置放於家目錄底下,"true"為是,"false"為不是,預設為"true".
                $conf["csInformation::getInternetAddress"]["userDir"]="true";
                #備註:
                #在命令列執行,所得的路徑是錯誤的。
                $getInternetAddress=fileAccess::getInternetAddress($conf["csInformation::getInternetAddress"]);
                unset($conf["csInformation::getInternetAddress"]);
                
                #如果轉換位置失敗
                if($getInternetAddress["status"]=="false"){
                        
                        #設置執行不正常
                        $result["status"]="false";
                        
                        #設置執行錯誤
                        $result["error"]=$getInternetAddress;
                        
                        #回傳結果
                        return $result;
                        
                        }#if end
                
                #取得轉換好的絕對位置
                $conf["xmlPosition"]=$getInternetAddress["fileSystemAbsoulutePosition"];
                        
                #函式說明:
                #讀取xml檔案,儲存所有標籤的內容,目前尚不能讀取屬性的資訊
                #回傳結果:
                #$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
                #$reuslt["error"],執行不正常結束的錯訊息陣列.
                #$result["function"],當前執行的函式名稱.
                #$result["content"],xml的物件內容.
                #必填參數:
                #$conf["xmlPosition"],字串,xml檔案的位置.
                $conf["xml::getContent"]["xmlPosition"]=$conf["xmlPosition"];
                #$conf["fileArgu"],字串,php變數__FILE__的內容,亦即該檔案在檔案系統的絕對路徑
                $conf["xml::getContent"]["fileArgu"]=$conf["fileArgu"];
                #參考資料來源:
                #XML範例檔=>http://msdn.microsoft.com/zh-tw/library/bb387025.aspx
                #simplexml-load-file=>http://php.net/manual/en/function.simplexml-load-file.php
                #取得xml檔案內容的示範=>http://php.net/manual/en/simplexml.examples-basic.php
                #啟用處理xml的錯誤處理=>http://php.net/manual/en/function.libxml-use-internal-errors.php
                #取得處理xml的錯誤訊息=>http://php.net/manual/en/function.libxml-get-errors.php
                $getContent=xml::getContent($conf["xml::getContent"]);
                unset($conf["xml::getContent"]);
                
                #如果取得 xml 內容失敗
                if($getContent["status"]=="false"){
                        
                        #設置執行不正常
                        $result["status"]="false";
                        
                        #設置執行錯誤
                        $result["error"]=$getContent;
                        
                        #回傳結果
                        return $result;
                        
                        }#if end
                        
                #儲存xml的內容
                $xmlContent=$getContent["content"];
                        
                #過濾 $conf["tag"] 陣列元素的 「::」 字元
                #函式說明:
                #處理多個字串避免網頁出錯
                #回傳的結果:
                #$result["status"],"true"代表執行成功,"false"代表執行失敗。
                #$result["function"],當前執行的函數.
                #$result["error"],錯誤訊息
                #$result["processedStrArray"],處理好的字串陣列
                #必填的參數:
                $conf["stringProcess::correctMutiStrCharacter"]["stringIn"]=$conf["tag"];#爲要處理的字串陣列
                #可省略的參數:
                $conf["stringProcess::correctMutiStrCharacter"]["selectedCharacter"]=array("<",">","=","//","'","$","%","&","|","/*","*","#","\"",":");#爲被選擇要處理的字串/字元,須爲陣列值。
                        #若不設定則預設爲要將這些字串作替換 ("<",">","=","//","'","$","%","&","|","/*","*","#","\"").
                        #特殊字元,「\n」代表換行,「\t」代表tab鍵的間隔
                #$conf["changeTo"]=array();#爲被選擇的字元要換成什麼字串/字元,須爲陣列值。若不設定,則預設爲更換成""(空字串).
                $correctMutiStrCharacter=stringProcess::correctMutiStrCharacter($conf["stringProcess::correctMutiStrCharacter"]);
                unset($conf["stringProcess::correctMutiStrCharacter"]);
                                        
                #如果修正標籤名稱失敗
                if($correctMutiStrCharacter["status"]==="false"){
                        
                        #設置執行不正常
                        $result["status"]="false";
                        
                        #設置執行錯誤
                        $result["error"]=$correctMutiStrCharacter;
                        
                        #回傳結果
                        return $result;
                        
                        }#if end
                        
                #取得修正好的tag名稱
                $conf["tag"]=$correctMutiStrCharacter["processedStrArray"];     
                        
                #暫存tag pointer
                $tagPointer=&$xmlContent;       
                        
                #儲存每一層用到的物件參考
                $thisLeyer=array(&$tagPointer); 
                        
                #針對每層 $conf["tag"]
                for($i=0;$i<count($conf["tag"]);$i++){
                        
                        #避免指標後面的陣列變數解析錯誤
                        $tagName=$conf["tag"][$i];
                        
                        #如果是最後一層
                        if($i===count($conf["tag"])-1){
                                        
                                #如果這層是物件
                                if(gettype($thisLeyer[count($thisLeyer)-1])==="object"){
                                        
                                        #這層有幾個元素就執行幾次
                                        for($j=0;$j<count($thisLeyer[count($thisLeyer)-1]);$j++){
                                                                                                
                                                #如果下一層tag已經存在
                                                if(isset($thisLeyer[count($thisLeyer)-1][$j]->$tagName)){
                                                        
                                                        #檢查其值是否跟要新增的標籤數值一樣
                                                        if($conf["tagValue"]===(string)$thisLeyer[count($thisLeyer)-1][$j]->$tagName){
                                                                                                                                
                                                                #找下一層
                                                                continue;
                                                                
                                                                }#if end                                                        
                                                        
                                                        }#if end
                                                
                                                }#for end
                                                
                                        #新增標籤
                                        $thisLeyer[count($thisLeyer)-1]->addChild($tagName,$conf["tagValue"]);
                                        
                                        }#if end        
                                
                                #如果下一層tag已經存在
                                if(isset($thisLeyer[count($thisLeyer)-1]->$tagName)){
                                        
                                        #檢查其值是否跟要新增的標籤數值一樣
                                        if($conf["tagValue"]===(string)$thisLeyer[count($thisLeyer)-1]->$tagName){
                                                
                                                #取得該層tag
                                                $thisLeyer[]=&$thisLeyer[count($thisLeyer)-1]->$tagName;
                                                
                                                #跳到下一輪
                                                continue;
                                                
                                                }#if end
                                        
                                        }#if end
                                        
                                #反之下一層不存在
                                else{
                                        
                                        #新增標籤
                                        $thisLeyer[count($thisLeyer)-1]->addChild($tagName,$conf["tagValue"]);
                                        
                                        }#else end
                                        
                                }#if end
                        
                        #反之不是最後一層
                        else{
                                                
                                #如果這層是物件
                                if(gettype($thisLeyer[count($thisLeyer)-1])==="object"){
                                        
                                        #如果裡面沒有元素
                                        if(count($thisLeyer[count($thisLeyer)-1])===0){
                                                                
                                                #新增標籤
                                                $thisLeyer[count($thisLeyer)-1]->addChild($conf["tag"][$i]);
                                                
                                                #取得該層
                                                $thisLeyer[]=&$thisLeyer[count($thisLeyer)-1]->$tagName;                                                        
                                                                                                
                                                }#if end
                                        
                                        #反之裡面有元素
                                        else{
                                                
                                                #這層有幾個元素就執行幾次
                                                for($j=0;$j<count($thisLeyer[count($thisLeyer)-1]);$j++){
                                                                                                                        
                                                        #如果下一層tag已經存在
                                                        if(isset($thisLeyer[count($thisLeyer)-1]->$tagName)){

                                                                #取得 tag & 進入下層
                                                                $thisLeyer[]=&$thisLeyer[count($thisLeyer)-1]->$tagName;
                                                                
                                                                #下一層
                                                                continue 2;
                                                                
                                                                }#if end                                                        
                                                                                                        
                                                        }#for end
                                                        
                                                #新增標籤
                                                $thisLeyer[count($thisLeyer)-1]->addChild($tagName);    
                                                        
                                                #取得階層
                                                $thisLeyer[]=&$thisLeyer[count($thisLeyer)-1]->$tagName;        
                                                
                                                }#else end
                                        
                                        }#if end
                                        
                                }#else end
                        
                        }#foreach end
                        
                #儲存新的xml檔案內容
                $xmlContent=$xmlContent->asXML();
                                
                #覆寫xml檔案
                #函式說明:
                #將字串寫入到檔案
                #回傳的結果:
                #$result["status"],"true"表示檔案寫入成功,"false"表示檔案寫入失敗.
                #$result["error"],錯誤訊息陣列.
                #$result["function"],當前執行的函數名稱
                #必填的參數:
                $conf["xml::writeTextIntoFile"]["fileName"]=$conf["xmlPosition"];#爲要編輯的檔案名稱
                $conf["xml::writeTextIntoFile"]["inputString"]=$xmlContent;#爲要寫入到裏面的內容,若要每筆資料寫入後換行,則可以在字串內容後面加上 \r\n 即可。
                #$conf["fileArgu"],字串,php變數__FILE__的內容,亦即該檔案在檔案系統的絕對路徑
                $conf["xml::writeTextIntoFile"]["fileArgu"]=$conf["fileArgu"];
                #可省略的參數:
                #$conf["writeMethod"]="a";#爲檔案撰寫的方式,可省略,是複寫'a'還是,重新寫入'w',預設爲'w',重新寫入。
                $writeTextIntoFile=fileAccess::writeTextIntoFile($conf["xml::writeTextIntoFile"]);
                unset($conf["xml::writeTextIntoFile"]);
                
                #如果寫入xml資料到xml檔案裡面失敗
                if($writeTextIntoFile["status"]=="false"){
                        
                        #設置執行不正常
                        $result["status"]="false";
                        
                        #設置執行錯誤
                        $result["error"]=$writeTextIntoFile;
                        
                        #回傳結果
                        return $result;
                        
                        }#if end
                        
                #設置執行正常
                $result["status"]="true";
                
                #設置xml檔案的路徑
                $result["content"]=$conf["xmlPosition"];
                
                #回傳結果
                return $result; 
                
                }#function addTag end

        /*
        #函式說明:
        #更新xml標籤的內容.              
        #回傳結果:
        #$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
        #$reuslt["error"],執行不正常結束的錯訊息陣列.
        #$result["function"],當前執行的函式名稱.
        #必填參數:
        #$conf["xmlPosition"],字串,xml檔案的位置.
        $conf["xmlPosition"]="";
        #$conf["fileArgu"],字串,php變數__FILE__的內容,亦即該檔案在檔案系統的絕對路徑
        $conf["fileArgu"]=__FILE__;
        #$conf["tag"],陣列,目標標籤的名稱,每個元素代表層級的名稱.
        $conf["tag"]=array("");
        #$conf["tagValue"],字串,目標標籤的內容要放什麼.
        $conf["tagValue"]="";
        #可省略參數:
        #無.
        #參考資料:
        #replacechild=>http://php.net/manual/en/domnode.replacechild.php
        #loadxml=>http://php.net/manual/en/domdocument.loadxml.php
        #update xml node value=>http://stackoverflow.com/questions/4748014/updating-xml-node-with-php
        #備註:
        #若有多個同名的tag,則只會對於第一個tag進行操作.
        */
        static function updateTag(&$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($conf==null){
                                
                                #設置執行錯誤訊息
                                $result["error"][]="\$conf變數不得為null,請檢查函數「".$result["function"]."」的參數設置有無正確!";
                                
                                }#if end

                        #回傳結果
                        return $result;
                        
                        }#if end
        
                #檢查參數
                #函式說明:
                #檢查必填與可省略的參數,可省略參數可指定預設要給與什麼數值內容。
                #$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
                #$reuslt["error"],執行不正常結束的錯訊息陣列.
                #$result["function"],當前執行的函式名稱.
                #$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["mustBeFilledVariableName"],爲必填參數的變數名稱陣列,形態爲陣列變數,元素數量需要跟"mustBeFilledVariableType"參數的元素數量一致,例如: $conf["mustBeFilledVariableName"] = array("id","account","password");
                $conf["variableCheck::checkArguments"]["mustBeFilledVariableName"]=array("xmlPosition","fileArgu","tag");
                #$conf["mustBeFilledVariableType"],爲必填參數的變數陣列應該爲何種變數形態,形態爲陣列,元素數量需要跟"mustBeFilledVariableName"參數的元素數量一致,例如: $conf["mustBeFilledVariableType"] = array("string",integer,"double","resource","object"); , null代表不指定變數形態.
                $conf["variableCheck::checkArguments"]["mustBeFilledVariableType"]=array("string","string","array");
                #$conf["referenceVarKey"],字串,$conf參數後面的key值,用於移除不要的參考陣列.
                $conf["variableCheck::checkArguments"]["referenceVarKey"]="variableCheck::checkArguments";
                #可以省略的參數:
                #$conf["canBeEmptyString"],字串,必填變數內容如果是空字串就不能算是有設置的話,請設為"false",預設爲"true",可以為空字串.
                $conf["variableCheck::checkArguments"]["canBeEmptyString"]="false";
                #$conf["skipableVariableCanNotBeEmpty"],字串陣列,哪些可省略參數不可以為空字串或集合.
                #$conf["skipableVariableCanNotBeEmpty"]=array();
                #$conf["skipableVariableName"],陣列字串,爲可省略參數的變數名稱陣列,形態爲陣列變數,例如: $conf["skipableVariableName"] = array("id","account","password");
                $conf["variableCheck::checkArguments"]["skipableVariableName"]=array("tagValue");
                #$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("");
                #$conf["arrayCountEqualCheck"],字串陣列,為檢查哪些陣列參數的元素數量要一樣,$conf["arrayCountEqualCheck"][$i]=array()為第$i組key為哪些的變數其元素數量要相等.
                #$conf["variableCheck::checkArguments"]["arrayCountEqualCheck"][]=array("conName","conVal");
                #$conf["variableCheck::checkArguments"]["arrayCountEqualCheck"][]=array("target","styleAttr","styleVal");
                #參考資料來源:
                #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["content"],網址,若是在命令列執行,則為"null".
                #$result["webPathFromRoot"],相對於網頁根目錄的路徑.
                #$result["fileSystemAbsoulutePosition"],針對伺服器端的絕對位置,亦即從網頁「/」目錄開始的路徑.
                #$result["fileSystemRelativePosition"],針對伺服器檔案系統的相對位置.
                #必填參數:
                #$conf["address"],字串,檔案的相對位置,若為絕對位置則會自動轉換成相對位置.
                $conf["csInformation::getInternetAddress"]["address"]=$conf["xmlPosition"];
                #$conf["fileArgu"],字串,php變數__FILE__的內容,亦即該檔案在檔案系統的絕對路徑.
                $conf["csInformation::getInternetAddress"]["fileArgu"]=$conf["fileArgu"];
                #可省略參數:
                #$conf["userDir"],字串,網頁是否置放於家目錄底下,"true"為是,"false"為不是,預設為"true".
                $conf["csInformation::getInternetAddress"]["userDir"]="true";
                #備註:
                #在命令列執行,所得的路徑是錯誤的。
                $getInternetAddress=fileAccess::getInternetAddress($conf["csInformation::getInternetAddress"]);
                unset($conf["csInformation::getInternetAddress"]);
                
                #如果轉換位置失敗
                if($getInternetAddress["status"]==="false"){
                        
                        #設置執行不正常
                        $result["status"]="false";
                        
                        #設置執行錯誤
                        $result["error"]=$getInternetAddress;
                        
                        #回傳結果
                        return $result;
                        
                        }#if end
                
                #取得轉換好的絕對位置
                $conf["xmlPosition"]=$getInternetAddress["fileSystemAbsoulutePosition"];        
                        
                #函式說明:
                #讀取xml檔案,儲存所有標籤的內容,目前尚不能讀取屬性的資訊
                #回傳結果:
                #$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
                #$reuslt["error"],執行不正常結束的錯訊息陣列.
                #$result["function"],當前執行的函式名稱.
                #$result["content"],xml的物件內容.
                #必填參數:
                #$conf["xmlPosition"],字串,xml檔案的位置.
                $conf["xml::getContent"]["xmlPosition"]=$conf["xmlPosition"];
                #$conf["fileArgu"],字串,php變數__FILE__的內容,亦即該檔案在檔案系統的絕對路徑
                $conf["xml::getContent"]["fileArgu"]=$conf["fileArgu"];
                #參考資料來源:
                #XML範例檔=>http://msdn.microsoft.com/zh-tw/library/bb387025.aspx
                #simplexml-load-file=>http://php.net/manual/en/function.simplexml-load-file.php
                #取得xml檔案內容的示範=>http://php.net/manual/en/simplexml.examples-basic.php
                #啟用處理xml的錯誤處理=>http://php.net/manual/en/function.libxml-use-internal-errors.php
                #取得處理xml的錯誤訊息=>http://php.net/manual/en/function.libxml-get-errors.php
                $getContent=xml::getContent($conf["xml::getContent"]);
                unset($conf["xml::getContent"]);
                
                #如果取得 xml 內容失敗
                if($getContent["status"]==="false"){
                        
                        #設置執行不正常
                        $result["status"]="false";
                        
                        #設置執行錯誤
                        $result["error"]=$getContent;
                        
                        #回傳結果
                        return $result;
                        
                        }#if end
                
                #儲存暫存的xml檔案內容
                $xmlContent=$getContent["content"];
                
                #過濾 $conf["tag"] 陣列元素的 「::」 字元
                #函式說明:
                #處理多個字串避免網頁出錯
                #回傳的結果:
                #$result["status"],"true"代表執行成功,"false"代表執行失敗。
                #$result["function"],當前執行的函數.
                #$result["error"],錯誤訊息
                #$result["processedStrArray"],處理好的字串陣列
                #必填的參數:
                $conf["stringProcess::correctMutiStrCharacter"]["stringIn"]=$conf["tag"];#爲要處理的字串陣列
                #可省略的參數:
                $conf["stringProcess::correctMutiStrCharacter"]["selectedCharacter"]=array("<",">","=","//","'","$","%","&","|","/*","*","#","\"",":");#爲被選擇要處理的字串/字元,須爲陣列值。
                        #若不設定則預設爲要將這些字串作替換 ("<",">","=","//","'","$","%","&","|","/*","*","#","\"").
                        #特殊字元,「\n」代表換行,「\t」代表tab鍵的間隔
                #$conf["changeTo"]=array();#爲被選擇的字元要換成什麼字串/字元,須爲陣列值。若不設定,則預設爲更換成""(空字串).
                $correctMutiStrCharacter=stringProcess::correctMutiStrCharacter($conf["stringProcess::correctMutiStrCharacter"]);
                unset($conf["stringProcess::correctMutiStrCharacter"]);
                                        
                #如果修正標籤名稱失敗
                if($correctMutiStrCharacter["status"]==="false"){
                        
                        #設置執行不正常
                        $result["status"]="false";
                        
                        #設置執行錯誤
                        $result["error"]=$correctMutiStrCharacter;
                        
                        #回傳結果
                        return $result;
                        
                        }#if end
                        
                #取得修正好的tag名稱
                $conf["tag"]=$correctMutiStrCharacter["processedStrArray"];
                
                #針對每層 $conf["tag"]
                for($i=0;$i<count($conf["tag"]);$i++){
                        
                        #如果是最後一層
                        if($i==count($conf["tag"])-1){
                                
                                #另存變數
                                $key=$conf["tag"][$i];
                                
                                #新增標籤
                                $getContent["content"]->$key=$conf["tagValue"];
                                
                                }#if end
                        
                        #反之不是最後一層
                        else{
                                
                                #另存變數
                                $key=$conf["tag"][$i];
                                
                                #新增標籤
                                $getContent["content"]=$getContent["content"]->$key;    
                                
                                }#else end
                        
                        }#foreach end
                        
                #儲存新的xml檔案內容
                $xmlContent=$xmlContent->asXML();
                
                #覆寫xml檔案
                #函式說明:
                #將字串寫入到檔案
                #回傳的結果:
                #$result["status"],"true"表示檔案寫入成功,"false"表示檔案寫入失敗.
                #$result["error"],錯誤訊息陣列.
                #$result["function"],當前執行的函數名稱
                #必填的參數:
                $conf["xml::writeTextIntoFile"]["fileName"]=$conf["xmlPosition"];#爲要編輯的檔案名稱
                $conf["xml::writeTextIntoFile"]["inputString"]=$xmlContent;#爲要寫入到裏面的內容,若要每筆資料寫入後換行,則可以在字串內容後面加上 \r\n 即可。
                #$conf["fileArgu"],字串,php變數__FILE__的內容,亦即該檔案在檔案系統的絕對路徑
                $conf["xml::writeTextIntoFile"]["fileArgu"]=$conf["fileArgu"];
                #可省略的參數:
                #$conf["writeMethod"]="a";#爲檔案撰寫的方式,可省略,是複寫'a'還是,重新寫入'w',預設爲'w',重新寫入。
                $writeTextIntoFile=fileAccess::writeTextIntoFile($conf["xml::writeTextIntoFile"]);
                unset($conf["xml::writeTextIntoFile"]);
                
                #如果寫入xml資料到xml檔案裡面失敗
                if($writeTextIntoFile["status"]=="false"){
                        
                        #設置執行不正常
                        $result["status"]="false";
                        
                        #設置執行錯誤
                        $result["error"]=$createFileAfterCheck;
                        
                        #回傳結果
                        return $result;
                        
                        }#if end
                        
                #設置執行正常
                $result["status"]="true";
                
                #設置xml檔案的路徑
                $result["content"]=$conf["xmlPosition"];
                
                #回傳結果
                return $result;
                
                }#function updateTag end
                
        /*
        #函式說明:
        #移除xml標籤的內容.              
        #回傳結果:
        #$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
        #$reuslt["error"],執行不正常結束的錯訊息陣列.
        #$result["function"],當前執行的函式名稱.
        #必填參數:
        #$conf["xmlPosition"],字串,xml檔案的位置.
        $conf["xmlPosition"]="";
        #$conf["fileArgu"],字串,php變數__FILE__的內容,亦即該檔案在檔案系統的絕對路徑
        $conf["fileArgu"]=__FILE__;
        #$conf["tag"],陣列,目標標籤的名稱,每個元素代表層級的名稱.
        $conf["tag"]=array("");
        #$conf["tagValue"],字串,目標標籤的內容要放什麼.
        $conf["tagValue"]="";
        #參考資料:
        #replacechild=>http://php.net/manual/en/domnode.replacechild.php
        #loadxml=>http://php.net/manual/en/domdocument.loadxml.php
        #update xml node value=>http://stackoverflow.com/questions/4748014/updating-xml-node-with-php
        #備註:
        #若有多個同名的tag,則會針對每個符合的tag進行操作.
        */
        static function removeTag(&$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($conf==null){
                                
                                #設置執行錯誤訊息
                                $result["error"][]="\$conf變數不得為null,請檢查函數「".$result["function"]."」的參數設置有無正確!";
                                
                                }#if end

                        #回傳結果
                        return $result;
                        
                        }#if end
        
                #檢查參數
                #函式說明:
                #檢查必填與可省略的參數,可省略參數可指定預設要給與什麼數值內容。
                #$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
                #$reuslt["error"],執行不正常結束的錯訊息陣列.
                #$result["function"],當前執行的函式名稱.
                #$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["mustBeFilledVariableName"],爲必填參數的變數名稱陣列,形態爲陣列變數,元素數量需要跟"mustBeFilledVariableType"參數的元素數量一致,例如: $conf["mustBeFilledVariableName"] = array("id","account","password");
                $conf["variableCheck::checkArguments"]["mustBeFilledVariableName"]=array("xmlPosition","fileArgu","tag");
                #$conf["mustBeFilledVariableType"],爲必填參數的變數陣列應該爲何種變數形態,形態爲陣列,元素數量需要跟"mustBeFilledVariableName"參數的元素數量一致,例如: $conf["mustBeFilledVariableType"] = array("string",integer,"double","resource","object"); , null代表不指定變數形態.
                $conf["variableCheck::checkArguments"]["mustBeFilledVariableType"]=array("string","string","array");
                #$conf["referenceVarKey"],字串,$conf參數後面的key值,用於移除不要的參考陣列.
                $conf["variableCheck::checkArguments"]["referenceVarKey"]="variableCheck::checkArguments";
                #可以省略的參數:
                #$conf["canBeEmptyString"],字串,必填變數內容如果是空字串就不能算是有設置的話,請設為"false",預設爲"true",可以為空字串.
                $conf["variableCheck::checkArguments"]["canBeEmptyString"]="false";
                #$conf["skipableVariableCanNotBeEmpty"],字串陣列,哪些可省略參數不可以為空字串或集合.
                #$conf["skipableVariableCanNotBeEmpty"]=array();
                #$conf["skipableVariableName"],陣列字串,爲可省略參數的變數名稱陣列,形態爲陣列變數,例如: $conf["skipableVariableName"] = array("id","account","password");
                #$conf["variableCheck::checkArguments"]["skipableVariableName"]=array("tagValue");
                #$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("");
                #$conf["arrayCountEqualCheck"],字串陣列,為檢查哪些陣列參數的元素數量要一樣,$conf["arrayCountEqualCheck"][$i]=array()為第$i組key為哪些的變數其元素數量要相等.
                #$conf["variableCheck::checkArguments"]["arrayCountEqualCheck"][]=array("conName","conVal");
                #$conf["variableCheck::checkArguments"]["arrayCountEqualCheck"][]=array("target","styleAttr","styleVal");
                #參考資料來源:
                #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["content"],網址,若是在命令列執行,則為"null".
                #$result["webPathFromRoot"],相對於網頁根目錄的路徑.
                #$result["fileSystemAbsoulutePosition"],針對伺服器端的絕對位置,亦即從網頁「/」目錄開始的路徑.
                #$result["fileSystemRelativePosition"],針對伺服器檔案系統的相對位置.
                #必填參數:
                #$conf["address"],字串,檔案的相對位置,若為絕對位置則會自動轉換成相對位置.
                $conf["csInformation::getInternetAddress"]["address"]=$conf["xmlPosition"];
                #$conf["fileArgu"],字串,php變數__FILE__的內容,亦即該檔案在檔案系統的絕對路徑.
                $conf["csInformation::getInternetAddress"]["fileArgu"]=$conf["fileArgu"];
                #可省略參數:
                #$conf["userDir"],字串,網頁是否置放於家目錄底下,"true"為是,"false"為不是,預設為"true".
                $conf["csInformation::getInternetAddress"]["userDir"]="true";
                #備註:
                #在命令列執行,所得的路徑是錯誤的。
                $getInternetAddress=fileAccess::getInternetAddress($conf["csInformation::getInternetAddress"]);
                unset($conf["csInformation::getInternetAddress"]);
                
                #如果轉換位置失敗
                if($getInternetAddress["status"]=="false"){
                        
                        #設置執行不正常
                        $result["status"]="false";
                        
                        #設置執行錯誤
                        $result["error"]=$getInternetAddress;
                        
                        #回傳結果
                        return $result;
                        
                        }#if end
                
                #取得轉換好的絕對位置
                $conf["xmlPosition"]=$getInternetAddress["fileSystemAbsoulutePosition"];
                        
                #函式說明:
                #讀取xml檔案,儲存所有標籤的內容,目前尚不能讀取屬性的資訊
                #回傳結果:
                #$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
                #$reuslt["error"],執行不正常結束的錯訊息陣列.
                #$result["function"],當前執行的函式名稱.
                #$result["content"],xml的物件內容.
                #必填參數:
                #$conf["xmlPosition"],字串,xml檔案的位置.
                $conf["xml::getContent"]["xmlPosition"]=$conf["xmlPosition"];
                #$conf["fileArgu"],字串,php變數__FILE__的內容,亦即該檔案在檔案系統的絕對路徑
                $conf["xml::getContent"]["fileArgu"]=$conf["fileArgu"];
                #參考資料來源:
                #XML範例檔=>http://msdn.microsoft.com/zh-tw/library/bb387025.aspx
                #simplexml-load-file=>http://php.net/manual/en/function.simplexml-load-file.php
                #取得xml檔案內容的示範=>http://php.net/manual/en/simplexml.examples-basic.php
                #啟用處理xml的錯誤處理=>http://php.net/manual/en/function.libxml-use-internal-errors.php
                #取得處理xml的錯誤訊息=>http://php.net/manual/en/function.libxml-get-errors.php
                $getContent=xml::getContent($conf["xml::getContent"]);
                unset($conf["xml::getContent"]);
                
                #如果取得 xml 內容失敗
                if($getContent["status"]=="false"){
                        
                        #設置執行不正常
                        $result["status"]="false";
                        
                        #設置執行錯誤
                        $result["error"]=$getContent;
                        
                        #回傳結果
                        return $result;
                        
                        }#if end
                
                #儲存暫存的xml檔案內容
                $xmlContent=$getContent["content"];
                
                #針對每層 $conf["tag"]
                for($i=0;$i<count($conf["tag"]);$i++){
                        
                        #如果是最後一層
                        if($i==count($conf["tag"])-1){
                                
                                #移除標籤
                                unset($getContent["content"]->$conf["tag"][$i]);
                                
                                }#if end
                        
                        #反之不是最後一層
                        else{
                                
                                #新增標籤
                                $getContent["content"]=$getContent["content"]->$conf["tag"][$i];        
                                
                                }#else end
                        
                        }#foreach end
                        
                #儲存新的xml檔案內容
                $xmlContent=$xmlContent->asXML();
                
                #覆寫xml檔案
                #函式說明:
                #將字串寫入到檔案
                #回傳的結果:
                #$result["status"],"true"表示檔案寫入成功,"false"表示檔案寫入失敗.
                #$result["error"],錯誤訊息陣列.
                #$result["function"],當前執行的函數名稱
                #必填的參數:
                $conf["xml::writeTextIntoFile"]["fileName"]=$conf["xmlPosition"];#爲要編輯的檔案名稱
                $conf["xml::writeTextIntoFile"]["inputString"]=$xmlContent;#爲要寫入到裏面的內容,若要每筆資料寫入後換行,則可以在字串內容後面加上 \r\n 即可。
                #$conf["fileArgu"],字串,php變數__FILE__的內容,亦即該檔案在檔案系統的絕對路徑
                $conf["xml::writeTextIntoFile"]["fileArgu"]=$conf["fileArgu"];
                #可省略的參數:
                #$conf["writeMethod"]="a";#爲檔案撰寫的方式,可省略,是複寫'a'還是,重新寫入'w',預設爲'w',重新寫入。
                $writeTextIntoFile=fileAccess::writeTextIntoFile($conf["xml::writeTextIntoFile"]);
                unset($conf["xml::writeTextIntoFile"]);
                
                #如果寫入xml資料到xml檔案裡面失敗
                if($writeTextIntoFile["status"]=="false"){
                        
                        #設置執行不正常
                        $result["status"]="false";
                        
                        #設置執行錯誤
                        $result["error"]=$createFileAfterCheck;
                        
                        #回傳結果
                        return $result;
                        
                        }#if end
                        
                #設置執行正常
                $result["status"]="true";
                
                #設置xml檔案的路徑
                $result["content"]=$conf["xmlPosition"];
                
                #回傳結果
                return $result;
                
                }#function updateTag end        

        /*
        #函式說明:
        #解析xml字串.
        #回傳結果:
        #$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
        #$reuslt["error"],執行不正常結束的錯訊息陣列.
        #$result["function"],當前執行的函式名稱.
        #$result["content"],xml物件.
        #$result["xmlStr"],xml格式的內容.
        #必填參數:
        #$conf["xmlString"],字串,要解析的xml字串.
        #$conf["xmlString"]="";
        #可省略參數:
        #無.
        #參考資料:
        #https://www.w3schools.com/php/php_xml_simplexml_read.asp
        #備註:
        #無.
        */
        public static function parseXMLstring(&$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($conf==null){
                                
                                #設置執行錯誤訊息
                                $result["error"][]="\$conf變數不得為null,請檢查函數「".$result["function"]."」的參數設置有無正確!";
                                
                                }#if end

                        #回傳結果
                        return $result;
                        
                        }#if end
        
                #檢查參數
                #函式說明:
                #檢查必填與可省略的參數,可省略參數可指定預設要給與什麼數值內容。
                #$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
                #$reuslt["error"],執行不正常結束的錯訊息陣列.
                #$result["function"],當前執行的函式名稱.
                #$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["mustBeFilledVariableName"],爲必填參數的變數名稱陣列,形態爲陣列變數,元素數量需要跟"mustBeFilledVariableType"參數的元素數量一致,例如: $conf["mustBeFilledVariableName"] = array("id","account","password");
                $conf["variableCheck::checkArguments"]["mustBeFilledVariableName"]=array("xmlString");
                #$conf["mustBeFilledVariableType"],爲必填參數的變數陣列應該爲何種變數形態,形態爲陣列,元素數量需要跟"mustBeFilledVariableName"參數的元素數量一致,例如: $conf["mustBeFilledVariableType"] = array("string",integer,"double","resource","object"); , null代表不指定變數形態.
                $conf["variableCheck::checkArguments"]["mustBeFilledVariableType"]=array("string");
                #$conf["referenceVarKey"],字串,$conf參數後面的key值,用於移除不要的參考陣列.
                $conf["variableCheck::checkArguments"]["referenceVarKey"]="variableCheck::checkArguments";
                #可以省略的參數:
                #$conf["canBeEmptyString"],字串,必填變數內容如果是空字串就不能算是有設置的話,請設為"false",預設爲"true",可以為空字串.
                #$conf["variableCheck::checkArguments"]["canBeEmptyString"]="false";
                #$conf["skipableVariableCanNotBeEmpty"],字串陣列,哪些可省略參數不可以為空字串或集合.
                #$conf["skipableVariableCanNotBeEmpty"]=array();
                #$conf["skipableVariableName"],陣列字串,爲可省略參數的變數名稱陣列,形態爲陣列變數,例如: $conf["skipableVariableName"] = array("id","account","password");
                #$conf["variableCheck::checkArguments"]["skipableVariableName"]=array("tagValue");
                #$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("");
                #$conf["arrayCountEqualCheck"],字串陣列,為檢查哪些陣列參數的元素數量要一樣,$conf["arrayCountEqualCheck"][$i]=array()為第$i組key為哪些的變數其元素數量要相等.
                #$conf["variableCheck::checkArguments"]["arrayCountEqualCheck"][]=array("conName","conVal");
                #$conf["variableCheck::checkArguments"]["arrayCountEqualCheck"][]=array("target","styleAttr","styleVal");
                #參考資料來源:
                #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
        
                #var_dump($conf["xmlString"]);exit;
        
                #建立xml物件
                $xml=simplexml_load_string($conf["xmlString"]);

                #設置執行正常
                $result["status"]="true";

                #取得xml物件
                $result["content"]=$xml;
        
                #取得xml格式的文字
                $result["xmlStr"]=$xml->asXML();

                #回傳結果
                return $result;
        
                }#function parseXMLstring end

        }#class xml end
        
?>