(PECL geoip >= 1.1.0)
geoip_setup_custom_directory — 自定義 GeoIP 數據庫的目錄
$path
): voidgeoip_setup_custom_directory() 函數將會(huì )更改 GeoIP 數據庫的默認目錄。這個(gè)設置和直接在 php 配置文件中設置的geoip.custom_directory參數效果是一樣的。
path
磁盤(pán)上 GeoIP 數據庫的絕對路徑。
沒(méi)有返回值。
示例 #1 geoip_setup_custom_directory() 例子:
以下例程將會(huì )更改 GeoIP 默認數據庫的路徑。
<?php
geoip_setup_custom_directory('/some/other/path');
print geoip_db_filename(GEOIP_COUNTRY_EDITION);
?>
以上例程會(huì )輸出:
/some/other/path/GeoIP.dat