|
|
@ -1,6 +1,9 @@
|
|
|
|
<?php
|
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
|
|
namespace Config;
|
|
|
|
namespace Config;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
require_once(__DIR__.'/vendor/autoload.php');
|
|
|
|
|
|
|
|
|
|
|
|
class Autoload
|
|
|
|
class Autoload
|
|
|
|
{
|
|
|
|
{
|
|
|
|
private static $instance = null;
|
|
|
|
private static $instance = null;
|
|
|
@ -8,14 +11,14 @@ class Autoload
|
|
|
|
public static function charger()
|
|
|
|
public static function charger()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (null !== self::$instance) {
|
|
|
|
if (null !== self::$instance) {
|
|
|
|
throw RuntimeException(sprintf('%s is already started', __CLASS__));
|
|
|
|
throw new RuntimeException(sprintf('%s is already started', __CLASS__));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
self::$instance = new self();
|
|
|
|
self::$instance = new self();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!spl_autoload_register(array(self::$instance, 'autoloader'))) {
|
|
|
|
if (!spl_autoload_register(array(self::$instance, 'autoloader'))) {
|
|
|
|
throw RuntimeException(sprintf('%s : Could not start the autoload', __CLASS__));
|
|
|
|
throw new RuntimeException(sprintf('%s : Could not start the autoload', __CLASS__));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -24,7 +27,7 @@ class Autoload
|
|
|
|
if (null !== self::$instance) {
|
|
|
|
if (null !== self::$instance) {
|
|
|
|
|
|
|
|
|
|
|
|
if (!spl_autoload_unregister(array(self::$instance, 'autoloader'))) {
|
|
|
|
if (!spl_autoload_unregister(array(self::$instance, 'autoloader'))) {
|
|
|
|
throw RuntimeException('Could not stop the autoload');
|
|
|
|
throw new RuntimeException('Could not stop the autoload');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
self::$instance = null;
|
|
|
|
self::$instance = null;
|
|
|
|