我的财富手册

相对用得少的函数--set_include_path

上一篇 / 下一篇  2007-08-15 15:32:22

其实用处不大,如果做MVC的时候,设定了会很麻烦

set_include_path

(PHP 4 >= 4.3.0, PHP 5)

set_include_path — Sets the include_path configuration option

说明

stringset_include_path( string $new_include_path )

Sets theinclude_pathconfiguration option for the duration of the scrīpt.

参数

new_include_path

The new value for theinclude_path

返回值

Returns the oldinclude_pathon success orFALSEon failure.

范例

例 1748. set_include_path()example

<?php
// Works as of PHP 4.3.0
set_include_path('/inc'
);

// Works in all PHP versions
ini_set('include_path','/inc'
);
?>

例 1749. Adding to the include path

Making use of thePATH_SEPARATORconstant, it is possible to extend the include path regardless of the operating system.

In this example we add/usr/lib/pearto the end of the existinginclude_path.

<?php
$path
='/usr/lib/pear'
;
set_include_path(get_include_path() .PATH_SEPARATOR.$path
);
?>

参见

ini_set()
get_include_path()
restore_include_path()
include()


TAG:

我的财富手册 引用 删除 Snake.Zero   /   2008-03-25 10:28:09
我没有碰到什么麻烦,只是这个函数是对于自己有服务器的老外,就有用,咱们国内有时候一个虚拟主机上要跑很多程序的话,尤其是基于一个核心的话,很容易产生冲突和找不到文件的错误
引用 删除 liuxingyuyuni   /   2008-03-12 01:15:50
其实用处不大,如果做MVC的时候,设定了会很麻烦?

请问你遇到什么麻烦?
我记得Zend Framework启动文件里一般就加这条
 

评分:0

我来说两句

显示全部

:loveliness: :handshake :victory: :funk: :time: :kiss: :call: :hug: :lol :'( :Q :L ;P :$ :P :o :@ :D :( :)

数据统计

  • 访问量: 2495
  • 日志数: 12
  • 书签数: 13
  • 建立时间: 2007-04-19
  • 更新时间: 2008-03-27

RSS订阅

Open Toolbar