当前位置: 首页>>代码示例>>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;未经允许,请勿转载。