[dev] Littles questions for using API's methods
Gerard Breiner
gerard.breiner at ias.u-psud.fr
Fri Jun 1 13:56:33 UTC 2012
Yes in registry.php it is … But, in fact for some reason, the line "provides" in registry.local.php had been commented by me a few weeks ago. Then I forgot that registry.local.php has precedence on registry.php in Horde 4 (if I do understood) … So I didn't add but uncommented what I have commented.
Side horde all works very fine at the time I write.
Best regards.
Gérard
Le 1 juin 2012 à 11:29, Jan Schneider a écrit :
>
> 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