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


PHP sfSessionStorage::shutdown方法代码示例

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


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

示例1: shutdown

 /**
  * Executes the shutdown procedure.
  *
  */
 public function shutdown()
 {
     parent::shutdown();
 }
开发者ID:cuongnv540,项目名称:jobeet,代码行数:8,代码来源:sfDatabaseSessionStorage.class.php

示例2: realpath

$_test_dir = realpath(dirname(__FILE__) . '/../../');
require_once $_test_dir . '/../lib/vendor/lime/lime.php';
sfConfig::set('sf_symfony_lib_dir', realpath($_test_dir . '/../lib'));
$t = new lime_test(8, new lime_output_color());
// initialize the storage
try {
    $storage = new sfSessionStorage();
    $t->pass('->__construct() does not throw an exception when not provided with options');
} catch (InvalidArgumentException $e) {
    $t->fail('->__construct() Startup failure');
}
$storage = new sfSessionStorage();
$t->ok($storage instanceof sfStorage, '->__construct() is an instance of sfStorage');
$storage->write('test', 123);
$t->is($storage->read('test'), 123, '->read() can read data that has been written to storage');
// regenerate()
$oldSessionData = 'foo:bar';
$key = md5($oldSessionData);
$storage->write($key, $oldSessionData);
$session_id = session_id();
$storage->regenerate(false);
$t->is($storage->read($key), $oldSessionData, '->regenerate(false) regenerated the session with a different session id - this class by default doesn\'t regen the id');
$t->isnt(session_id(), $session_id, '->regenerate(false) regenerated the session with a different session id');
$storage->regenerate(true);
$t->is($storage->read($key), $oldSessionData, '->regenerate(true) regenerated the session with a different session id and destroyed data');
$t->isnt(session_id(), $session_id, '->regenerate(true) regenerated the session with a different session id');
$storage->remove($key);
$t->is($storage->read($key), null, '->remove() removes data from the storage');
// shutdown the storage
$storage->shutdown();
开发者ID:mediasadc,项目名称:alba,代码行数:30,代码来源:sfSessionStorageTest.php


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