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


PHP eZSession::getHandlerInstance方法代码示例

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


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

示例1: removeSessionData

 /**
  * Remove session data for user \a $userID.
  * @todo should use eZSession api (needs to be created) so
  *       callbacks (like preference / basket..) is cleared as well.
  *
  * @params int $userID
  */
 static function removeSessionData($userID)
 {
     eZUser::clearSessionCache();
     eZSession::getHandlerInstance()->deleteByUserIDs(array($userID));
 }
开发者ID:brookinsconsulting,项目名称:ezecosystem,代码行数:12,代码来源:ezuser.php

示例2: cleanup

if ( $clean['session'] )
{
    if ( !eZSession::getHandlerInstance()->hasBackendAccess() )
    {
        $cli->output( "Could not remove sessions, current session handler does not support session cleanup (not backend based)." );
    }
    else
    {
        $cli->output( "Removing all sessions" );
        eZSession::cleanup();
    }
}

if ( $clean['expired_session'] )
{
    if ( !eZSession::getHandlerInstance()->hasBackendAccess() )
    {
        $cli->output( "Could not remove expired sessions, current session handler does not support session garbage collection (not backend based)." );
    }
    else
    {
        $cli->output( "Removing expired sessions,", false );
        eZSession::garbageCollector();
        $activeCount = eZSession::countActive();
        $cli->output( " " . $cli->stylize( 'emphasize', $activeCount ) . " left" );
    }
}

if ( $clean['preferences'] )
{
    $cli->output( "Removing all preferences" );
开发者ID:sushilbshinde,项目名称:ezpublish-study,代码行数:31,代码来源:cleanup.php

示例3: sessionInit

 /**
  * Initializes the session. If running, through Symfony the session
  * parameters from Symfony override the session parameter from eZ Publish.
  */
 protected function sessionInit()
 {
     if (!isset($this->settings['session']) || !$this->settings['session']['configured']) {
         // running without Symfony2 or session is not configured
         // we keep the historic behaviour
         $ini = eZINI::instance();
         if ($ini->variable('Session', 'ForceStart') === 'enabled') {
             eZSession::start();
         } else {
             eZSession::lazyStart();
         }
     } else {
         $sfHandler = new ezpSessionHandlerSymfony($this->settings['session']['has_previous'] || $this->settings['session']['started']);
         $sfHandler->setStorage($this->settings['session']['storage']);
         eZSession::init($this->settings['session']['name'], $this->settings['session']['started'], $this->settings['session']['namespace'], $sfHandler);
     }
     // let session specify if db is required
     $this->siteBasics['db-required'] = eZSession::getHandlerInstance()->dbRequired();
 }
开发者ID:EVE-Corp-Center,项目名称:ECC-Website,代码行数:23,代码来源:ezpkernelweb.php

示例4: eZSessionBasketRegenerate

        eZSession::addCallback('gc_pre', 'eZSessionBasketGarbageCollector');
        eZSession::addCallback('cleanup_pre', 'eZSessionBasketCleanup');
    }
    // addCallBack to update session id for shop basket on session regenerate
    function eZSessionBasketRegenerate($db, $escNewKey, $escOldKey, $escUserID)
    {
        $db->query("UPDATE ezbasket SET session_id='{$escNewKey}' WHERE session_id='{$escOldKey}'");
    }
    eZSession::addCallback('regenerate_post', 'eZSessionBasketRegenerate');
    if ($ini->variable('Session', 'ForceStart') === 'enabled') {
        eZSession::start();
    } else {
        eZSession::lazyStart();
    }
    // let session specify if db is required
    $dbRequired = eZSession::getHandlerInstance()->dbRequired();
}
// if $dbRequired, open a db connection and check that db is connected
if ($dbRequired && !eZDB::instance()->isConnected()) {
    $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($check)) {
    $check = eZUserLoginHandler::preCheck($siteBasics, $uri);
}
/**
 * Check for activating Debug by user ID (Final checking. The first was in eZDebug::updateSettings())
 * @uses eZUser::instance() So needs to be executed after eZSession::start()|lazyStart()
 */
eZDebug::checkDebugByUser();
ezpEvent::getInstance()->notify('request/input', array($uri));
开发者ID:legende91,项目名称:ez,代码行数:31,代码来源:index.php

示例5: foreach

                $gcSessionsCompleted = eZSession::garbageCollector();
                $sessionsRemoved = true;
            } else {
                if ($module->isCurrentAction('RemoveSelectedSessions')) {
                    if ($userID) {
                        if ($http->hasPostVariable('SessionKeyArray')) {
                            $sessionKeyArray = $http->postVariable('SessionKeyArray');
                            foreach ($sessionKeyArray as $sessionKeyItem) {
                                eZSession::getHandlerInstance()->destroy($sessionKeyItem);
                            }
                        }
                    } else {
                        if ($http->hasPostVariable('UserIDArray')) {
                            $userIDArray = $http->postVariable('UserIDArray');
                            if (count($userIDArray) > 0) {
                                eZSession::getHandlerInstance()->deleteByUserIDs($userIDArray);
                            }
                        }
                    }
                }
            }
        }
    }
}
$viewParameters = $Params['UserParameters'];
if (isset($viewParameters['offset']) and is_numeric($viewParameters['offset'])) {
    $param['offset'] = $viewParameters['offset'];
} else {
    $param['offset'] = 0;
    $viewParameters['offset'] = 0;
}
开发者ID:CG77,项目名称:ezpublish-legacy,代码行数:31,代码来源:session.php

示例6: cleanup

        $params['database'] = $dbName;
    }
    $db = eZDB::instance($dbImpl, $params, true);
    eZDB::setInstance($db);
}
$db->setIsSQLOutputEnabled($showSQL);
if ($clean['session']) {
    if (!eZSession::getHandlerInstance()->usesDatabaseTable()) {
        $cli->output("Could not remove sessions, current session handler does not support session cleanup (not backend based).");
    } else {
        $cli->output("Removing all sessions");
        eZSession::cleanup();
    }
}
if ($clean['expired_session']) {
    if (!eZSession::getHandlerInstance()->usesDatabaseTable()) {
        $cli->output("Could not remove expired sessions, current session handler does not support session garbage collection (not backend based).");
    } else {
        $cli->output("Removing expired sessions,", false);
        eZSession::garbageCollector();
        $activeCount = eZSession::countActive();
        $cli->output(" " . $cli->stylize('emphasize', $activeCount) . " left");
    }
}
if ($clean['preferences']) {
    $cli->output("Removing all preferences");
    eZPreferences::cleanup();
}
if ($clean['browse']) {
    $cli->output("Removing all recent items and bookmarks for browse page");
    eZContentBrowseRecent::cleanup();
开发者ID:runelangseid,项目名称:ezpublish,代码行数:31,代码来源:cleanup.php


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