2015-02-21 12:53:05 +00:00
|
|
|
<?php
|
|
|
|
/*
|
2015-03-29 16:25:18 +00:00
|
|
|
* Sakura C/PMS
|
2015-02-21 12:53:05 +00:00
|
|
|
* (c)Flashwave/Flashii Media 2013-2015 <http://flash.moe>
|
|
|
|
*/
|
|
|
|
|
2015-03-29 15:54:27 +00:00
|
|
|
// Declare namespace
|
|
|
|
namespace Sakura;
|
2015-04-01 15:20:15 +00:00
|
|
|
print '1';
|
2015-02-21 12:53:05 +00:00
|
|
|
// Start output buffering
|
2015-04-01 15:22:26 +00:00
|
|
|
\ob_start();
|
2015-04-01 15:20:15 +00:00
|
|
|
print '2';
|
2015-02-21 12:53:05 +00:00
|
|
|
// Define Sakura version
|
2015-03-30 15:45:27 +00:00
|
|
|
define('SAKURA_VERSION', '20150330');
|
2015-04-01 15:20:15 +00:00
|
|
|
print '3';
|
2015-03-08 04:26:26 +00:00
|
|
|
// Define Sakura Path
|
|
|
|
define('ROOT_DIRECTORY', str_replace('_sakura', '', dirname(__FILE__)));
|
2015-04-01 15:20:15 +00:00
|
|
|
print '4';
|
|
|
|
// Error Reporting: 0 for production and -1 for testing
|
2015-02-21 12:53:05 +00:00
|
|
|
error_reporting(-1);
|
2015-04-01 15:20:15 +00:00
|
|
|
print '5';
|
2015-02-21 12:53:05 +00:00
|
|
|
// Include Configuration
|
2015-03-08 04:27:49 +00:00
|
|
|
require_once ROOT_DIRECTORY .'_sakura/config/config.php';
|
2015-04-01 15:20:15 +00:00
|
|
|
print '6';
|
2015-03-08 04:14:57 +00:00
|
|
|
// Include libraries
|
2015-04-01 15:20:15 +00:00
|
|
|
require_once ROOT_DIRECTORY .'_sakura/vendor/autoload.php';print ':twig';
|
|
|
|
require_once ROOT_DIRECTORY .'_sakura/components/Main.php';print ':main';
|
|
|
|
require_once ROOT_DIRECTORY .'_sakura/components/Hashing.php';print ':hash';
|
|
|
|
require_once ROOT_DIRECTORY .'_sakura/components/Configuration.php';print ':conf';
|
|
|
|
require_once ROOT_DIRECTORY .'_sakura/components/Templates.php';print ':temp';
|
|
|
|
require_once ROOT_DIRECTORY .'_sakura/components/Sessions.php';print ':sess';
|
|
|
|
require_once ROOT_DIRECTORY .'_sakura/components/Users.php';print ':user:';
|
|
|
|
print '7';
|
2015-03-08 04:14:57 +00:00
|
|
|
// Generate path to database driver
|
2015-03-29 16:28:41 +00:00
|
|
|
$_DBNGNPATH = ROOT_DIRECTORY .'_sakura/components/database/'. $sakuraConf['db']['driver'] .'.php';
|
2015-04-01 15:20:15 +00:00
|
|
|
print '8';
|
2015-03-08 04:14:57 +00:00
|
|
|
// Include database driver
|
|
|
|
if(file_exists($_DBNGNPATH))
|
|
|
|
require_once $_DBNGNPATH;
|
|
|
|
else
|
|
|
|
die('<h1>Failed to load database driver.</h1>');
|
2015-04-01 15:20:15 +00:00
|
|
|
print '9';
|
2015-02-21 12:53:05 +00:00
|
|
|
// Set Error handler
|
2015-03-25 09:59:10 +00:00
|
|
|
set_error_handler(array('Sakura\Main', 'ErrorHandler'));
|
2015-04-01 15:20:15 +00:00
|
|
|
print 'x1';
|
2015-02-21 12:53:05 +00:00
|
|
|
// Initialise Flashii Class
|
2015-03-29 16:28:41 +00:00
|
|
|
Main::init($sakuraConf);
|
2015-04-01 15:20:15 +00:00
|
|
|
print 'x2';
|
2015-03-08 04:47:28 +00:00
|
|
|
// Set base page rendering data
|
|
|
|
$renderData = array(
|
|
|
|
'sakura' => [
|
2015-03-29 18:39:22 +00:00
|
|
|
'version' => SAKURA_VERSION,
|
|
|
|
'urls' => Configuration::getLocalConfig('urls'),
|
|
|
|
'charset' => Configuration::getConfig('charset'),
|
|
|
|
'currentpage' => $_SERVER['PHP_SELF']
|
2015-03-29 17:33:06 +00:00
|
|
|
],
|
2015-03-29 19:04:55 +00:00
|
|
|
'php' => [
|
|
|
|
'sessionid' => \session_id(),
|
|
|
|
'time' => \time()
|
|
|
|
],
|
2015-03-29 17:33:06 +00:00
|
|
|
'user' => [
|
|
|
|
'loggedin' => Users::loggedIn()
|
2015-03-30 15:45:27 +00:00
|
|
|
]
|
2015-03-08 04:47:28 +00:00
|
|
|
);
|
2015-04-01 15:20:15 +00:00
|
|
|
print 'x3';
|