Mercurial > hg > cmmr2012-drupal-site
annotate vendor/chi-teck/drupal-code-generator/templates/d7/hook/xmlrpc_alter.twig @ 5:12f9dff5fda9 tip
Update to Drupal core 8.7.1
author | Chris Cannam |
---|---|
date | Thu, 09 May 2019 15:34:47 +0100 |
parents | c75dbcec494b |
children |
rev | line source |
---|---|
Chris@0 | 1 /** |
Chris@0 | 2 * Implements hook_xmlrpc_alter(). |
Chris@0 | 3 */ |
Chris@0 | 4 function {{ machine_name }}_xmlrpc_alter(&$methods) { |
Chris@0 | 5 // Directly change a simple method. |
Chris@0 | 6 $methods['drupal.login'] = 'mymodule_login'; |
Chris@0 | 7 |
Chris@0 | 8 // Alter complex definitions. |
Chris@0 | 9 foreach ($methods as $key => &$method) { |
Chris@0 | 10 // Skip simple method definitions. |
Chris@0 | 11 if (!is_int($key)) { |
Chris@0 | 12 continue; |
Chris@0 | 13 } |
Chris@0 | 14 // Perform the wanted manipulation. |
Chris@0 | 15 if ($method[0] == 'drupal.site.ping') { |
Chris@0 | 16 $method[1] = 'mymodule_directory_ping'; |
Chris@0 | 17 } |
Chris@0 | 18 } |
Chris@0 | 19 } |