public function database()
 {
     $config = PhpFile::readFromRelativePath('wp-config.php');
     $this->data["fields"] = array(array("name" => "host", "label" => "Hostname", "value" => $config->getConstant("DB_HOST"), "req" => true), array("name" => "user", "label" => "Username", "value" => $config->getConstant("DB_USER"), "req" => true), array("name" => "password", "label" => "Password", "value" => $config->getConstant("DB_PASSWORD"), "req" => true), array("name" => "database", "label" => "Database Name", "value" => $config->getConstant("DB_NAME"), "req" => true), array("name" => "table_prefix", "label" => "Table Prefix", "value" => $config->getVariable("table_prefix"), "req" => true));
     if ($last_post = $this->getLastPostTo("databaseSubmit")) {
         foreach ($this->data["fields"] as $i => $field) {
             $value = isset($last_post[$field["name"]]) ? $last_post[$field["name"]] : "";
             $this->data["fields"][$i]["value"] = $value;
         }
     }
     $this->data["form_path"] = $this->getActionUrl("databaseSubmit");
     $this->data["config"] = array("file" => $config, "constants" => array(), "variables" => array());
     foreach (array("DB_HOST", "DB_USER", "DB_PASSWORD", "DB_NAME") as $name) {
         $this->data["config"]["constants"][$name] = $config->getConstant($name);
     }
     foreach (array("table_prefix") as $name) {
         $this->data["config"]["variables"][$name] = $config->getVariable($name);
     }
     return $this->render("database");
 }