Ejemplo n.º 1
0
 if (!installer::connect($config)) {
     $content = render("invalid_db_info.html.php");
 } else {
     if (!installer::select_db($config)) {
         $content = render("missing_db.html.php");
     } else {
         if (!installer::db_empty($config)) {
             $content = render("db_not_empty.html.php");
         } else {
             if (!installer::unpack_var()) {
                 $content = oops("Unable to create files inside the <code>var</code> directory");
             } else {
                 if (!installer::unpack_sql($config)) {
                     $content = oops("Failed to create tables in your database:" . mysql_error());
                 } else {
                     if (!installer::create_database_config($config)) {
                         $content = oops("Couldn't create var/database.php");
                     } else {
                         try {
                             list($user, $password) = installer::create_admin($config);
                             installer::create_admin_session($config);
                             $content = render("success.html.php", array("user" => $user, "password" => $password));
                             installer::create_private_key($config);
                         } catch (Exception $e) {
                             $content = oops($e->getMessage());
                         }
                     }
                 }
             }
         }
     }
Ejemplo n.º 2
0
 public function finalize()
 {
     $data = Session::instance()->get('database_data');
     installer::create_database_config($data['username'], $data['password'], $data['hostname'], $data['database'], $data['table_prefix']);
     $password = Session::instance()->get('password');
     Session::instance()->destroy();
     $this->content = View::factory('finalize', array('password' => $password));
 }