geoip_setup_custom_directory
(PECL geoip >= 1.1.0)
geoip_setup_custom_directory — 自定義 GeoIP 數據庫的目錄
說明
geoip_setup_custom_directory(string
$path
): voidgeoip_setup_custom_directory() 函式將會更改 GeoIP 數據庫的預設目錄。這個設定和直接在 php 配置檔案中設定的geoip.custom_directory參數效果是一樣的。
參數
-
path
-
磁碟上 GeoIP 數據庫的絕對路徑。
返回值
沒有返回值。
範例
示例 #1 geoip_setup_custom_directory() 例子:
以下例程將會更改 GeoIP 預設數據庫的路徑。
<?php
geoip_setup_custom_directory('/some/other/path');
print geoip_db_filename(GEOIP_COUNTRY_EDITION);
?>
以上例程會輸出:
/some/other/path/GeoIP.dat