2015-03-08 14:02:59 -03:00
|
|
|
<?php
|
|
|
|
|
2015-05-14 22:07:45 +00:00
|
|
|
/*
|
|
|
|
* Bludit
|
2016-05-07 00:10:10 -03:00
|
|
|
* https://www.bludit.com
|
2015-05-14 22:07:45 +00:00
|
|
|
* Author Diego Najar
|
2015-07-14 21:07:07 -03:00
|
|
|
* Bludit is opensource software licensed under the MIT license.
|
2015-05-14 22:07:45 +00:00
|
|
|
*/
|
|
|
|
|
2016-05-07 00:10:10 -03: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, '/');
|
2018-07-10 18:37:46 +02:00
|
|
|
$base = rtrim($base, '\\'); // Workarround for Windows Servers
|
2018-02-25 20:42:57 +01:00
|
|
|
header('Location:'.$base.'/install.php');
|
2016-01-20 22:46:13 -03:00
|
|
|
exit('<a href="./install.php">Install Bludit first.</a>');
|
2015-05-14 22:07:45 +00:00
|
|
|
}
|
|
|
|
|
2015-08-04 00:10:12 -03:00
|
|
|
// Load time init
|
2015-03-08 14:02:59 -03:00
|
|
|
$loadTime = microtime(true);
|
|
|
|
|
2015-05-05 01:00:01 +00:00
|
|
|
// Security constant
|
2015-03-08 14:02:59 -03:00
|
|
|
define('BLUDIT', true);
|
|
|
|
|
2015-06-21 19:01:07 -03:00
|
|
|
// Directory separator
|
|
|
|
define('DS', DIRECTORY_SEPARATOR);
|
|
|
|
|
2015-08-16 21:24:22 -03:00
|
|
|
// PHP paths for init
|
2015-08-07 21:39:10 -03:00
|
|
|
define('PATH_ROOT', __DIR__.DS);
|
2016-01-20 21:29:01 -03:00
|
|
|
define('PATH_BOOT', PATH_ROOT.'bl-kernel'.DS.'boot'.DS);
|
2015-03-08 14:02:59 -03:00
|
|
|
|
2015-05-05 01:00:01 +00:00
|
|
|
// Init
|
|
|
|
require(PATH_BOOT.'init.php');
|
2015-03-08 14:02:59 -03:00
|
|
|
|
2015-03-27 01:00:01 +00:00
|
|
|
// Admin area
|
2018-07-17 19:13:01 +02:00
|
|
|
if ($url->whereAmI()==='admin') {
|
2015-05-05 01:00:01 +00:00
|
|
|
require(PATH_BOOT.'admin.php');
|
2015-03-27 01:00:01 +00:00
|
|
|
}
|
|
|
|
// Site
|
2015-08-16 23:33:49 -03:00
|
|
|
else {
|
2015-05-05 01:00:01 +00:00
|
|
|
require(PATH_BOOT.'site.php');
|
2018-07-01 14:17:24 +02:00
|
|
|
}
|