Beispiel #1
0
 $dbport = \H::input('dbport', "POST");
 $dbname = \H::input('dbname', "POST");
 $username = \H::input('dbusername', "POST");
 $password = \H::input('dbpassword', "POST");
 $prefix = \H::input('prefix', "POST");
 /**
  * We give the database config to the Install Class
  */
 \Lobby\Install::dbConfig(array("host" => $dbhost, "port" => $dbport, "dbname" => $dbname, "username" => $username, "password" => $password, "prefix" => $prefix));
 /**
  * First, check if prefix is valid
  * Check if connection to database can be established using the credentials given by the user
  */
 if ($prefix == "" || preg_match("/[^0-9,a-z,A-Z,\$,_]+/i", $prefix) != 0 || strlen($prefix) > 50) {
     ser("Error", "A Prefix should only contain basic Latin letters, digits 0-9, dollar, underscore and shouldn't exceed 50 characters. <a href='install.php?step=2'>Try Again</a>");
 } elseif (\Lobby\Install::checkDatabaseConnection() !== false) {
     /**
      * Make the Config File
      */
     \Lobby\Install::makeConfigFile();
     /**
      * Create Tables
      */
     if (\Lobby\Install::makeDatabase($prefix)) {
         sss("Success", "Database Tables and configuration file was successfully created.");
         /**
          * Enable app lEdit
          */
         \Lobby::$installed = true;
         \Lobby\DB::init();
         $App = new \Lobby\Apps("ledit");