Set Up root path constant
Posted: Wed Dec 14, 2011 4:17 pm
Hello, I am studying the code of phpBB, virtually all of the files have this code at the beginning of the file, my question is as follows:
How the php know that PHPBB_ROOT_PATH refers to the root directory where the files and directories are on the forum.
It seems to me that is a constant set to root, but where is it defined?, for example I wanted to change the PHPBB_ROOT_PATH to PHPBB_HOME
How the php know that PHPBB_ROOT_PATH refers to the root directory where the files and directories are on the forum.
It seems to me that is a constant set to root, but where is it defined?, for example I wanted to change the PHPBB_ROOT_PATH to PHPBB_HOME
Code: Select all
define('IN_PHPBB', true);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);
include($phpbb_root_path . 'includes/functions_display.' . $phpEx);