[dev] Littles questions for using API's methods

Jan Schneider jan at horde.org
Fri Jun 1 07:55:33 UTC 2012


Zitat von Gerard Breiner <gerard.breiner at ias.u-psud.fr>:

> 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 ?

Is your Kronolith instance otherwise working? Do you get any other  
calendar/ methods?

-- 
Jan Schneider
The Horde Project
http://www.horde.org/




More information about the dev mailing list