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


PHP ezcPersistentSessionInstance::set方法代码示例

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


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

示例1: testSetWithIdentifierMixed

 public function testSetWithIdentifierMixed()
 {
     $session = $this->getSession();
     $sessionDecorator = $this->getSessionDecorator($session);
     ezcPersistentSessionInstance::set($session, 'session');
     ezcPersistentSessionInstance::set($sessionDecorator, 'decorator');
     $this->assertSame($session, ezcPersistentSessionInstance::get('session'));
     $this->assertSame($sessionDecorator, ezcPersistentSessionInstance::get('decorator'));
 }
开发者ID:bmdevel,项目名称:ezc,代码行数:9,代码来源:instance_test.php

示例2: define

    ezcBase::autoload($className);
    @(include SITE_ROOT . '/app/model/' . $className . '.php');
}
define('SITE_ROOT', dirname(__FILE__) . '/..');
define('APP_ROOT', dirname(__FILE__) . '/../app');
$cfg = ezcConfigurationManager::getInstance();
$cfg->init('ezcConfigurationIniReader', SITE_ROOT . '/settings');
define('DIR_DEFINITIONS', SITE_ROOT . '/app/model/definitions');
ezcBase::addClassRepository('.', SITE_ROOT . '/core/autoloads');
$driver = $cfg->getSetting('config', 'Database', 'Driver');
$host = $cfg->getSetting('config', 'Database', 'Host');
$port = $cfg->getSetting('config', 'Database', 'Port');
$username = $cfg->getSetting('config', 'Database', 'User');
$password = $cfg->getSetting('config', 'Database', 'Password');
$database = $cfg->getSetting('config', 'Database', 'Database');
$dsn = $driver . '://' . $username . ':' . $password . '@' . $host . '/' . $database;
define('DB_DSN', $dsn);
$dbInstance = ezcDbFactory::create(DB_DSN);
ezcDbInstance::set($dbInstance);
@(include_once SITE_ROOT . '/settings/log.php');
/*
$dbSession = new ezcPersistentSession( $dbInstance,
        new ezcPersistentCacheManager( new ezcPersistentCodeManager( DIR_DEFINITIONS ) ) );
*/
$dbSession = new ezcPersistentSession($dbInstance, new ezcPersistentCacheManager(new JFPersistentDefinitionManager()));
$identityMap = new ezcPersistentBasicIdentityMap($dbSession->definitionManager);
$session = new ezcPersistentSessionIdentityDecorator($dbSession, $identityMap);
ezcPersistentSessionInstance::set($session);
// set default session
// retrieve the session
//$session = ezcPersistentSessionInstance::get();
开发者ID:jpic,项目名称:Jetfuel,代码行数:31,代码来源:common.php

示例3: testResetWithIdentifiers

 public function testResetWithIdentifiers()
 {
     $manager = new ezcPersistentCodeManager(dirname(__FILE__) . "/PersistentObject/tests/data/");
     $session1 = new ezcPersistentSession(ezcDbInstance::get(), $manager);
     $session2 = new ezcPersistentSession(ezcDbInstance::get(), $manager);
     ezcPersistentSessionInstance::set($session1, 'first');
     ezcPersistentSessionInstance::set($session2, 'secondary');
     $this->assertSame($session1, ezcPersistentSessionInstance::get('first'));
     $this->assertSame($session2, ezcPersistentSessionInstance::get('secondary'));
     ezcPersistentSessionInstance::reset();
     try {
         ezcPersistentSessionInstance::get('first');
         $this->fail("Getting a non existent instance did not fail.");
     } catch (ezcPersistentSessionNotFoundException $e) {
     }
     try {
         ezcPersistentSessionInstance::get('secondary');
         $this->fail("Getting a non existent instance did not fail.");
     } catch (ezcPersistentSessionNotFoundException $e) {
     }
 }
开发者ID:jacomyma,项目名称:GEXF-Atlas,代码行数:21,代码来源:persistent_session_instance_test.php


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