Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal
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
drupal
Commits
a1e08d93
Commit
a1e08d93
authored
15 years ago
by
Dries Buytaert
Browse files
Options
Downloads
Patches
Plain Diff
- Patch
#656266
by fgm: fixed the hook and added documentation.
parent
ab6f592c
No related branches found
No related tags found
2 merge requests
!7452
Issue #1797438. HTML5 validation is preventing form submit and not fully...
,
!789
Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
modules/system/system.api.php
+38
-0
38 additions, 0 deletions
modules/system/system.api.php
xmlrpc.php
+1
-1
1 addition, 1 deletion
xmlrpc.php
with
39 additions
and
1 deletion
modules/system/system.api.php
+
38
−
0
View file @
a1e08d93
...
@@ -1128,6 +1128,44 @@ function hook_xmlrpc() {
...
@@ -1128,6 +1128,44 @@ function hook_xmlrpc() {
);
);
}
}
/**
* Alter the definition of XML-RPC methods before they are called.
*
* This hook lets at module modify the callback definition for already
* declared XML-RPC methods, when they are being invoked by a client.
*
* This hook is invoked by xmlrpc.php. The method definitions are
* passed in by reference. Each element of the $methods array is one
* callback definition returned by a module from hook_xmlrpc. Additional
* methods may be added, or existing items altered.
*
* Modules implementing this hook must take care of the fact that
* hook_xmlrpc allows two distinct and incompatible formats for callback
* definition, so module must be prepared to handle either format for
* each callback being altered.
*
* @see hook_xmlrpc()
*
* @param $methods
* Associative array of method callback definitions returned from
* hook_xmlrpc.
*/
function
hook_xmlrpc_alter
(
&
$methods
)
{
// Direct update for methods defined the simple way
$methods
[
'drupal.login'
]
=
'mymodule_login'
;
// Lookup update for methods defined the complex way
foreach
(
$methods
as
$key
=>
&
$method
)
{
if
(
!
is_int
(
$key
))
{
continue
;
}
if
(
$method
[
0
]
==
'drupal.site.ping'
)
{
$method
[
1
]
=
'mymodule_directory_ping'
;
}
}
}
/**
/**
* Log an event message
* Log an event message
*
*
...
...
This diff is collapsed.
Click to expand it.
xmlrpc.php
+
1
−
1
View file @
a1e08d93
...
@@ -17,5 +17,5 @@
...
@@ -17,5 +17,5 @@
include_once
DRUPAL_ROOT
.
'/includes/xmlrpcs.inc'
;
include_once
DRUPAL_ROOT
.
'/includes/xmlrpcs.inc'
;
$services
=
module_invoke_all
(
'xmlrpc'
);
$services
=
module_invoke_all
(
'xmlrpc'
);
drupal_alter
(
'xmlrpc
_alter
'
,
$services
);
drupal_alter
(
'xmlrpc'
,
$services
);
xmlrpc_server
(
$services
);
xmlrpc_server
(
$services
);
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