I am having trouble understanding this code
define( 'APP_LIB' , dirname(__FILE__) . '/loi' );
define( 'COMMON_LIB' , dirname(__FILE__) . '/../pk2' );
define( 'COMMON_APP_LIB' , dirname(__FILE__) . '/app-lib' );
ini_set('include_path', ini_get('include_path') . ':'
. APP_LIB. ':'
. COMMON_LIB_PATH . ':'
. COMMON_APP_LIB ':'
);
require_once 'loader.php';
I get this error :
Fatal error: require_once() [function.require]: Failed opening required 'loader.php'
I think this error is related to that ini_set
function but my main problem is: what is the meaning of ":
" in ini_set
function (second argument)?
why we need to stick these path together to put them all in include path?
The colons are to add multiple directories to the path. The PATH is set up like this :
.:/usr/share/pear:/usr/share/php
So in order to add more directories, the colon is needed. Since the loader is not found, echo out the include_path after the ini_set, and compare it to where loader.php is located.