当前位置: 首页>>代码示例>>PHP>>正文


PHP Settings::isMaintenanceModeEnabled方法代码示例

本文整理汇总了PHP中thebuggenie\core\framework\Settings::isMaintenanceModeEnabled方法的典型用法代码示例。如果您正苦于以下问题:PHP Settings::isMaintenanceModeEnabled方法的具体用法?PHP Settings::isMaintenanceModeEnabled怎么用?PHP Settings::isMaintenanceModeEnabled使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在thebuggenie\core\framework\Settings的用法示例。


在下文中一共展示了Settings::isMaintenanceModeEnabled方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: performAction


//.........这里部分代码省略.........
                 // If the action returns *any* output, we're done, and collect the
                 // output to a variable to be outputted in context later
                 $content = ob_get_clean();
                 Logging::log('...done');
             } elseif (!$action_retval) {
                 // If the action doesn't return any output (which it usually doesn't)
                 // we continue on to rendering the template file for that specific action
                 Logging::log('...done');
                 Logging::log('Displaying template');
                 // Check to see if we have a translated version of the template
                 if ($method == 'notFound' && $module == 'main') {
                     $templateName = $templatePath . self::getResponse()->getTemplate();
                 } elseif (!self::isReadySetup() || ($templateName = self::getI18n()->hasTranslatedTemplate(self::getResponse()->getTemplate())) === false) {
                     // Check to see if any modules provide an alternate template
                     $event = Event::createNew('core', "self::performAction::renderTemplate")->triggerUntilProcessed(array('class' => $actionClassName, 'action' => $actionToRunName));
                     if ($event->isProcessed()) {
                         $templateName = $event->getReturnValue();
                     }
                     // Check to see if the template has been changed, and whether it's in a
                     // different module, specified by "module/templatename"
                     if (mb_strpos(self::getResponse()->getTemplate(), '/')) {
                         $newPath = explode('/', self::getResponse()->getTemplate());
                         $templateName = self::isInternalModule($newPath[0]) ? THEBUGGENIE_INTERNAL_MODULES_PATH : THEBUGGENIE_MODULES_PATH;
                         $templateName .= $newPath[0] . DS . 'templates' . DS . $newPath[1] . '.' . self::getRequest()->getRequestedFormat() . '.php';
                     } else {
                         $templateName = $templatePath . self::getResponse()->getTemplate();
                     }
                 }
                 // Check to see if the template exists and throw an exception otherwise
                 if (!isset($templateName) || !file_exists($templateName)) {
                     Logging::log('The template file for the ' . $method . ' action ("' . self::getResponse()->getTemplate() . '") does not exist', 'core', Logging::LEVEL_FATAL);
                     Logging::log('Trying to load file "' . $templateName . '"', 'core', Logging::LEVEL_FATAL);
                     throw new exceptions\TemplateNotFoundException('The template file for the ' . $method . ' action ("' . self::getResponse()->getTemplate() . '") does not exist');
                 }
                 self::loadLibrary('common');
                 // Present template for current action
                 ActionComponent::presentTemplate($templateName, $action->getParameterHolder());
                 $content = ob_get_clean();
                 Logging::log('...completed');
             }
         } elseif (self::$_debug_mode) {
             $time = explode(' ', microtime());
             $posttime = $time[1] + $time[0];
             self::visitPartial($visited_templatename, $posttime - $pretime);
         }
         Logging::log('rendering final content');
         // Set core layout path
         self::getResponse()->setLayoutPath(THEBUGGENIE_CORE_PATH . 'templates');
         // Trigger event for rendering (so layout path can be overwritten)
         \thebuggenie\core\framework\Event::createNew('core', '\\thebuggenie\\core\\framework\\Context::renderBegins')->trigger();
         if (Settings::isMaintenanceModeEnabled() && !mb_strstr(self::getRouting()->getCurrentRouteName(), 'configure')) {
             if (!file_exists(self::getResponse()->getLayoutPath() . DS . 'offline.inc.php')) {
                 throw new exceptions\TemplateNotFoundException('Can not find offline mode template');
             }
             ob_start('mb_output_handler');
             ob_implicit_flush(0);
             ActionComponent::presentTemplate(self::getResponse()->getLayoutPath() . DS . 'offline.inc.php');
             $content = ob_get_clean();
         }
         // Render output in correct order
         self::getResponse()->renderHeaders();
         if (self::getResponse()->getDecoration() == Response::DECORATE_DEFAULT && !self::getRequest()->isAjaxCall()) {
             if (!file_exists(self::getResponse()->getLayoutPath() . DS . 'layout.php')) {
                 throw new exceptions\TemplateNotFoundException('Can not find layout template');
             }
             ob_start('mb_output_handler');
             ob_implicit_flush(0);
             $layoutproperties = self::setupLayoutProperties($content);
             ActionComponent::presentTemplate(self::getResponse()->getLayoutPath() . DS . 'layout.php', $layoutproperties);
             ob_flush();
         } else {
             // Render header template if any, and store the output in a variable
             if (!self::getRequest()->isAjaxCall() && self::getResponse()->doDecorateHeader()) {
                 Logging::log('decorating with header');
                 if (!file_exists(self::getResponse()->getHeaderDecoration())) {
                     throw new exceptions\TemplateNotFoundException('Can not find header decoration: ' . self::getResponse()->getHeaderDecoration());
                 }
                 ActionComponent::presentTemplate(self::getResponse()->getHeaderDecoration());
             }
             echo $content;
             // Trigger event for ending the rendering
             \thebuggenie\core\framework\Event::createNew('core', '\\thebuggenie\\core\\framework\\Context::renderEnds')->trigger();
             Logging::log('...done (rendering content)');
             // Render footer template if any
             if (!self::getRequest()->isAjaxCall() && self::getResponse()->doDecorateFooter()) {
                 Logging::log('decorating with footer');
                 if (!file_exists(self::getResponse()->getFooterDecoration())) {
                     throw new exceptions\TemplateNotFoundException('Can not find footer decoration: ' . self::getResponse()->getFooterDecoration());
                 }
                 ActionComponent::presentTemplate(self::getResponse()->getFooterDecoration());
             }
             Logging::log('...done');
         }
         Logging::log('done (rendering final content)');
         return true;
     } else {
         Logging::log("Cannot find the method {$actionToRunName}() in class {$actionClassName}.", 'core', Logging::LEVEL_FATAL);
         throw new exceptions\ActionNotFoundException("Cannot find the method {$actionToRunName}() in class {$actionClassName}. Make sure the method exists.");
     }
 }
开发者ID:JonathanRH,项目名称:thebuggenie,代码行数:101,代码来源:Context.php

示例2: runStatus

 public function runStatus(framework\Request $request)
 {
     $status_info = array('api_version' => $this->getApiVersion(), 'version' => framework\Settings::getVersion(), 'version_long' => framework\Settings::getVersion(true, true), 'site_name' => framework\Settings::getSiteHeaderName(), 'host' => framework\Settings::getURLhost(), 'urls' => array('site' => framework\Settings::getHeaderLink() == '' ? framework\Context::getWebroot() : framework\Settings::getHeaderLink(), 'logo' => framework\Settings::getHeaderIconURL(), 'icon' => framework\Settings::getFaviconURL()), 'online' => !(bool) framework\Settings::isMaintenanceModeEnabled());
     if (framework\Settings::hasMaintenanceMessage()) {
         $status_info['maintenance_msg'] = framework\Settings::getMaintenanceMessage();
     }
     $this->status_info = $status_info;
 }
开发者ID:thebuggenie,项目名称:module-api,代码行数:8,代码来源:Main.php

示例3: image_tag

$link = \thebuggenie\core\framework\Settings::getHeaderLink() == '' ? \thebuggenie\core\framework\Context::getWebroot() : \thebuggenie\core\framework\Settings::getHeaderLink();
?>
        <a class="logo" href="<?php 
print $link;
?>
"><?php 
echo image_tag(\thebuggenie\core\framework\Settings::getHeaderIconUrl(), array('style' => 'max-height: 24px;'), \thebuggenie\core\framework\Settings::isUsingCustomHeaderIcon());
?>
</a>
        <div class="logo_name"><?php 
echo \thebuggenie\core\framework\Settings::getSiteHeaderName();
?>
</div>
    </div>
    <?php 
if (!\thebuggenie\core\framework\Settings::isMaintenanceModeEnabled()) {
    ?>
        <div id="topmenu-container">
            <?php 
    if (\thebuggenie\core\framework\Event::createNew('core', 'header_mainmenu_decider')->trigger()->getReturnValue() !== false) {
        ?>
                <?php 
        require THEBUGGENIE_CORE_PATH . 'templates/headermainmenu.inc.php';
        ?>
            <?php 
    }
    ?>
            <?php 
    require THEBUGGENIE_CORE_PATH . 'templates/headerusermenu.inc.php';
    ?>
        </div>
开发者ID:founderio,项目名称:thebuggenie,代码行数:31,代码来源:headertop.inc.php

示例4: __

                    <option value=0<?php 
    if (!\thebuggenie\core\framework\Settings::isMaintenanceModeEnabled()) {
        ?>
 selected<?php 
    }
    ?>
><?php 
    echo __('No');
    ?>
</option>
                </select>
            <?php 
} else {
    ?>
                <?php 
    echo \thebuggenie\core\framework\Settings::isMaintenanceModeEnabled() ? __('Yes') : __('No');
    ?>
            <?php 
}
?>

            <?php 
echo config_explanation(__('In maintenance mode, access to The Bug Genie will be disabled, except for the Configuration pages. This allows you to perform upgrades and other maintance without interruption. Please remember that if you log out, you will be unable to log back in again whilst maintenace mode is enabled.'));
?>
        </td>
    </tr>
    <tr>
        <td colspan="2">
            <br>
            <label for="offline_msg"><?php 
echo __('Maintenance mode message');
开发者ID:founderio,项目名称:thebuggenie,代码行数:31,代码来源:_offline.inc.php


注:本文中的thebuggenie\core\framework\Settings::isMaintenanceModeEnabled方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。