php_manual_zh_notes

February 4th, 2009 by Dream☆Wing Leave a reply »

1.Standard PHP Library (SPL)

->SPL Functions

–>spl_autoload_register— 将给定的函数注册为__autoload()函数使用

注:spl_autoload_register(array(__CLASS__, ‘crystal_autoload’));该类的crystal_autoload方法必须为static

 

 

2.include_path

指定一组目录用于 require()include()fopen_with_path() 函数来寻找文件。格式和系统的 PATH 环境变量类似:一组目录的列表,在 UNIX 下用冒号分隔,在 Windows 下用分号分隔。

 

Example #1 Unix include_path

include_path=".:/php/includes"

 

 

Example #2 Windows include_path

include_path=".;c:\php\includes"

 

在包含路径中使用 . 可以允许相对路径,它代表当前目录。

 

注:分割符号可以用常量PATH_SEPARATOR来指定 

get_include_path()可以获取现有系统设置的include_path;set_include_path()可以设置include_path

  • Share/Save/Bookmark
Advertisement
Post comment as twitter logo facebook logo
Sort: Newest | Oldest