mirror of https://github.com/MISP/MISP
chg: [internal] Simplify index.php
parent
cc1908a7fd
commit
05e85ce686
|
@ -23,13 +23,14 @@ if (!defined('DS')) {
|
|||
$dispatcher = 'Cake' . DS . 'Console' . DS . 'ShellDispatcher.php';
|
||||
|
||||
if (function_exists('ini_set')) {
|
||||
$root = dirname(dirname(dirname(__FILE__)));
|
||||
$appDir = basename(dirname(dirname(__FILE__)));
|
||||
$install = $root . DS . $appDir . DS . 'Lib' . DS . 'cakephp' . DS . 'lib';
|
||||
$root = dirname(__DIR__, 2);
|
||||
$appDir = basename(dirname(__DIR__));
|
||||
$composerInstall = $root . DS . $appDir . DS . 'Vendor' . DS . 'cakephp' . DS . 'cakephp' . DS . 'lib';
|
||||
|
||||
if (file_exists($composerInstall . DS . $dispatcher)) {
|
||||
$install = $composerInstall; // prefer compose install
|
||||
} else {
|
||||
$install = $root . DS . $appDir . DS . 'Lib' . DS . 'cakephp' . DS . 'lib';
|
||||
}
|
||||
|
||||
ini_set('include_path', $install . PATH_SEPARATOR . ini_get('include_path'));
|
||||
|
|
|
@ -32,17 +32,15 @@ if (!defined('DS')) {
|
|||
|
||||
/**
|
||||
* The full path to the directory which holds "app", WITHOUT a trailing DS.
|
||||
*
|
||||
*/
|
||||
if (!defined('ROOT')) {
|
||||
define('ROOT', dirname(dirname(dirname(__FILE__))));
|
||||
define('ROOT', dirname(__DIR__, 2));
|
||||
}
|
||||
/**
|
||||
* The actual directory name for the "app".
|
||||
*
|
||||
*/
|
||||
if (!defined('APP_DIR')) {
|
||||
define('APP_DIR', basename(dirname(dirname(__FILE__))));
|
||||
define('APP_DIR', basename(dirname(__DIR__)));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -73,10 +71,10 @@ if (!defined('CAKE_CORE_INCLUDE_PATH') && file_exists($vendorPath . DS . $dispat
|
|||
* Change at your own risk.
|
||||
*/
|
||||
if (!defined('WEBROOT_DIR')) {
|
||||
define('WEBROOT_DIR', basename(dirname(__FILE__)));
|
||||
define('WEBROOT_DIR', basename(__DIR__));
|
||||
}
|
||||
if (!defined('WWW_ROOT')) {
|
||||
define('WWW_ROOT', dirname(__FILE__) . DS);
|
||||
define('WWW_ROOT', __DIR__ . DS);
|
||||
}
|
||||
|
||||
if (!defined('CAKE_CORE_INCLUDE_PATH')) {
|
||||
|
|
Loading…
Reference in New Issue