[dev] Littles questions for using API's methods

Gerard Breiner gerard.breiner at ias.u-psud.fr
Thu May 31 15:34:10 UTC 2012


Hello,

I'm new on these list…. I'm working on a script for exporting all calendar of each kronolith users to our davical server.
Therefore I'm learning how to call api's methods from a script. So I read http://wiki.horde.org/Doc/Dev/RegistryUsageH4?referrer=Doc%%2FDev about the Horde_Registry… Then I tried a little script :

[CODE]
#!/usr/bin/env php
<?php
set_include_path('/www/horde4/pear/php' . PATH_SEPARATOR . get_include_path());
require_once dirname(__FILE__) . '/../lib/Application.php';
Horde_Registry::appInit('kronolith', array(
    'cli' => true,
    'authentication' => 'none',
    'user_admin' => 'foo',
    'nocompress' => true
));

// Call a Registry method.
$calendars = $registry->call('calendar/listCalendars');
[/CODE]

I get :
Fatal error :
The method "calendar/listCalendars" is not defined in the Horde Registry.

So I checked if this method exist...

[CODE]
$list = $registry->listMethods();
var_dump($list);
[/CODE]

I get a list of method "packageName/methods" but not the one I'm interested in…
Yet, listCalendars() is defined in kronolith/lib/Api.php…
What is wrong in my code ? 

Any help would be appreciated…

Best regards

Gérard Breiner






More information about the dev mailing list