array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'zh', ), 'this' => array ( 0 => 'function.geoip-setup-custom-directory.php', 1 => 'geoip_setup_custom_directory', ), 'up' => array ( 0 => 'ref.geoip.php', 1 => 'GeoIP 函数', ), 'prev' => array ( 0 => 'function.geoip-region-name-by-code.php', 1 => 'geoip_region_name_by_code', ), 'next' => array ( 0 => 'function.geoip-time-zone-by-country-and-region.php', 1 => 'geoip_time_zone_by_country_and_region', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'zh', 'path' => 'reference/geoip/functions/geoip-setup-custom-directory.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PECL geoip >= 1.1.0)
geoip_setup_custom_directory — 自定义 GeoIP 数据库的目录
geoip_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