Skip to content

Commit

Permalink
Load 3rd party libs earlier (glpi-project#4711)
Browse files Browse the repository at this point in the history
Mainly to get lib constants available (so we can refine Logger level in local_define for example).
  • Loading branch information
trasher authored Sep 28, 2018
1 parent f621c1e commit be66983
Show file tree
Hide file tree
Showing 11 changed files with 14 additions and 13 deletions.
2 changes: 1 addition & 1 deletion apirest.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
define('DO_NOT_CHECK_HTTP_REFERER', 1);
ini_set('session.use_cookies', 0);

include ('./inc/autoload.function.php');
include_once (GLPI_ROOT . "/inc/based_config.php");

$api = new APIRest;
$api->call();
2 changes: 1 addition & 1 deletion apixmlrpc.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
define('GLPI_ROOT', __DIR__);
define('DO_NOT_CHECK_HTTP_REFERER', 1);

include ('./inc/autoload.function.php');
include_once (GLPI_ROOT . "/inc/based_config.php");

$api = new APIXmlrpc;
$api->call();
3 changes: 0 additions & 3 deletions inc/autoload.function.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@
die("Sorry. You can't access this file directly");
}

include_once (GLPI_ROOT."/inc/based_config.php");
include_once (GLPI_ROOT."/inc/define.php");

define ('NS_GLPI', 'Glpi\\');
define ('NS_PLUG', 'GlpiPlugin\\');

Expand Down
4 changes: 4 additions & 0 deletions inc/based_config.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@
date_default_timezone_set(@date_default_timezone_get());
}

include_once (GLPI_ROOT . "/inc/autoload.function.php");

// If this file exists, it is load
if (file_exists(GLPI_ROOT. '/config/local_define.php') && !defined('TU_USER')) {
require_once GLPI_ROOT. '/config/local_define.php';
Expand Down Expand Up @@ -162,3 +164,5 @@
define("GLPI_JQUERY_UPLOADHANDLER",
GLPI_ROOT.'/lib/jqueryplugins/jquery-file-upload/server/php/UploadHandler.php');
}

include_once (GLPI_ROOT . "/inc/define.php");
2 changes: 1 addition & 1 deletion inc/includes.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
define('GLPI_ROOT', dirname(__DIR__));
}

include_once (GLPI_ROOT . "/inc/autoload.function.php");
include_once GLPI_ROOT . '/inc/based_config.php';

// Init Timer to compute time of display
$TIMER_DEBUG = new Timer();
Expand Down
4 changes: 2 additions & 2 deletions install/install.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

define('GLPI_ROOT', realpath('..'));

include_once (GLPI_ROOT . "/inc/autoload.function.php");
include_once (GLPI_ROOT . "/inc/based_config.php");
include_once (GLPI_ROOT . "/inc/db.function.php");

Config::detectRootDoc();
Expand Down Expand Up @@ -673,4 +673,4 @@ function checkConfigFile() {
break;
}
}
footer_html();
footer_html();
2 changes: 1 addition & 1 deletion install/update.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
define('GLPI_ROOT', realpath('..'));
}

include_once (GLPI_ROOT . "/inc/autoload.function.php");
include_once (GLPI_ROOT . "/inc/based_config.php");
include_once (GLPI_ROOT . "/inc/db.function.php");
include_once (GLPI_CONFIG_DIR . "/config_db.php");
Config::detectRootDoc();
Expand Down
2 changes: 1 addition & 1 deletion install/update_content.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
// Do not include config.php so set root_doc
$CFG_GLPI['root_doc'] = '..';

include_once (GLPI_ROOT . "/inc/autoload.function.php");
include_once (GLPI_ROOT . "/inc/based_config.php");
include_once (GLPI_ROOT . "/inc/db.function.php");
include_once (GLPI_CONFIG_DIR . "/config_db.php");

Expand Down
2 changes: 1 addition & 1 deletion scripts/checkdb.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ function displayUsage() {
define("GLPI_CONFIG_DIR", $args['config-dir']);
}

include_once (GLPI_ROOT . "/inc/autoload.function.php");
include_once (GLPI_ROOT . "/inc/based_config.php");
include_once (GLPI_ROOT . "/inc/db.function.php");
include_once (GLPI_CONFIG_DIR . "/config_db.php");
Config::detectRootDoc();
Expand Down
2 changes: 1 addition & 1 deletion scripts/cliinstall.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
@mkdir(GLPI_CONFIG_DIR . '/files/_log', 0775, true);
}

include_once (GLPI_ROOT . "/inc/autoload.function.php");
include_once (GLPI_ROOT . "/inc/based_config.php");
include_once (GLPI_ROOT . "/inc/db.function.php");

$GLPI = new GLPI();
Expand Down
2 changes: 1 addition & 1 deletion scripts/cliupdate.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
define("GLPI_CONFIG_DIR", $args['config-dir']);
}

include_once (GLPI_ROOT . "/inc/autoload.function.php");
include_once (GLPI_ROOT . "/inc/based_config.php");
include_once (GLPI_ROOT . "/inc/db.function.php");
include_once (GLPI_CONFIG_DIR . "/config_db.php");

Expand Down

0 comments on commit be66983

Please sign in to comment.