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
9b18a4fd
Commit
9b18a4fd
authored
11 years ago
by
Thomas Müller
Browse files
Options
Downloads
Plain Diff
Merge pull request #4378 from owncloud/fixing-3417-master
Don't use xcache in case admin auth is enabled
parents
684e331b
38f4ecae
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/private/memcache/xcache.php
+17
-9
17 additions, 9 deletions
lib/private/memcache/xcache.php
lib/private/util.php
+5
-1
5 additions, 1 deletion
lib/private/util.php
with
22 additions
and
10 deletions
lib/private/memcache/xcache.php
+
17
−
9
View file @
9b18a4fd
...
...
@@ -8,9 +8,13 @@
namespace
OC\Memcache
;
/**
* See http://xcache.lighttpd.net/wiki/XcacheApi for provided constants and
* functions etc.
*/
class
XCache
extends
Cache
{
/**
* entries in XCache gets namespaced to prevent collisions between own
c
loud instances and users
* entries in XCache gets namespaced to prevent collisions between own
C
loud instances and users
*/
protected
function
getNameSpace
()
{
return
$this
->
prefix
;
...
...
@@ -37,7 +41,12 @@ class XCache extends Cache {
}
public
function
clear
(
$prefix
=
''
)
{
xcache_unset_by_prefix
(
$this
->
getNamespace
()
.
$prefix
);
if
(
function_exists
(
'xcache_unset_by_prefix'
))
{
return
xcache_unset_by_prefix
(
$this
->
getNamespace
()
.
$prefix
);
}
else
{
// Since we can not clear by prefix, we just clear the whole cache.
xcache_clear_cache
(
\XC_TYPE_VAR
,
0
);
}
return
true
;
}
...
...
@@ -48,6 +57,12 @@ class XCache extends Cache {
if
(
\OC
::
$CLI
)
{
return
false
;
}
if
(
!
function_exists
(
'xcache_unset_by_prefix'
)
&&
ini_get
(
'xcache.admin.enable_auth'
))
{
// We do not want to use XCache if we can not clear it without
// using the administration function xcache_clear_cache()
// AND administration functions are password-protected.
return
false
;
}
$var_size
=
(
int
)
ini_get
(
'xcache.var_size'
);
if
(
!
$var_size
)
{
return
false
;
...
...
@@ -55,10 +70,3 @@ class XCache extends Cache {
return
true
;
}
}
if
(
!
function_exists
(
'xcache_unset_by_prefix'
))
{
function
xcache_unset_by_prefix
(
$prefix
)
{
// Since we can't clear targetted cache, we'll clear all. :(
xcache_clear_cache
(
\XC_TYPE_VAR
,
0
);
}
}
This diff is collapsed.
Click to expand it.
lib/private/util.php
+
5
−
1
View file @
9b18a4fd
...
...
@@ -1085,7 +1085,11 @@ class OC_Util {
}
// XCache
if
(
function_exists
(
'xcache_clear_cache'
))
{
xcache_clear_cache
(
XC_TYPE_VAR
,
0
);
if
(
ini_get
(
'xcache.admin.enable_auth'
))
{
OC_Log
::
write
(
'core'
,
'XCache opcode cache will not be cleared because "xcache.admin.enable_auth" is enabled.'
,
\OC_Log
::
WARN
);
}
else
{
xcache_clear_cache
(
XC_TYPE_PHP
,
0
);
}
}
// Opcache (PHP >= 5.5)
if
(
function_exists
(
'opcache_reset'
))
{
...
...
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