Exemplo n.º 1
0
	public function __construct( $forceInstanceId = NULL ){

		self::$classRouter	= 'CMF_Hydrogen_Environment_Router_Recursive';
		self::$configFile	= "config/config.ini";

		date_default_timezone_set( "Europe/Berlin" );

		$this->detectSelf();

		$this->checkConfig();																		//  create main configuation if missing
		$this->checkInstances();																	//  create setup tool as first instance of none are defined yet
		$this->checkSources();																		//  create local cmFrameworks copy as first module source of none are defined yet
		$this->checkThemes();																		//  link in petrol theme is missing

		$this->pathConfig	= '';

		$this->pathModules	= dirname( __DIR__ ).'/vendor/ceus-media/hydrogen-modules/';			//  get path to public modules

		$this->path			= dirname( getEnv( 'SCRIPT_FILENAME' ) ).'/';
		if( isset( $options['pathApp'] ) )
			$this->path		= $options['pathApp'];													//	@todo: is this needed after migration of setup to CMF/Tools/Hydrogen ?

		$this->initClock();																			//  setup clock
		$this->initConfiguration();																	//  setup configuration
		$this->initModules();																		//  setup module support

		if( !$this->getModules()->has( 'Admin_Module_Sources' ) )									//  source administration module not installed yet
			require_once $this->pathModules.'Admin/Module/Sources/classes/Model/ModuleSource.php5';	//  load atleast module source model class
		if( !$this->getModules()->has( 'Admin_Instances' ) )										//  instance administration module not installed yet
			require_once $this->pathModules.'Admin/Instances/classes/Model/Instance.php5';			//  load atleast instance model class
		if( !$this->getModules()->has( 'Admin_Modules' ) ){											//  module administration module not installed yet
			require_once $this->pathModules.'Admin/Modules/classes/Model/Module.php5';				//  load atleast module model class
			require_once $this->pathModules.'Admin/Modules/classes/Logic/Module.php5';				//  and module logic class for installating missing modules
		}

		$this->initSession();																		//  setup session support
		$this->initMessenger();																		//  setup user interface messenger
		$this->initDatabase();																		//  setup database connection
		$this->initCache();																			//  setup cache support
		$this->initRequest();																		//  setup HTTP request handler
		$this->initResponse();																		//  setup HTTP response handler
		$this->initRouter();																		//  setup request router
		$this->initLanguage();																		//  setup language support
		$this->initPage();																			//  
		$this->initAcl();																			//  
		$this->initRemote( $this->request->get( 'forceInstanceId' ) );														//  
		$this->words	= $this->language->getWords( 'main' );
		$this->__onInit();																			//  
		$this->checkModules();																		//  try to install missing modules
	}
Exemplo n.º 2
0
<?php

require_once 'vendor/autoload.php';
require_once 'vendor/ceus-media/common/compat.php';
define('CMC_PATH', 'vendor/ceus-media/common/src/');
define('CMF_PATH', 'vendor/ceus-media/hydrogen-framework/src/');
Loader::registerNew('php5', 'Tool_Hydrogen_Setup_', 'classes/');
Loader::registerNew('php5', '', 'classes/');
/*  --  RUN APPLICATION  --  */
try {
    Tool_Hydrogen_Setup_App::$classEnvironment = "Tool_Hydrogen_Setup_Environment";
    Tool_Hydrogen_Setup_Environment::$configFile = "config/config.ini";
    $app = new Tool_Hydrogen_Setup_App();
    $app->run();
} catch (Exception $e) {
    UI_HTML_Exception_Page::display($e);
}