Subversion Repositories qbpwcf-lib(archive)

Rev

Rev 906 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1 liveuser 1
#!/usr/bin/php
2
<?php 
3
 
464 liveuser 4
/*
5
	QBPWCF, Quick Build PHP website Component base on Fedora Linux.
619 liveuser 6
    Copyright (C) 2015~2024 Min-Jhin,Chen
464 liveuser 7
 
8
    This file is part of QBPWCF.
9
 
10
    QBPWCF is free software: you can redistribute it and/or modify
11
    it under the terms of the GNU General Public License as published by
12
    the Free Software Foundation, either version 3 of the License, or
13
    (at your option) any later version.
14
 
15
    QBPWCF is distributed in the hope that it will be useful,
16
    but WITHOUT ANY WARRANTY; without even the implied warranty of
17
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
    GNU General Public License for more details.
19
 
20
    You should have received a copy of the GNU General Public License
21
    along with QBPWCF.  If not, see <http://www.gnu.org/licenses/>.
22
 
23
*/
24
 
1 liveuser 25
#宣告命名空間
26
namespace qbpwcf;
27
 
466 liveuser 28
#以該檔案的實際位置的 lib path 為 include path 首位
921 liveuser 29
exec("cd ".pathinfo(__FILE__)["dirname"]."/../lib/qbpwcf;pwd;",$output,$status);
466 liveuser 30
set_include_path($output[0].PATH_SEPARATOR.get_include_path());
31
 
464 liveuser 32
#匯入外部套件
466 liveuser 33
include("allInOne.php");
1 liveuser 34
 
35
#函式說明:
36
#抓取命令列的參數.
37
#回傳結果:
38
#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
39
#$reuslt["error"],執行不正常結束的錯訊息陣列.
40
#$result["function"],當前執行的函式名稱.
41
#$result["argu"],使用的參數陣列.
42
#$result["content"],要回傳的參數陣列.
855 liveuser 43
#$result["count"],參數的數量.
44
#$result["_GET"],收到的 HTTP GET 參數陣列.
45
#$result["_POST"],收到的 HTTP POST 參數陣列.
1 liveuser 46
#必填參數:
47
#無
48
#可省略參數:
49
#$conf["echo"],"true"代表要將抓到的參數一個個印出來,"false"代表用回傳的方式,預設為"false".
869 liveuser 50
$conf["echo"]="false";	
855 liveuser 51
$getArgu=cmd::getArgu($conf);
1 liveuser 52
 
855 liveuser 53
#如果執行失敗
54
if($getArgu["status"]==="false"){
55
 
56
	#設置錯誤識別
57
	$result["status"]="false";
58
 
59
	#設置錯誤訊息
60
	$result["error"]=$getArgu;
61
 
869 liveuser 62
	#debug
63
	var_dump($result);
855 liveuser 64
 
65
	}#if end
66
 
67
#印出 json
869 liveuser 68
echo json_encode($getArgu["content"]);
855 liveuser 69
 
1 liveuser 70
?>