FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
framework/tests/memcache.php at master · libo5050/framework · GitHub
libo5050
/
framework
Public
forked from
whcyc2002/swoole_framework
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
framework
/
tests
/
memcache.php
Copy path
More file actions
More file actions
Latest commit
History
History
History
31 lines (28 loc) · 1.14 KB
Breadcrumbs
framework
/
tests
/
memcache.php
Copy path
File metadata and controls
31 lines (28 loc) · 1.14 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<?php
define
(
'
DEBUG
'
,
'
on
'
);
define
(
'
WEBPATH
'
,
realpath
(
__DIR__
.
'
/..
'
));
//包含框架入口文件
require
WEBPATH
.
'
/libs/lib_config.php
'
;
$
mc
=
new
Swoole
\
Coroutine
\
Memcache
();
$
mc
->
addServer
(
'
127.0.0.1
'
,
11211
);
Swoole
\Coroutine::
create
(
function
()
use
(
$
mc
) {
echo
"
Memcached
\n"
;
// var_dump(Swoole::$php->cache->set('key', 'value', 3000));
// var_dump(Swoole::$php->cache->set('rango', 'hello', 3000));
// var_dump(Swoole::$php->cache->add('counter', 0));
// var_dump(Swoole::$php->cache->get('rango'));
// var_dump(Swoole::$php->cache->increment('counter', 10));
// var_dump(Swoole::$php->cache->getMulti(['world5', 'world4']));
// var_dump(Swoole::$php->cache->getStats());
// return;
echo
"
Coro\Memcached
\n"
;
// $value = $mc->add('world5', 'php', 0);
// var_dump($mc->set('world5', 'java', 9999));
// var_dump($mc->getMulti(['world5', 'world4']));
// var_dump($mc->getStats());
// var_dump($mc->delete('key'));
// $value = $mc->set("key", 'value', 3000);
// var_dump($mc->increment('counter', 10));
// var_dump($mc->decrement('counter', 10));
var_dump
(
$
mc
->
replace
(
'
rango
'
,
'
swoole
'
));
});
Back
|
FazBrowse Home
|
New Git URL