I would add your root
folder to the include path and work from there.
From admin/test.php
set_include_path(implode(PATH_SEPARATOR, array(
realpath(__DIR__ . '/..'),
get_include_path()
)));
require_once 'class/main.class.php';
require_once 'includes/functions.php';
require_once 'config.php';
Update
If I'm following your question correctly, assuming you wanted to define this in the config.php
file, you would do something like this
config.php
set_include_path(implode(PATH_SEPARATOR, array(
__DIR__,
get_include_path()
)));
require_once 'class/main.class.php';
require_once 'includes/functions.php';
admin/test.php
require_once __DIR__ . '/../config.php';
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…