[dev] Littles questions for using API's methods

Jan Schneider jan at horde.org
Fri Jun 1 09:29:33 UTC 2012


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

> Hello Jan,
>
> Le 1 juin 2012 à 09:55, Jan Schneider a écrit :
>
>>
>> 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?
>>
> Yes, Kronolith works on our horde site? No I do not get any other  
> calendar/methods?.
> But, I've just check conf/registry.local.php and added provides =>  
> 'calendar' at the part "kronolith". Now I get the list  
> calendar/methods.
> I'm sorry for the inconvenience? Nevertheless, your answer had help  
> me to find and correct my mistake.

There shouldn't be a need to add this, since this already *does* exist  
in registry.php.

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




More information about the dev mailing list