Subversion Repositories qbpwcf-lib(archive)

Rev

Rev 619 | 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 首位
29
exec("cd ".pathinfo(__FILE__)["dirname"]."/../../;pwd;",$output,$status);
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
#依據提供查詢IP服務的網站取得伺服器對外的IP.
37
#回傳的結果:
38
#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
39
#$result["function"],當前執行的函數名稱.
40
#$result["error"],錯誤訊息陣列.
41
#$result["content"],伺服端對外的IP.
42
#必填參數:
43
#$conf["fileArgu"],字串,php變數__FILE__的內容,亦即該檔案在檔案系統的絕對路徑
44
$conf["fileArgu"]=__FILE__;
45
$getServerRealIP=csInformation::getServerRealIP($conf);
46
unset($conf);
47
 
48
#如果運行失敗
49
if($getServerRealIP["status"]==="false"){
50
 
51
	#印出內容
52
	var_dump($getServerRealIP);
53
 
54
	#停止運行
55
	exit;
56
 
57
	}#if end
58
 
59
#印出 IP
60
echo $getServerRealIP["content"].PHP_EOL;
61
 
62
?>