2015-03-08 18:02:59 +01:00
|
|
|
<?php
|
|
|
|
|
2015-05-15 00:07:45 +02:00
|
|
|
/*
|
|
|
|
* Bludit
|
2016-05-07 05:10:10 +02:00
|
|
|
* https://www.bludit.com
|
2015-05-15 00:07:45 +02:00
|
|
|
* Author Diego Najar
|
2015-07-15 02:07:07 +02:00
|
|
|
* Bludit is opensource software licensed under the MIT license.
|
2015-05-15 00:07:45 +02:00
|
|
|
*/
|
|
|
|
|
2016-05-07 05:10:10 +02:00
|
|
|
// Check if Bludit is installed
|
2017-10-22 21:28:44 +02:00
|
|
|
if (!file_exists('bl-content/databases/site.php')) {
|
2018-02-25 20:42:57 +01:00
|
|
|
$base = dirname($_SERVER['SCRIPT_NAME']);
|
|
|
|
$base = rtrim($base, '/');
|
|
|
|
header('Location:'.$base.'/install.php');
|
2016-01-21 02:46:13 +01:00
|
|
|
exit('<a href="./install.php">Install Bludit first.</a>');
|
2015-05-15 00:07:45 +02:00
|
|
|
}
|
|
|
|
|
2015-08-04 05:10:12 +02:00
|
|
|
// Load time init
|
2015-03-08 18:02:59 +01:00
|
|
|
$loadTime = microtime(true);
|
|
|
|
|
2015-05-05 03:00:01 +02:00
|
|
|
// Security constant
|
2015-03-08 18:02:59 +01:00
|
|
|
define('BLUDIT', true);
|
|
|
|
|
2015-06-22 00:01:07 +02:00
|
|
|
// Directory separator
|
|
|
|
define('DS', DIRECTORY_SEPARATOR);
|
|
|
|
|
2015-08-17 02:24:22 +02:00
|
|
|
// PHP paths for init
|
2015-08-08 02:39:10 +02:00
|
|
|
define('PATH_ROOT', __DIR__.DS);
|
2016-01-21 01:29:01 +01:00
|
|
|
define('PATH_BOOT', PATH_ROOT.'bl-kernel'.DS.'boot'.DS);
|
2015-03-08 18:02:59 +01:00
|
|
|
|
2015-05-05 03:00:01 +02:00
|
|
|
// Init
|
|
|
|
require(PATH_BOOT.'init.php');
|
2015-03-08 18:02:59 +01:00
|
|
|
|
2015-03-27 02:00:01 +01:00
|
|
|
// Admin area
|
2018-02-25 20:42:57 +01:00
|
|
|
if ($Url->whereAmI()==='admin') {
|
2015-05-05 03:00:01 +02:00
|
|
|
require(PATH_BOOT.'admin.php');
|
2015-03-27 02:00:01 +01:00
|
|
|
}
|
|
|
|
// Site
|
2015-08-17 04:33:49 +02:00
|
|
|
else {
|
2015-05-05 03:00:01 +02:00
|
|
|
require(PATH_BOOT.'site.php');
|
2016-06-17 19:08:08 +02:00
|
|
|
}
|