Beispiel #1
0
 /**
  * Load and initialize the framework
  *
  * Loads the {@link AeAutoload} class and registers two basic autoload
  * methods:
  *
  * - {@link AeCore::autoload()}
  * - {@link AeException::autoload()}
  *
  * Also calls {@link AeAutoload::detect()} instantly for any custom autoload
  * handlers.
  *
  * @throws AeException #505 if PHP version is less than 5.2.0
  */
 public static function load()
 {
     if (!defined('SLASH')) {
         /**
          * DIRECTORY_SEPARATOR shortcut
          */
         define('SLASH', DIRECTORY_SEPARATOR);
     }
     set_include_path(realpath(dirname(__FILE__) . SLASH . '..') . PATH_SEPARATOR . get_include_path());
     if (!version_compare(PHP_VERSION, '5.2.0', '>=')) {
         // *** Explicitly include exception file
         require_once 'ae' . SLASH . 'classes' . SLASH . 'exception.class.php';
         throw new AeException('AnEngine framework requires PHP version 5.2.0 or later', 505);
     }
     require_once 'ae' . SLASH . 'autoload.class.php';
     AeAutoload::extensions('.php');
     AeAutoload::register(array('AeCore', 'autoload'));
     AeAutoload::register(array('AeException', 'autoload'));
     AeAutoload::detect();
 }