szurubooru/src/Bootstrap.php

31 lines
584 B
PHP
Raw Normal View History

2014-10-02 19:19:55 +02:00
<?php
namespace Szurubooru;
final class Bootstrap
{
public static function init()
{
self::turnErrorsIntoExceptions();
self::initAutoloader();
}
private static function initAutoloader()
{
require(__DIR__
. DIRECTORY_SEPARATOR . '..'
. DIRECTORY_SEPARATOR . 'vendor'
. DIRECTORY_SEPARATOR . 'autoload.php');
}
private static function turnErrorsIntoExceptions()
{
set_error_handler(
function($errno, $errstr, $errfile, $errline, array $errcontext)
{
throw new \ErrorException($errstr, 0, $errno, $errfile, $errline);
});
}
}
Bootstrap::init();