I am currently developing a Content Management System, and I have just completed the Error Handling system, which handles error'serrors according to the user's settings. What do
I want to know during the review? Everyevery single thing I could improve to make it more flexible, robust, light weight and fast processing. If there are better ways of doing things, I am ready to re-do stuff. I just want comments on ErrorHandlingErrorHandling
System, in this global.php you can see how I instantiate them. It would also be helpful if you can suggest renames to variables, etc to make more sense. This project is going to be up on GitHub soon. Please be as strict as possible, and point out even a tiny slight flaw in it. Thanks!
Global.php <?php /** * @author Hassan Althaf * @link www.HassanTech.org * @package IDK CMS */ require_once("config.php");
<?php
/**
* @author Hassan Althaf
* @link www.HassanTech.org
* @package IDK CMS
*/
require_once("config.php");
if($configuration['errors']['show_errors'] == 0) {
error_reporting(0);
}
require_once("ErrorHandling/interface.ErrorHandlerMapper.php");
require_once("ErrorHandling/class.ErrorHandlerController.php");
require_once("ErrorHandling/class.ErrorHandlerLocalMapper.php");
require_once("ErrorHandling/class.ErrorHandlerDatabaseMapper.php");
$database = new mysqli(
$configuration['database']['host'],
$configuration['database']['username'],
$configuration['database']['password'],
$configuration['database']['database']
);
if($configuration['errors']['error_log_method'] == 'local') {
$errorHandlerMapper = new CMS\Core\ErrorHandling\ErrorHandlerLocalMapper();
} elseif($configuration['errors']['error_log_method'] == 'database') {
$errorHandlerMapper = new CMS\Core\ErrorHandling\ErrorHandlerDatabaseMapper($database);
}
$errorHandlerController = new CMS\Core\ErrorHandling\ErrorHandlerController($errorHandlerMapper);
if($configuration['errors']['enable_error_logs'] == 1) {
if($database->connect_errno) {
echo $database->connect_error;
}
}