| Line 10086... |
Line 10086... |
| 10086 |
#$conf["echo"]="false";
|
10086 |
#$conf["echo"]="false";
|
| 10087 |
#$conf["httpGetToArgu"],字串,"true"代表要將 http get 參數變成參數來取得,像是 $_GET["p1"] 會變成 $result["content"]["p1"] 回傳,預設為"false"代表不使用.
|
10087 |
#$conf["httpGetToArgu"],字串,"true"代表要將 http get 參數變成參數來取得,像是 $_GET["p1"] 會變成 $result["content"]["p1"] 回傳,預設為"false"代表不使用.
|
| 10088 |
#$conf["httpGetToArgu"]="false";
|
10088 |
#$conf["httpGetToArgu"]="false";
|
| 10089 |
#$conf["httpPostToArgu"],字串,"true"代表要將 http post 參數變成參數來取得,像是 $_POST["p1"] 會變成 $result["content"]["p1"] 回傳,預設為"false"代表不使用.
|
10089 |
#$conf["httpPostToArgu"],字串,"true"代表要將 http post 參數變成參數來取得,像是 $_POST["p1"] 會變成 $result["content"]["p1"] 回傳,預設為"false"代表不使用.
|
| 10090 |
#$conf["httpPostToArgu"]="false";
|
10090 |
#$conf["httpPostToArgu"]="false";
|
| - |
|
10091 |
#$conf["arguEqual2http"],字串,預設為"false",代表命令列環境的參數依序為程式名稱本身、第n個參數,反之為"true",代表命令列的第一個參數為第n個參數,亦即沒有程式本身名稱的參數.
|
| - |
|
10092 |
#$conf["arguEqual2http"]="false";
|
| 10091 |
#參考資料:
|
10093 |
#參考資料:
|
| 10092 |
#無.
|
10094 |
#無.
|
| 10093 |
#備註:
|
10095 |
#備註:
|
| 10094 |
#pipe要用''包住,才會被解析,例如'|'、'>'、'>>'.
|
10096 |
#pipe要用''包住,才會被解析,例如'|'、'>'、'>>'.
|
| 10095 |
*/
|
10097 |
*/
|
| Line 10171... |
Line 10173... |
| 10171 |
#$conf["canBeEmpty"],字串陣列,哪些必填參數的內容可為空字串或空陣列,僅當$conf["canBeEmptyString"]為"false"時會生效.
|
10173 |
#$conf["canBeEmpty"],字串陣列,哪些必填參數的內容可為空字串或空陣列,僅當$conf["canBeEmptyString"]為"false"時會生效.
|
| 10172 |
#$conf["canBeEmpty"]=array();
|
10174 |
#$conf["canBeEmpty"]=array();
|
| 10173 |
#$conf["skipableVariableCanNotBeEmpty"],字串陣列,哪些可省略參數不可以為空字串或空陣列.
|
10175 |
#$conf["skipableVariableCanNotBeEmpty"],字串陣列,哪些可省略參數不可以為空字串或空陣列.
|
| 10174 |
#$conf["skipableVariableCanNotBeEmpty"]=array();
|
10176 |
#$conf["skipableVariableCanNotBeEmpty"]=array();
|
| 10175 |
#$conf["skipableVariableName"],陣列字串,爲可省略參數的變數名稱陣列,形態爲陣列變數,例如: $conf["skipableVariableName"] = array("id","account","password");
|
10177 |
#$conf["skipableVariableName"],陣列字串,爲可省略參數的變數名稱陣列,形態爲陣列變數,例如: $conf["skipableVariableName"] = array("id","account","password");
|
| 10176 |
$conf["variableCheck::checkArguments"]["skipableVariableName"]=array("echo","httpGetToArgu","httpPostToArgu");
|
10178 |
$conf["variableCheck::checkArguments"]["skipableVariableName"]=array("echo","httpGetToArgu","httpPostToArgu","arguEqual2http");
|
| 10177 |
#$conf["skipableVariableType"],陣列字串,爲可省略參數的變數名稱陣列,形態爲陣列變數,例如: $conf["skipableVariableType"] = array("string",integer,"double");
|
10179 |
#$conf["skipableVariableType"],陣列字串,爲可省略參數的變數名稱陣列,形態爲陣列變數,例如: $conf["skipableVariableType"] = array("string",integer,"double");
|
| 10178 |
$conf["variableCheck::checkArguments"]["skipableVariableType"]=array("string","string","string");
|
10180 |
$conf["variableCheck::checkArguments"]["skipableVariableType"]=array("string","string","string","string");
|
| 10179 |
#$conf["skipableVarDefaultValue"],字串陣列,每個不存在的可省略變數要初始化為什麼,null與代表不指定,若預設值是參數之一,請將$conf["mustBeFilledVar"]改成"\$conf["\mustBeFilledVar\"]".
|
10181 |
#$conf["skipableVarDefaultValue"],字串陣列,每個不存在的可省略變數要初始化為什麼,null與代表不指定,若預設值是參數之一,請將$conf["mustBeFilledVar"]改成"\$conf["\mustBeFilledVar\"]".
|
| 10180 |
$conf["variableCheck::checkArguments"]["skipableVarDefaultValue"]=array("false","false","false");
|
10182 |
$conf["variableCheck::checkArguments"]["skipableVarDefaultValue"]=array("false","false","false","false");
|
| 10181 |
#$conf["disallowAllSkipableVarIsEmpty"],字串,是否允許每個可省略參數都為空字串,預設為"true"允許,反之為"false".
|
10183 |
#$conf["disallowAllSkipableVarIsEmpty"],字串,是否允許每個可省略參數都為空字串,預設為"true"允許,反之為"false".
|
| 10182 |
#$conf["disallowAllSkipableVarIsEmpty"]="";
|
10184 |
#$conf["disallowAllSkipableVarIsEmpty"]="";
|
| 10183 |
#$conf["disallowAllSkipableVarIsEmptyArray"],字串,是否允許每個可省略參數都為空陣列,預設為"true"允許,反之為"false".
|
10185 |
#$conf["disallowAllSkipableVarIsEmptyArray"],字串,是否允許每個可省略參數都為空陣列,預設為"true"允許,反之為"false".
|
| 10184 |
#$conf["disallowAllSkipableVarIsEmptyArray"]="";
|
10186 |
#$conf["disallowAllSkipableVarIsEmptyArray"]="";
|
| 10185 |
#$conf["arrayCountEqualCheck"],字串陣列,為檢查哪些陣列參數的元素數量要一樣,$conf["arrayCountEqualCheck"][$i]=array()為第$i組key為哪些的變數其元素數量要相等.
|
10187 |
#$conf["arrayCountEqualCheck"],字串陣列,為檢查哪些陣列參數的元素數量要一樣,$conf["arrayCountEqualCheck"][$i]=array()為第$i組key為哪些的變數其元素數量要相等.
|
| Line 10215... |
Line 10217... |
| 10215 |
#回傳結果
|
10217 |
#回傳結果
|
| 10216 |
return $result;
|
10218 |
return $result;
|
| 10217 |
|
10219 |
|
| 10218 |
}#if end
|
10220 |
}#if end
|
| 10219 |
|
10221 |
|
| - |
|
10222 |
#預設沒有參數
|
| 10220 |
#var_dump($_SERVER["argv"]);
|
10223 |
$result["content"]=array();
|
| 10221 |
|
10224 |
|
| 10222 |
#儲存參數
|
10225 |
#預設參數數量為0
|
| 10223 |
$result["content"]=$_SERVER["argv"];
|
10226 |
$result["count"]=0;
|
| 10224 |
|
10227 |
|
| - |
|
10228 |
#如果有 $_SERVER["argv"]
|
| - |
|
10229 |
if(isset($_SERVER["argv"])){
|
| - |
|
10230 |
|
| - |
|
10231 |
#儲存參數
|
| - |
|
10232 |
$result["content"]=$_SERVER["argv"];
|
| - |
|
10233 |
|
| - |
|
10234 |
}#if end
|
| - |
|
10235 |
|
| - |
|
10236 |
#如果有 $_SERVER["argc"]
|
| - |
|
10237 |
if(isset($_SERVER["argc"])){
|
| - |
|
10238 |
|
| 10225 |
#取得參數數量
|
10239 |
#取得參數數量
|
| 10226 |
$result["count"]=$_SERVER["argc"];
|
10240 |
$result["count"]=$_SERVER["argc"];
|
| - |
|
10241 |
|
| - |
|
10242 |
}#if end
|
| - |
|
10243 |
|
| - |
|
10244 |
#如果 arguEqual2http 為 "true" 且含有參數
|
| - |
|
10245 |
if($conf["arguEqual2http"]==="true" && count($result["content"])>0 ){
|
| - |
|
10246 |
|
| - |
|
10247 |
#移除命令列的第一個參數(程式名稱)
|
| - |
|
10248 |
$array_shift=array_shift($result["content"]);
|
| - |
|
10249 |
|
| - |
|
10250 |
#如果異常
|
| - |
|
10251 |
if($array_shift===null){
|
| - |
|
10252 |
|
| - |
|
10253 |
#設置執行失敗
|
| - |
|
10254 |
$result["status"]="false";
|
| - |
|
10255 |
|
| - |
|
10256 |
#設置執行錯誤訊息
|
| - |
|
10257 |
$result["error"][]="shift first argu failed";
|
| - |
|
10258 |
|
| - |
|
10259 |
#回傳結果
|
| - |
|
10260 |
return $result;
|
| 10227 |
|
10261 |
|
| - |
|
10262 |
}#if end
|
| - |
|
10263 |
|
| - |
|
10264 |
}#if end
|
| - |
|
10265 |
|
| 10228 |
#如果要將 http get 變成參數
|
10266 |
#如果要將 http get 變成參數
|
| 10229 |
if($conf["httpGetToArgu"]==="true"){
|
10267 |
if($conf["httpGetToArgu"]==="true"){
|
| 10230 |
|
10268 |
|
| 10231 |
#函式說明:
|
10269 |
#函式說明:
|
| 10232 |
#可以處理多個透過GET、POST而來的資訊,儲存成變數,同時限定傳送的方法、來源,來增加安全性,檢查有沒有皆收到必須要接收到的變數,沒有接收到的變數可以指定從session變數中取得.
|
10270 |
#可以處理多個透過GET、POST而來的資訊,儲存成變數,同時限定傳送的方法、來源,來增加安全性,檢查有沒有皆收到必須要接收到的變數,沒有接收到的變數可以指定從session變數中取得.
|