Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
our_own_cloud_project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
die_coolen_jungs
our_own_cloud_project
Commits
17dd5d08
Commit
17dd5d08
authored
10 years ago
by
Robin McCorkell
Browse files
Options
Downloads
Patches
Plain Diff
Add Null memcacher
parent
1f1643b3
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/private/memcache/factory.php
+2
-2
2 additions, 2 deletions
lib/private/memcache/factory.php
lib/private/memcache/null.php
+35
-0
35 additions, 0 deletions
lib/private/memcache/null.php
with
37 additions
and
2 deletions
lib/private/memcache/factory.php
+
2
−
2
View file @
17dd5d08
...
...
@@ -24,7 +24,7 @@ class Factory implements ICacheFactory {
}
/**
* get a cache instance,
will return null
if no backend
is
available
* get a cache instance,
or Null backend
if no backend available
*
* @param string $prefix
* @return \OC\Memcache\Cache
...
...
@@ -42,7 +42,7 @@ class Factory implements ICacheFactory {
}
elseif
(
Memcached
::
isAvailable
())
{
return
new
Memcached
(
$prefix
);
}
else
{
return
n
ull
;
return
n
ew
Null
(
$prefix
)
;
}
}
...
...
This diff is collapsed.
Click to expand it.
lib/private/memcache/null.php
0 → 100644
+
35
−
0
View file @
17dd5d08
<?php
/**
* Copyright (c) 2015 Robin McCorkell <rmccorkell@karoshi.org.uk>
* This file is licensed under the Affero General Public License version 3 or
* later.
* See the COPYING-README file.
*/
namespace
OC\Memcache
;
class
Null
extends
Cache
{
public
function
get
(
$key
)
{
return
null
;
}
public
function
set
(
$key
,
$value
,
$ttl
=
0
)
{
return
true
;
}
public
function
hasKey
(
$key
)
{
return
false
;
}
public
function
remove
(
$key
)
{
return
true
;
}
public
function
clear
(
$prefix
=
''
)
{
return
true
;
}
static
public
function
isAvailable
()
{
return
true
;
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment