The Registry also lets you invoke methods in other applications
<?php
require_once HORDE_BASE . '/lib/Registry.php'; $registry = &Registry::singleton();
// Check to see if the functionality we want is there if (!$registry->hasMethod('contacts/search')) { echo 'no contacts/search method defined'; exit; }
// The contacts/search method takes two arrays; one of names, one of address books $args = array('addresses' => array('Chuck'), 'addressbooks' => array('myldap')); $results = $registry->call('contacts/search', $args);
?>
- The registry config file defines where to find the code necessary to execute the method, and what application implements it.
- Any application can be integrated this way; all you need to do is map it to the registry interface.
|