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


PHP System::disableModule方法代碼示例

本文整理匯總了PHP中Contao\System::disableModule方法的典型用法代碼示例。如果您正苦於以下問題:PHP System::disableModule方法的具體用法?PHP System::disableModule怎麽用?PHP System::disableModule使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Contao\System的用法示例。


在下文中一共展示了System::disableModule方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: update300

 /**
  * Version 3.0.0 update
  */
 protected function update300()
 {
     // Step 1: database structure
     if (!$this->Database->tableExists('tl_files')) {
         $this->enableMaintenanceMode();
         if (\Input::post('FORM_SUBMIT') == 'tl_30update') {
             $this->import('Database\\Updater', 'Updater');
             $this->Updater->run300Update();
             $this->reload();
         }
         // Disable the tasks extension (see #4907)
         if (is_dir(TL_ROOT . '/system/modules/tasks')) {
             \System::disableModule('tasks');
         }
         // Reset the upload path if it has been changed already (see #5560 and #5870)
         if (\Config::get('uploadPath') == 'files' && is_dir(TL_ROOT . '/tl_files')) {
             \Config::set('uploadPath', 'tl_files');
             \Config::persist('uploadPath', 'tl_files');
         }
         // Show a warning if the upload folder does not exist (see #4626)
         if (!is_dir(TL_ROOT . '/' . \Config::get('uploadPath'))) {
             $this->Template->filesWarning = sprintf($GLOBALS['TL_LANG']['tl_install']['filesWarning'], '<a href="https://gist.github.com/3304014" target="_blank">https://gist.github.com/3304014</a>');
         }
         $this->Template->step = 1;
         $this->Template->is30Update = true;
         $this->outputAndExit();
     }
     $objRow = $this->Database->query("SELECT COUNT(*) AS count FROM tl_files");
     // Step 2: scan the upload folder if it is not empty (see #6061)
     if ($objRow->count < 1 && count(scan(TL_ROOT . '/' . \Config::get('uploadPath'))) > 0) {
         $this->enableMaintenanceMode();
         if (\Input::post('FORM_SUBMIT') == 'tl_30update') {
             $this->import('Database\\Updater', 'Updater');
             $this->Updater->scanUploadFolder();
             \Config::persist('checkFileTree', true);
             $this->reload();
         }
         $this->Template->step = 2;
         $this->Template->is30Update = true;
         $this->outputAndExit();
     } elseif (\Config::get('checkFileTree')) {
         $this->enableMaintenanceMode();
         if (\Input::post('FORM_SUBMIT') == 'tl_30update') {
             $this->import('Database\\Updater', 'Updater');
             $this->Updater->updateFileTreeFields();
             \Config::persist('checkFileTree', false);
             $this->reload();
         }
         $this->Template->step = 3;
         $this->Template->is30Update = true;
         $this->outputAndExit();
     }
 }
開發者ID:eakcantey,項目名稱:core-bundle,代碼行數:56,代碼來源:BackendInstall.php


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