define('BASEPATH') ИЛИ exit('Прямой доступ к скрипту не разрешен');
Я не могу просто сделать что-то вроде:
Код: Выделить всё
include '/application/config/config.php';
$imgPath = $config['imgURL_Path'];
Код: Выделить всё
if (defined('STDIN'))
{
chdir(dirname(__FILE__));
}
if (($_temp = realpath($system_path)) !== FALSE)
{
$system_path = $_temp.'/';
}
else
{
// Ensure there's a trailing slash
$system_path = rtrim($system_path, '/').'/';
}
// Is the system path correct?
if ( ! is_dir($system_path))
{
header('HTTP/1.1 503 Service Unavailable.', TRUE, 503);
echo 'Your system folder path does not appear to be set correctly. Please open the following file and correct this: '.pathinfo(__FILE__, PATHINFO_BASENAME);
exit(3); // EXIT_CONFIG
}
define('BASEPATH', str_replace('\\', '/', $system_path));
include '/application/config/config.php';
$imgPath = $config['imgURL_Path'];
Код: Выделить всё
Код: Выделить всё
$CI = require_once 'ci.php';
$imgPath = $CI->config->item('imgURL_Path');
Подробнее здесь: https://stackoverflow.com/questions/676 ... -php-not-f