當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Config::remove方法代碼示例

本文整理匯總了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);
 }
開發者ID:jamesdevine,項目名稱:core-bundle,代碼行數:9,代碼來源:ConfigAdapter.php

示例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();
 }
開發者ID:eakcantey,項目名稱:core-bundle,代碼行數:73,代碼來源:BackendInstall.php


注:本文中的Contao\Config::remove方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。