SET_INCLUDE_PATH詳細説明

2873 ワード



:__FILE__
( )
, ; , , ;





string dirname ( string path )
PHP , , ,
_FILE_ :
( :http://localhost/web/index.php), :
_FILE_ http://localhost/web/index.php( )。 dirname (_FILE_) http://localhost/web/ index.php 。
dirname(dirname(_FILE_)) , ;


define() , , :define('MEN','ooooo');
MEN ooooo ;
C , , #define MEN "ooooo";( php C , php c );
, , , , !



define('__TYPECHO_ROOT_DIR__', dirname(__FILE__));
__TYPECHO_ROOT_DIR__ , config.inc.php , config.inc.php ; !

define('__TYPECHO_PLUGIN_DIR__', '/usr/plugins'); !


set_include_path(get_include_path() . PATH_SEPARATOR . $path); , : ;

: include,
:conn.php……,
:set_include_path("/include")

include("conn.php")
? , , ; ,


set_include_path(get_include_path() . PATH_SEPARATOR .
__TYPECHO_ROOT_DIR__ . '/var' . PATH_SEPARATOR .
__TYPECHO_ROOT_DIR__ . __TYPECHO_PLUGIN_DIR__);
, :

include('/inc/sql.php');
include('/inc/conn.php');
;
;
inc , , , include , , : ! !!!!!!!

config.inc.php :
set_include_path(get_include_path() .'/include') , , ! !




:get_include_path() . PATH_SEPARATOR . $path , , . , , , !
, !
! , false;