/** * Permanently removes a configuration value. * * @param string $key The short key or full variable name */ public function remove($key) { Config::remove($key); }
/** * Run the controller and parse the login template */ public function run() { $this->Template = new \BackendTemplate('be_install'); // Lock the tool if there are too many login attempts if (\Config::get('installCount') >= 3) { $this->Template->locked = true; $this->outputAndExit(); } $this->import('Files'); // Check whether the PHP process is allowed to write files if (!$this->Files->is_writeable(str_replace(TL_ROOT . DIRECTORY_SEPARATOR, '', __FILE__))) { $this->outputAndExit(); } $this->Template->lcfWriteable = true; // Create the local configuration files if not done yet $this->createLocalConfigurationFiles(); // Show the license text if (!\Config::get('licenseAccepted')) { $this->acceptLicense(); } // Log in the user if (\Input::post('FORM_SUBMIT') == 'tl_login') { $this->loginUser(); } // Auto-login on fresh installations if (\Config::get('installPassword') == '') { $this->setAuthCookie(); } elseif (!\Input::cookie('TL_INSTALL_AUTH') || $_SESSION['TL_INSTALL_AUTH'] == '' || \Input::cookie('TL_INSTALL_AUTH') != $_SESSION['TL_INSTALL_AUTH'] || $_SESSION['TL_INSTALL_EXPIRE'] < time()) { $this->Template->login = true; $this->outputAndExit(); } else { $this->setAuthCookie(); } // Store the install tool password if (\Input::post('FORM_SUBMIT') == 'tl_install') { $this->storeInstallToolPassword(); } // Require a password if (\Config::get('installPassword') == '') { $this->Template->setPassword = true; $this->outputAndExit(); } // Check the database connection $this->checkDatabaseConnection(); // Run the version-specific database updates $this->runDatabaseUpdates(); // Store the collation $this->storeCollation(); // Adjust the database tables $this->adjustDatabaseTables(); // Import the example website try { $this->importExampleWebsite(); } catch (ResponseException $e) { throw $e; // see #267 } catch (\Exception $e) { \Config::remove('exampleWebsite'); $this->Template->importException = true; error_log("\nPHP Fatal error: {$e->getMessage()} in {$e->getFile()} on line {$e->getLine()}\n{$e->getTraceAsString()}\n"); $this->outputAndExit(); } // Create an admin user $this->createAdminUser(); // Clear the cron timestamps so the jobs are run \Config::remove('cron_hourly'); \Config::remove('cron_daily'); \Config::remove('cron_weekly'); $this->outputAndExit(); }