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


PHP eZTranslatorManager::enableDynamicTranslations方法代码示例

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


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

示例1: eZCheckValidity

/**
 * Checks if the installation is valid and returns a module redirect if required.
 * If CheckValidity in SiteAccessSettings is false then no check is done.
 *
 * @deprecated As of 4.4, moved to index.php for now
 * @param array $siteBasics
 * @param eZURI $uri
 */
function eZCheckValidity( array &$siteBasics, eZURI $uri )
{
    eZDebug::writeStrict( 'Function eZCheckValidity() has been deprecated in 4.4', 'Deprecation' );
    $ini = eZINI::instance();
    $checkValidity = ( $ini->variable( "SiteAccessSettings", "CheckValidity" ) == "true" );
    $check = null;
    if ( $checkValidity )
    {
        $check = array( "module" => "setup",
                        'function' => 'init' );
        // Turn off some features that won't bee needed yet
//        $siteBasics['policy-check-required'] = false;
        $siteBasics['policy-check-omit-list'][] = 'setup';
        $siteBasics['url-translator-allowed'] = false;
        $siteBasics['show-page-layout'] = $ini->variable( 'SetupSettings', 'PageLayout' );
        $siteBasics['validity-check-required'] = true;
        $siteBasics['user-object-required'] = false;
        $siteBasics['session-required'] = false;
        $siteBasics['db-required'] = false;
        $siteBasics['no-cache-adviced'] = false;
        $siteBasics['site-design-override'] = $ini->variable( 'SetupSettings', 'OverrideSiteDesign' );
        $access = array( 'name' => 'setup',
                         'type' => eZSiteAccess::TYPE_URI );
        $access = eZSiteAccess::change( $access );

        eZTranslatorManager::enableDynamicTranslations();
    }
    return $check;
}
开发者ID:sushilbshinde,项目名称:ezpublish-study,代码行数:37,代码来源:pre_check.php

示例2: requestInit

 protected function requestInit()
 {
     if ($this->isInitialized) {
         return;
     }
     eZExecution::setCleanExit(false);
     $scriptStartTime = microtime(true);
     $GLOBALS['eZRedirection'] = false;
     $this->access = eZSiteAccess::current();
     eZDebug::setScriptStart($scriptStartTime);
     eZDebug::addTimingPoint("Script start");
     $this->uri = eZURI::instance(eZSys::requestURI());
     $GLOBALS['eZRequestedURI'] = $this->uri;
     // Be able to do general events early in process
     ezpEvent::getInstance()->notify('request/preinput', array($this->uri));
     // Initialize module loading
     $this->siteBasics['module-repositories'] = eZModule::activeModuleRepositories();
     eZModule::setGlobalPathList($this->siteBasics['module-repositories']);
     // make sure we get a new $ini instance now that it has been reset
     $ini = eZINI::instance();
     // start: eZCheckValidity
     // pre check, setup wizard related so needs to be before session/db init
     // TODO: Move validity check in the constructor? Setup is not meant to be launched at each (sub)request is it?
     if ($ini->variable('SiteAccessSettings', 'CheckValidity') === 'true') {
         $this->check = array('module' => 'setup', 'function' => 'init');
         // Turn off some features that won't bee needed yet
         $this->siteBasics['policy-check-omit-list'][] = 'setup';
         $this->siteBasics['show-page-layout'] = $ini->variable('SetupSettings', 'PageLayout');
         $this->siteBasics['validity-check-required'] = true;
         $this->siteBasics['session-required'] = $this->siteBasics['user-object-required'] = false;
         $this->siteBasics['db-required'] = $this->siteBasics['no-cache-adviced'] = $this->siteBasics['url-translator-allowed'] = false;
         $this->siteBasics['site-design-override'] = $ini->variable('SetupSettings', 'OverrideSiteDesign');
         $this->access = eZSiteAccess::change(array('name' => 'setup', 'type' => eZSiteAccess::TYPE_URI));
         eZTranslatorManager::enableDynamicTranslations();
     }
     // stop: eZCheckValidity
     if ($this->siteBasics['session-required']) {
         // Check if this should be run in a cronjob
         if ($ini->variable('Session', 'BasketCleanup') !== 'cronjob') {
             eZSession::addCallback('destroy_pre', function (eZDBInterface $db, $key, $escapedKey) {
                 $basket = eZBasket::fetch($key);
                 if ($basket instanceof eZBasket) {
                     $basket->remove();
                 }
             });
             eZSession::addCallback('gc_pre', function (eZDBInterface $db, $time) {
                 eZBasket::cleanupExpired($time);
             });
             eZSession::addCallback('cleanup_pre', function (eZDBInterface $db) {
                 eZBasket::cleanup();
             });
         }
         // addCallBack to update session id for shop basket on session regenerate
         eZSession::addCallback('regenerate_post', function (eZDBInterface $db, $escNewKey, $escOldKey) {
             $db->query("UPDATE ezbasket SET session_id='{$escNewKey}' WHERE session_id='{$escOldKey}'");
         });
         // TODO: Session starting should be made only once in the constructor
         $this->sessionInit();
     }
     // if $this->siteBasics['db-required'], open a db connection and check that db is connected
     if ($this->siteBasics['db-required'] && !eZDB::instance()->isConnected()) {
         $this->warningList[] = array('error' => array('type' => 'kernel', 'number' => eZError::KERNEL_NO_DB_CONNECTION), 'text' => 'No database connection could be made, the system might not behave properly.');
     }
     // eZCheckUser: pre check, RequireUserLogin & FORCE_LOGIN related so needs to be after session init
     if (!isset($this->check)) {
         $this->check = eZUserLoginHandler::preCheck($this->siteBasics, $this->uri);
     }
     ezpEvent::getInstance()->notify('request/input', array($this->uri));
     // Initialize with locale settings
     // TODO: Move to constructor? Is it relevant to init the locale/charset for each (sub)requests?
     $this->languageCode = eZLocale::instance()->httpLocaleCode();
     $phpLocale = trim($ini->variable('RegionalSettings', 'SystemLocale'));
     if ($phpLocale != '') {
         setlocale(LC_ALL, explode(',', $phpLocale));
     }
     $this->httpCharset = eZTextCodec::httpCharset();
     // TODO: are these parameters supposed to vary across potential sub-requests?
     $this->site = array('title' => $ini->variable('SiteSettings', 'SiteName'), 'design' => $ini->variable('DesignSettings', 'SiteDesign'), 'http_equiv' => array('Content-Type' => 'text/html; charset=' . $this->httpCharset, 'Content-language' => $this->languageCode));
     // Read role settings
     $this->siteBasics['policy-check-omit-list'] = array_merge($this->siteBasics['policy-check-omit-list'], $ini->variable('RoleSettings', 'PolicyOmitList'));
     $this->isInitialized = true;
 }
开发者ID:EVE-Corp-Center,项目名称:ECC-Website,代码行数:82,代码来源:ezpkernelweb.php

示例3: array

// make sure we get a new $ini instance now that it has been reset
$ini = eZINI::instance();
// start: eZCheckValidity
// pre check, setup wizard related so needs to be before session/db init
if ($ini->variable('SiteAccessSettings', 'CheckValidity') === 'true') {
    $check = array('module' => 'setup', 'function' => 'init');
    // Turn off some features that won't bee needed yet
    $siteBasics['policy-check-omit-list'][] = 'setup';
    $siteBasics['show-page-layout'] = $ini->variable('SetupSettings', 'PageLayout');
    $siteBasics['validity-check-required'] = true;
    $siteBasics['session-required'] = $siteBasics['user-object-required'] = false;
    $siteBasics['db-required'] = $siteBasics['no-cache-adviced'] = $siteBasics['url-translator-allowed'] = false;
    $siteBasics['site-design-override'] = $ini->variable('SetupSettings', 'OverrideSiteDesign');
    $access = array('name' => 'setup', 'type' => eZSiteAccess::TYPE_URI);
    $access = eZSiteAccess::change($access);
    eZTranslatorManager::enableDynamicTranslations();
}
// stop: eZCheckValidity
if ($sessionRequired) {
    // Check if this should be run in a cronjob
    if ($ini->variable('Session', 'BasketCleanup') !== 'cronjob') {
        // Functions for session to make sure baskets are cleaned up
        function eZSessionBasketDestroy($db, $key, $escapedKey)
        {
            $basket = eZBasket::fetch($key);
            if (is_object($basket)) {
                $basket->remove();
            }
        }
        function eZSessionBasketGarbageCollector($db, $time)
        {
开发者ID:legende91,项目名称:ez,代码行数:31,代码来源:index.php


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