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
9be8ac58
Commit
9be8ac58
authored
10 years ago
by
Andreas Fischer
Browse files
Options
Downloads
Patches
Plain Diff
Memcache\Factory: Remove static, use globalPrefix.
parent
da391b89
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/base.php
+11
-2
11 additions, 2 deletions
lib/base.php
lib/private/memcache/factory.php
+3
-2
3 additions, 2 deletions
lib/private/memcache/factory.php
with
14 additions
and
4 deletions
lib/base.php
+
11
−
2
View file @
9be8ac58
...
...
@@ -477,9 +477,18 @@ class OC {
self
::
handleAuthHeaders
();
self
::
initPaths
();
if
(
OC_Config
::
getValue
(
'instanceid'
,
false
))
{
// The class loader takes an optional low-latency cache, which MUST be
// namespaced. The instanceid is used for namespacing, but might be
// unavailable at this point. Futhermore, it might not be possible to
// generate an instanceid via \OC_Util::getInstanceId() because the
// config file may not be writable. As such, we only register a class
// loader cache if instanceid is available without trying to create one.
$instanceId
=
OC_Config
::
getValue
(
'instanceid'
,
null
);
if
(
$instanceId
)
{
try
{
self
::
$loader
->
setMemoryCache
(
\OC\Memcache\Factory
::
createLowLatency
(
'Autoloader'
));
$memcacheFactory
=
new
\OC\Memcache\Factory
(
$instanceId
);
self
::
$loader
->
setMemoryCache
(
$memcacheFactory
->
createLowLatency
(
'Autoloader'
));
}
catch
(
\Exception
$ex
)
{
}
}
...
...
This diff is collapsed.
Click to expand it.
lib/private/memcache/factory.php
+
3
−
2
View file @
9be8ac58
...
...
@@ -59,7 +59,8 @@ class Factory implements ICacheFactory {
* @param string $prefix
* @return null|Cache
*/
public
static
function
createLowLatency
(
$prefix
=
''
)
{
public
function
createLowLatency
(
$prefix
=
''
)
{
$prefix
=
$this
->
globalPrefix
.
'/'
.
$prefix
;
if
(
XCache
::
isAvailable
())
{
return
new
XCache
(
$prefix
);
}
elseif
(
APCu
::
isAvailable
())
{
...
...
@@ -76,7 +77,7 @@ class Factory implements ICacheFactory {
*
* @return bool
*/
public
static
function
isAvailableLowLatency
()
{
public
function
isAvailableLowLatency
()
{
return
XCache
::
isAvailable
()
||
APCu
::
isAvailable
()
||
APC
::
isAvailable
();
}
...
...
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