This repository has been archived on 2024-06-26. You can view files and clone it, but cannot push or open issues or pull requests.
sakura/_sakura/sakura.php

66 lines
2.1 KiB
PHP
Raw Normal View History

<?php
/*
2015-03-29 16:25:18 +00:00
* Sakura C/PMS
* (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';
// Start output buffering
2015-04-01 15:22:26 +00:00
\ob_start();
2015-04-01 15:20:15 +00:00
print '2';
// 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
error_reporting(-1);
2015-04-01 15:20:15 +00:00
print '5';
// 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';
// 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';
// Generate path to database driver
$_DBNGNPATH = ROOT_DIRECTORY .'_sakura/components/database/'. $sakuraConf['db']['driver'] .'.php';
2015-04-01 15:20:15 +00:00
print '8';
// 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';
// 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';
// Initialise Flashii Class
Main::init($sakuraConf);
2015-04-01 15:20:15 +00:00
print 'x2';
// 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-04-01 15:20:15 +00:00
print 'x3';