Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
X
X Lib
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
XLibs
X Lib
Commits
8ced1ffd
Commit
8ced1ffd
authored
Jun 23, 2016
by
Alex Ne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Кэширование Memcache
parent
2500c05d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
0 deletions
+28
-0
Cache.php
Memcache/Cache.php
+28
-0
No files found.
Memcache/Cache.php
0 → 100644
View file @
8ced1ffd
<?php
namespace
X\Memcache
;
class
Cache
extends
\Memcache
{
protected
$compression
=
false
;
protected
$prefix
;
protected
$connect
=
false
;
function
__construct
(
$prefix
,
$host
=
"localhost"
,
$port
=
11211
,
$compression
=
false
)
{
$this
->
prefix
=
$prefix
;
$this
->
compression
=
$compression
;
if
(
$this
->
connect
(
$host
,
$port
)
)
$this
->
connect
=
true
;
}
public
function
set
(
$key
,
$value
,
$expire
=
240
)
{
$key
=
$this
->
prefix
.
"-"
.
$key
;
return
parent
::
set
(
$key
,
$value
,
$this
->
compression
,
$expire
);
}
public
function
get
(
$key
)
{
$key
=
$this
->
prefix
.
"-"
.
$key
;
return
parent
::
get
(
$key
,
$this
->
compression
);
}
}
?>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment