bludit/index.php

40 lines
757 B
PHP
Raw Normal View History

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
2016-01-20 21:29:01 -03:00
if( !file_exists('bl-content/databases/site.php') )
2015-05-14 22:07:45 +00:00
{
header('Location:./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
2015-08-16 23:33:49 -03: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');
2016-06-17 14:08:08 -03:00
}