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
7247d92b
Commit
7247d92b
authored
Jun 24, 2016
by
Alex Ne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Кеширование.
parent
8ced1ffd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
0 deletions
+28
-0
Memcache.php
Cache/Memcache.php
+28
-0
No files found.
Memcache/C
ache.php
→
Cache/Memc
ache.php
View file @
7247d92b
<?php
namespace
X\
Memc
ache
;
namespace
X\
C
ache
;
class
Cache
extends
\M
emcache
class
Memcache
extends
\m
emcache
{
protected
$compression
=
false
;
protected
$prefix
;
protected
$
connect
=
false
;
protected
$
mcache
=
false
;
function
__construct
(
$prefix
,
$host
=
"localhost"
,
$port
=
11211
,
$compression
=
false
)
{
$this
->
prefix
=
$prefix
;
$this
->
compression
=
$compression
;
if
(
$this
->
connect
(
$host
,
$port
)
)
$this
->
connect
=
true
;
$this
->
connect
(
$host
,
$port
)
;
}
public
function
set
(
$key
,
$value
,
$expire
=
240
)
{
$key
=
$this
->
prefix
.
"-"
.
$key
;
return
parent
::
set
(
$key
,
$value
,
$this
->
compression
,
$expire
);
$key
=
$this
->
prefix
.
$key
;
return
parent
::
set
(
md5
(
$key
)
,
$value
,
$this
->
compression
,
$expire
);
}
public
function
get
(
$key
)
{
$key
=
$this
->
prefix
.
"-"
.
$key
;
return
parent
::
get
(
$key
,
$this
->
compression
);
$key
=
$this
->
prefix
.
$key
;
return
parent
::
get
(
md5
(
$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