error logging

This commit is contained in:
flash 2015-04-01 17:35:27 +02:00
parent 5636b6daf5
commit 849d5d3ac9

View file

@ -1,65 +1,67 @@
<?php <?php
/* /*
* Sakura C/PMS * Sakura C/PMS
* (c)Flashwave/Flashii.net 2013-2015 <http://flash.moe> * (c)Flashwave/Flashii.net 2013-2015 <http://flash.moe>
*/ */
// Declare namespace // Declare namespace
namespace Sakura; namespace Sakura;
// Error Reporting: 0 for production and -1 for testing // Define Sakura version
error_reporting(-1); define('SAKURA_VERSION', '20150330');
// Start output buffering with gzip and no gzip fallback // Define Sakura Path
if(!ob_start('ob_gzhandler')) define('ROOT', str_replace('_sakura', '', dirname(__FILE__)));
ob_start();
// Error Reporting: 0 for production and -1 for testing
// Define Sakura version error_reporting(-1);
define('SAKURA_VERSION', '20150330'); ini_set('log_errors', 1);
ini_set('error_log', ROOT .'errors.log');
// Define Sakura Path
define('ROOT_DIRECTORY', str_replace('_sakura', '', dirname(__FILE__))); // Start output buffering with gzip and no gzip fallback
if(!ob_start('ob_gzhandler'))
// Include Configuration ob_start();
require_once ROOT_DIRECTORY .'_sakura/config/config.php';
// Include Configuration
// Include libraries require_once ROOT .'_sakura/config/config.php';
require_once ROOT_DIRECTORY .'_sakura/vendor/autoload.php';
require_once ROOT_DIRECTORY .'_sakura/components/Main.php'; // Include libraries
require_once ROOT_DIRECTORY .'_sakura/components/Hashing.php'; require_once ROOT .'_sakura/vendor/autoload.php';
require_once ROOT_DIRECTORY .'_sakura/components/Configuration.php'; require_once ROOT .'_sakura/components/Main.php';
require_once ROOT_DIRECTORY .'_sakura/components/Templates.php'; require_once ROOT .'_sakura/components/Hashing.php';
require_once ROOT_DIRECTORY .'_sakura/components/Sessions.php'; require_once ROOT .'_sakura/components/Configuration.php';
require_once ROOT_DIRECTORY .'_sakura/components/Users.php'; require_once ROOT .'_sakura/components/Templates.php';
require_once ROOT .'_sakura/components/Sessions.php';
// Generate path to database driver require_once ROOT .'_sakura/components/Users.php';
$_DBNGNPATH = ROOT_DIRECTORY .'_sakura/components/database/'. $sakuraConf['db']['driver'] .'.php';
// Generate path to database driver
// Include database driver $_DBNGNPATH = ROOT .'_sakura/components/database/'. $sakuraConf['db']['driver'] .'.php';
if(file_exists($_DBNGNPATH))
require_once $_DBNGNPATH; // Include database driver
else if(file_exists($_DBNGNPATH))
die('<h1>Failed to load database driver.</h1>'); require_once $_DBNGNPATH;
else
// Set Error handler die('<h1>Failed to load database driver.</h1>');
set_error_handler(array('Sakura\Main', 'ErrorHandler'));
// Set Error handler
// Initialise Flashii Class set_error_handler(array('Sakura\Main', 'ErrorHandler'));
Main::init($sakuraConf);
// Initialise Flashii Class
// Set base page rendering data Main::init($sakuraConf);
$renderData = array(
'sakura' => [ // Set base page rendering data
'version' => SAKURA_VERSION, $renderData = array(
'urls' => Configuration::getLocalConfig('urls'), 'sakura' => [
'charset' => Configuration::getConfig('charset'), 'version' => SAKURA_VERSION,
'currentpage' => $_SERVER['PHP_SELF'] 'urls' => Configuration::getLocalConfig('urls'),
], 'charset' => Configuration::getConfig('charset'),
'php' => [ 'currentpage' => $_SERVER['PHP_SELF']
'sessionid' => \session_id(), ],
'time' => \time() 'php' => [
], 'sessionid' => \session_id(),
'user' => [ 'time' => \time()
'loggedin' => Users::loggedIn() ],
] 'user' => [
); 'loggedin' => Users::loggedIn()
]
);