Prev | Current Page 315 | Next

Rob Allen, Nick Lo, and Steven Brown

"Zend Framework in Action"

'/cache/xmlrpc.cache'; A
$server = new Zend_XmlRpc_Server();
if (!Zend_XmlRpc_Server_Cache::get($cacheFile, $server)) { B
require_once 'Blogger.php';
require_once 'Metaweblog.php';
require_once 'MovableType.php';
$server->setClass('Blogger', 'blogger');
$server->setClass('Metaweblog', 'metaWeblog');
$server->setClass('MovableType', 'mt');
Zend_XmlRpc_Server_Cache::save($cacheFile, $server); C
}
A The file to use to store the cached information
B Checking for the presence of a cache file before attaching classes
C If there was no cache file a new one is saved with the introspection information
With Zend_XmlRpc_Server_Cache in place we can cut out all that resource intensive introspection and as
long as we don??™t need to change the attached classes we can leave it as it is. If we do change any of those
classes we need only delete the cache file so that a new version can be rewritten that reflects the changes.
Now that we??™ve set-up our XML-RPC server we can look at the client side of the exchange with
Zend_XmlRpc_Client.
11.3.4 Zend_XmlRpc_Client
For our Places application our intention was to set-up an XML-RPC server so that we could remotely edit
articles with any of the desktop applications that support the weblog API??™s. In doing so we have covered a lot
Licensed to Menshu You

Pages:
303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327
produkcja wirtualne nieruchomości ABC agencja reklamowa poznań betsson