~ubuntu-branches/ubuntu/vivid/php-memcache/vivid-proposed

« back to all changes in this revision

Viewing changes to memcache-3.0.8/tests/053.phpt

  • Committer: Package Import Robot
  • Author(s): Sergey B Kirpichev
  • Date: 2013-04-19 13:23:26 UTC
  • mfrom: (1.1.8) (2.1.16 sid)
  • Revision ID: package-import@ubuntu.com-20130419132326-4o0g4jrgcrg832nd
ImportedĀ UpstreamĀ versionĀ 3.0.8

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
--TEST--
 
2
ini_set('session.save_handler') with unix domain socket
 
3
--SKIPIF--
 
4
<?php include 'connect.inc'; if (!MEMCACHE_HAVE_SESSION) print 'skip not compiled with session support'; if (empty($domainsocket)) print 'skip $domainsocket not set'; ?>
 
5
--FILE--
 
6
<?php
 
7
 
 
8
include 'connect.inc';
 
9
 
 
10
$memcache = new Memcache();
 
11
$memcache->connect($domainsocket, 0);
 
12
 
 
13
$session_save_path = ",  $domainsocket:0?weight=1, ";
 
14
ini_set('session.save_handler', 'memcache');
 
15
ini_set('session.save_path', $session_save_path);
 
16
 
 
17
$result1 = session_start();
 
18
$id = session_id();
 
19
 
 
20
$_SESSION['_test_key'] = 'Test';
 
21
 
 
22
$result2 = $memcache->get($id);
 
23
session_write_close();
 
24
$result3 = $memcache->get($id);
 
25
 
 
26
// Test destroy
 
27
session_start();
 
28
$result4 = session_destroy();
 
29
$result5 = $memcache->get($id);
 
30
 
 
31
var_dump($result1);
 
32
var_dump($id);
 
33
var_dump($result2);
 
34
var_dump($result3);
 
35
var_dump($result4);
 
36
var_dump($result5);
 
37
 
 
38
?>
 
39
--EXPECTF--
 
40
bool(true)
 
41
string(%d) "%s"
 
42
bool(false)
 
43
string(%d) "%s"
 
44
bool(true)
 
45
bool(false)
 
 
b'\\ No newline at end of file'