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


PHP Maintenance::addSiteAnnouncement方法代碼示例

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


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

示例1: maintenanceAction

 /**
  * Check action called in Maintenance template
  */
 public function maintenanceAction($h)
 {
     $maintenance = new Maintenance();
     $maintenance->getSiteAnnouncement($h);
     // check if we're viewing a debug file
     $debug_file = $h->cage->get->noPath('debug');
     if ($debug_file) {
         // skip the opening die() statement and echo debug file
         $debug_contents = file_get_contents(CACHE . 'debug_logs/' . $debug_file, NULL, NULL, 16);
         echo nl2br($debug_contents);
         exit;
     }
     // check if we're performing an action
     $action = $h->cage->get->testAlnumLines('action');
     if ($action == 'announcement') {
         $maintenance->addSiteAnnouncement($h);
     }
     if ($action == 'open') {
         $h->openCloseSite('open');
     }
     if ($action == 'close') {
         $h->openCloseSite('close');
     }
     if ($action == 'clear_all_cache') {
         $h->clearCache('db_cache', false);
         $h->clearCache('css_js_cache', false);
         $h->clearCache('rss_cache', false);
         $h->clearCache('html_cache', false);
         $h->clearCache('lang_cache', false);
         @unlink(BASE . 'cache/smartloader_cache.php');
         $h->pluginHook('maintenance_clear_all_cache');
         $h->messages[$h->lang('admin_maintenance_clear_all_cache_success')] = 'green';
     }
     if ($action == 'clear_db_cache') {
         $h->clearCache('db_cache');
     }
     if ($action == 'clear_css_js_cache') {
         $h->clearCache('css_js_cache');
     }
     if ($action == 'clear_rss_cache') {
         $h->clearCache('rss_cache');
     }
     if ($action == 'clear_html_cache') {
         $h->clearCache('html_cache');
     }
     if ($action == 'clear_lang_cache') {
         $h->clearCache('lang_cache');
     }
     if ($action == 'optimize') {
         $h->optimizeTables();
     }
     if ($action == 'export') {
         $h->exportDatabase();
     }
     if ($action == 'empty') {
         $h->emptyTable($h->cage->get->testAlnumLines('table'));
     }
     if ($action == 'drop') {
         $h->dropTable($h->cage->get->testAlnumLines('table'));
     }
     if ($action == 'remove_settings') {
         $h->removeSettings($h->cage->get->testAlnumLines('settings'));
     }
     if ($action == 'system_report') {
         $h->generateReport();
     }
     if ($action == 'delete_debugs') {
         $h->clearCache('debug_logs');
         $h->vars['debug_files'] = $h->getFiles(CACHE . 'debug_logs');
     }
     // get list of debug logs
     $h->vars['debug_files'] = $h->getFiles(CACHE . 'debug_logs');
 }
開發者ID:hotarucms,項目名稱:hotarucms,代碼行數:76,代碼來源:AdminPages.php


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