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
67463567
Commit
67463567
authored
7 months ago
by
Alberto Paderno
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3462649
: Use xmlrpc_error() to return errors
parent
888e87f4
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!11
Issue #3462649: Use xmlrpc_error() to return errors
Pipeline
#228919
passed
7 months ago
Stage: build
Stage: validate
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
apc.module
+4
-10
4 additions, 10 deletions
apc.module
drupal_apc_cache.inc
+6
-8
6 additions, 8 deletions
drupal_apc_cache.inc
with
10 additions
and
18 deletions
apc.module
+
4
−
10
View file @
67463567
...
...
@@ -67,7 +67,7 @@ function apc_xmlrpc() {
'apc.clear_cache'
,
'apc_clear_cache'
,
array
(
'
array
'
,
'
boolean
'
,
'string'
,
'array'
,
),
...
...
@@ -84,12 +84,9 @@ function apc_xmlrpc() {
*/
function
apc_clear_cache
(
$key
,
$bins
=
array
())
{
if
(
empty
(
$key
)
||
variable_get
(
'cron_key'
,
'drupal'
)
!=
$key
)
{
watchdog
(
'apc'
,
'An invalid key was passed to apc_clear_cache().'
,
array
(),
WATCHDOG_ERROR
);
watchdog
(
'apc'
,
'An invalid
auth
key was passed to apc_clear_cache().'
,
array
(),
WATCHDOG_ERROR
);
return
array
(
'success'
=>
FALSE
,
'message'
=>
t
(
'Invalid key for apc.clear_cache.'
),
);
return
xmlrpc_error
(
-
32602
,
t
(
'Invalid auth key for apc.clear_cache.'
));
}
// Clear the APCu cache.
...
...
@@ -100,10 +97,7 @@ function apc_clear_cache($key, $bins = array()) {
}
}
return
array
(
'success'
=>
TRUE
,
'message'
=>
t
(
'The cache has been cleared.'
),
);
return
TRUE
;
}
/**
...
...
This diff is collapsed.
Click to expand it.
drupal_apc_cache.inc
+
6
−
8
View file @
67463567
...
...
@@ -385,6 +385,10 @@ public static function remoteFlush() {
}
if
(
!
empty
(
self
::
$remoteRequests
))
{
if
(
$base_url
==
'http://'
.
basename
(
conf_path
()))
{
drush_log
(
'$base_url might not be set correctly. Try using the -l/--uri option for Drush.'
,
'warning'
);
}
// Optimize '*' clears.
$star
=
serialize
(
'*'
);
...
...
@@ -405,16 +409,10 @@ public static function remoteFlush() {
$response
=
xmlrpc
(
$uri
,
$args
);
if
(
$response
===
FALSE
)
{
drush_log
(
'xmlrpc() error: ('
.
xmlrpc_errno
()
.
') '
.
xmlrpc_error_msg
(),
'error'
);
if
(
$base_url
==
'http://'
.
basename
(
conf_path
()))
{
drush_log
(
'The base_url might not be set correctly try using the -l/--uri option for drush.'
,
'warning'
);
}
}
elseif
(
!
$response
[
'success'
])
{
drush_log
(
'APC could not flush cache(s) because '
.
$uri
.
' returned code '
.
$response
[
'message'
],
'error'
);
drush_log
(
'apc.clear_cache: '
.
xmlrpc_error_msg
()
.
' ('
.
xmlrpc_errno
()
.
')'
,
'error'
);
}
else
{
drush_log
(
"
APC-Remote
$uri
:
{
$response
[
'message'
]
}
"
,
'success'
);
drush_log
(
"
apc.clear_cache: The cache has been cleared.
"
,
'success'
);
}
}
}
...
...
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