Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
apc
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
apc
Commits
f6e5c3b8
Verified
Commit
f6e5c3b8
authored
6 months ago
by
Alberto Paderno
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3464189
: Add DrupalApcCache::addOperation()
parent
6666b9ba
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!43
Issue #3464189: Add DrupalApcCache::addOperation()
Pipeline
#236247
passed
6 months ago
Stage: build
Stage: validate
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
drupal_apc_cache.inc
+17
-12
17 additions, 12 deletions
drupal_apc_cache.inc
with
17 additions
and
12 deletions
drupal_apc_cache.inc
+
17
−
12
View file @
f6e5c3b8
...
...
@@ -163,7 +163,7 @@ protected function keyName($cid = NULL) {
* {@inheritdoc}
*/
public
function
get
(
$cid
)
{
$this
->
o
peration
s
(
array
(
'get()'
,
$this
->
bin
,
array
(
$cid
)));
$this
->
addO
peration
(
array
(
'get()'
,
$this
->
bin
,
array
(
$cid
)));
if
(
apcu_enabled
())
{
$data
=
apcu_fetch
(
$this
->
keyName
(
$cid
),
$success
);
...
...
@@ -202,7 +202,7 @@ public function getMultiple(&$cids) {
$cache
=
array
();
// Add a get to our statistics.
$this
->
o
peration
s
(
array
(
'getMultiple()'
,
$this
->
bin
,
$cids
));
$this
->
addO
peration
(
array
(
'getMultiple()'
,
$this
->
bin
,
$cids
));
if
(
!
$cids
)
{
return
$cache
;
...
...
@@ -228,7 +228,7 @@ public function getMultiple(&$cids) {
*/
public
function
set
(
$cid
,
$data
,
$expire
=
CACHE_PERMANENT
)
{
// Add set to statistics.
$this
->
o
peration
s
(
array
(
'set()'
,
$this
->
bin
,
$cid
));
$this
->
addO
peration
(
array
(
'set()'
,
$this
->
bin
,
$cid
));
if
(
apcu_enabled
())
{
// Create new cache object.
...
...
@@ -271,7 +271,7 @@ public function set($cid, $data, $expire = CACHE_PERMANENT) {
*/
protected
function
deleteKey
(
$cid
)
{
if
(
apcu_enabled
())
{
$this
->
o
peration
s
(
array
(
'deleteKey()'
,
$this
->
bin
,
$cid
));
$this
->
addO
peration
(
array
(
'deleteKey()'
,
$this
->
bin
,
$cid
));
apcu_delete
(
$this
->
keyName
(
$cid
));
}
}
...
...
@@ -284,7 +284,7 @@ protected function deleteKey($cid) {
*/
protected
function
deleteKeys
(
$prefix
=
NULL
)
{
if
(
apcu_enabled
()
&&
class_exists
(
'APCUIterator'
))
{
$this
->
o
peration
s
(
array
(
'deleteKeys()'
,
$this
->
bin
,
$prefix
));
$this
->
addO
peration
(
array
(
'deleteKeys()'
,
$this
->
bin
,
$prefix
));
$escaped_key
=
preg_quote
(
$this
->
keyName
(
$prefix
),
'/'
);
$iterator
=
new
APCUIterator
(
"/^
$escaped_key
/"
,
APC_ITER_KEY
);
...
...
@@ -355,20 +355,25 @@ public static function pendingRequests() {
}
/**
* Adds a new operation to the list of operations, or returns the list.
*
* @param array|null $new_operation
* The new operation to add.
* Retrieves the list of operations done on the cache.
*
* @return array
* The list of cache operations.
*/
public
static
function
operations
(
$new_operation
=
NULL
)
{
public
static
function
operations
()
{
return
self
::
$operations
;
}
/**
* Adds a new operation to the list of operations.
*
* @param array $new_operation
* The new operation to add.
*/
protected
function
addOperation
(
$new_operation
)
{
if
(
is_array
(
$new_operation
))
{
self
::
$operations
[]
=
$new_operation
;
}
return
self
::
$operations
;
}
}
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