Skip to content
Snippets Groups Projects
Commit 3c1dd3fe authored by Stein Magne Bjorklund's avatar Stein Magne Bjorklund
Browse files

Make boostrapping Loadspeakr a little less brittle

- Require the application default settings. Loadspkr needs it
and have to stop if not present and not simply throw a
notification.
- Introduce a constant that points to where Loadspkr have been installed. Allows
us to later move the common.inc.php without it breaks the bootstrap.
parent 0b83f6d1
No related branches found
No related tags found
1 merge request!16Resolve "Introduce PSR-4 autoloading"
......@@ -81,8 +81,10 @@ $conf['modules']['available'] = array('static','service', 'type');
$conf['admin']['pass'] = 'admin';
global $lodspk;
$lodspk['maxResults'] = 1000;
include_once('settings.inc.php');
if (file_exists(LOADSPEAKR_ROOT . '/settings.inc.php')) {
require_once LOADSPEAKR_ROOT . '/settings.inc.php';
}
$conf['view']['standard']['baseUrl'] = $conf['basedir'];
?>
......@@ -7,7 +7,10 @@ use uib\ub\loadspeakr\Importer;
use uib\ub\loadspeakr\Logging;
use uib\ub\loadspeakr\Utils;
const LOADSPEAKR_ROOT = __DIR__;
require_once __DIR__ . '/vendor/autoload.php';
require_once __DIR__ . '/common.inc.php';
if (isset($_GET['q']) && $_GET['q'] === 'import') {
$imp = new Importer();
......@@ -21,8 +24,6 @@ if (!file_exists('settings.inc.php')) {
exit(0);
}
include_once('common.inc.php');
$conf['logfile'] = null;
if ($conf['debug']) {
if (isset($_GET['q']) && $_GET['q'] === 'logs') {
......@@ -64,7 +65,6 @@ if ($uri === $conf['basedir']) {
// Configure external URIs if necessary.
$localUri = $conf['basedir'] . $_GET['q'];
$foo = $_SERVER['HTTP_HOST'];
$uri = Utils::getMirroredUri($localUri);
// Load Loadspeakr modules.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment