请问下这段ini_set代码有什么用处, 会影响到那些东西?if(preg_match('/WIN/i', $_ENV['OS'])) {
$include_separator = ';';
} else {
$include_separator = ':';
}
$include_path = DIR_FS_CATALOG . DIR_WS_INCLUDES . $include_separator .
DIR_FS_CATALOG . DIR_WS_INCLUDES . 'classes' . $include_separator .
DIR_FS_CATALOG . DIR_WS_INCLUDES . 'functions' . $include_separator;
ini_set('include_path', ini_get('include_path') . $include_separator . $include_path);
$include_separator = ';';
} else {
$include_separator = ':';
}
$include_path = DIR_FS_CATALOG . DIR_WS_INCLUDES . $include_separator .
DIR_FS_CATALOG . DIR_WS_INCLUDES . 'classes' . $include_separator .
DIR_FS_CATALOG . DIR_WS_INCLUDES . 'functions' . $include_separator;
ini_set('include_path', ini_get('include_path') . $include_separator . $include_path);
include("xxx.php");
就行了,不用再写那么长的路径了..
define('DIR_WS_INCLUDES','include/');$include_path = DIR_FS_CATALOG . DIR_WS_INCLUDES . $include_separator .
DIR_FS_CATALOG . DIR_WS_INCLUDES . 'classes' . $include_separator .
DIR_FS_CATALOG . DIR_WS_INCLUDES . 'functions' . $include_separator;
//在这 $include_path 不是等于
//var/localhost/web/:var/localhost/web/classes:var/localhost/web/functions:ini_set('include_path', ini_get('include_path') . $include_separator . $include_path);
;;;;;;;;;;;;;;;;;;;;;;;;;
; Paths and Directories ;
;;;;;;;;;;;;;;;;;;;;;;;;;; UNIX: "/path1:/path2"
;include_path = ".:/php/includes"
;
; Windows: "\path1;\path2"
;include_path = ".;c:\php\includes"这样一段他指定了php的搜索路径
搜索路径由一组用分隔符隔开的路径组成
php将在这组路径中一次查找所需文件