Ejemplo n.º 1
0
 /**
  * Performs the bootstrapping.
  */
 public function __construct()
 {
     // define root directories
     define('ABLERON_ROOT_DIR', str_replace('//', '/', str_replace('\\', '/', dirname(__DIR__) . '/src')));
     define('ABLERON_APP_DIR', ABLERON_ROOT_DIR . '/app');
     define('ABLERON_CONFIG_DIR', ABLERON_ROOT_DIR . '/config');
     define('ABLERON_VENDOR_DIR', ABLERON_ROOT_DIR . '/vendor');
     define('ABLERON_TESTS_DIR', str_replace('//', '/', str_replace('\\', '/', __DIR__)));
     define('ABLERON_INSTALL_DIR', ABLERON_ROOT_DIR . '/install');
     // init composer class loader
     /** @var \Composer\Autoload\ClassLoader $classLoader */
     $classLoader = (require ABLERON_VENDOR_DIR . '/autoload.php');
     $classLoader->addPsr4('Ableron\\', ABLERON_TESTS_DIR . '/unittests/');
     $classLoader->addPsr4('Ableron\\Tests\\Helper\\', ABLERON_TESTS_DIR . '/helper/');
     // install system if necessary
     if (file_exists(ABLERON_INSTALL_DIR . '/app/Installer.php')) {
         // load Installer
         require ABLERON_INSTALL_DIR . '/app/Installer.php';
         // execute installer
         new Installer(include ABLERON_INSTALL_DIR . '/config/automaticInstallation.config.php');
     } else {
         // init Ableron
         Application::init($classLoader, include ABLERON_CONFIG_DIR . '/context.php');
     }
 }
 /**
  * Installs the base system.
  *
  * @return void
  */
 private function installBaseSystem()
 {
     // prepare database
     $dbTypeClassName = $this->getInstaller()->getInstallationParameter('db.type.class');
     (new $dbTypeClassName($this->getInstaller()))->prepareDatabase();
     // adjust files
     $this->adjustFiles();
     // install core module
     Application::init(new ClassLoader(), include ABLERON_CONFIG_DIR . '/context.php');
     Application::getModuleManager()->install(new CoreModule());
     // create admin account
     $this->createAdminAccount();
 }