Exemplo n.º 1
0
 /**
  * the constructor of this installer-class.
  * it initialize all needed values and set the hidden fields for the template
  */
 public function __construct()
 {
     //Initialize the installer with the current-needed POST and Session values
     $this->init();
     //set a common title
     $this->s_step_title = __('install_common_title', 'install');
     //set the hidden fields, which we don't need for the installation
     \Replacer::set_hidden_fields(array('character', 'online', 'more'));
     if ($this->check_dbconfig_file() !== array()) {
         \Replacer::page_header($this->s_step_title);
         $message = __('Probleme mit der ".dbconfig.default' . EXT . '". <br>Folgende Konstanten haben andere Werte als die ursprüngliche Datei');
         throw new \LOGD_Exception($message);
     }
     //switch/case for the step and go to the right method
     switch ($this->i_step) {
         case 0:
             $this->step_0();
             break;
     }
     //set the page header and render the install view
     \Replacer::page_header($this->s_step_title);
     \View::create('install')->bind_by_value('i_step', $this->i_step)->render();
 }
Exemplo n.º 2
0
//Initialize the random number generator
mt_srand(LOGD::make_seed());
//Initialize the Session and the Routing
Session::get_session();
Routing::init();
//check if the dbconfig.default.php exist, if yes - we have to install the game
if (!file_exists(dirname(LOGD_ROOT) . DIRECTORY_SEPARATOR . '.dbconfig' . EXT) && file_exists(dirname(LOGD_ROOT) . DIRECTORY_SEPARATOR . '.dbconfig.default' . EXT)) {
    //try-catch the installer, if it fails
    try {
        new \Install\Installer();
    } catch (LOGD_Exception $e) {
        $e->print_error();
    }
    exit(1);
}
//Initialize the language Class
//todo this is later only a fallback if nothing found in the database
//I18N::init(GAME_LANGUAGE);
//including the .dbconfig.php with all Database-Constants
include dirname(LOGD_ROOT) . DIRECTORY_SEPARATOR . '.dbconfig' . EXT;
//Load the default template instance
// @todo maybe set it later via database
//Template::get_instance(null,false);
//Set the page_header and page_footer every time
// @todo set it later via database
Replacer::page_header('LOGD - OOP');
$test = Database::factory();
//todo: implement routing
//Routing::init()->get_view();
//Render the first view
View::create('start')->render();