Subversion Repositories qbpwcf-lib(archive)

Rev

Blame | Last modification | View Log | RSS feed

<?php

#使用命名空間qbpwcf
namespace qbpwcf;

#assets dir
$assetsDir="assets of phpLib::getFunctionConstruction_20241201";

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

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

        #函式說明:
        #撰寫log
        #回傳結果:
        #$result["status"],狀態,"true"或"false".
        #$result["error"],錯誤訊息陣列.
        #$result["function"],當前函式的名稱.
        #$result["argu"],使用的參數.
        #必填參數:
        #$conf["path"],字串,log檔案的路徑與名稱.
        $conf["path"]=$logFile;
        #$conf["content"],any,要寫的內容,若內容不為字串則會用var_dump的格式寫入.
        $conf["content"]=$getFunctionConstruction;
        #$conf["fileArgu"],字串,php變數__FILE__的內容,亦即該檔案在檔案系統的絕對路徑
        $conf["fileArgu"]=__FILE__;
        #可省略參數:
        #$conf["rewrite"],預設為"false",接續寫入;反之"true"代表重新寫入.
        #$conf["rewrite"]="false";
        #參考資料:
        #無.
        #備註:
        #無.
        $record=logs::record($conf);
        unset($conf);
        
        #結束執行
        exit(1);

        }#if end
        
#debug
var_dump($getFunctionConstruction);