本文整理汇总了PHP中Contao\Config::remove方法的典型用法代码示例。如果您正苦于以下问题:PHP Config::remove方法的具体用法?PHP Config::remove怎么用?PHP Config::remove使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Contao\Config
的用法示例。
在下文中一共展示了Config::remove方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: remove
/**
* Permanently removes a configuration value.
*
* @param string $key The short key or full variable name
*/
public function remove($key)
{
Config::remove($key);
}
示例2: run
/**
* 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();
}