[Kolab-devel] Accessing contacts from roundcube cli

Andrzej Kwiatkowski kwiatek at opensoft.pl
Mon Aug 5 15:55:45 CEST 2013


Hi,

I need to write cmd tool to access kolab adressbook from cli.

Script looks like:


require_once INSTALL_PATH.'program/include/clisetup.php';

$RCMAIL = rcmail::get_instance();

$RCMAIL->login($user, $pass, $host = null, $cookiecheck = false);

$RCMAIL->task="addressbook";

$RCMAIL->plugins->init($RCMAIL, $RCMAIL->task);
$RCMAIL->plugins->load_plugins((array)$RCMAIL->config->get('plugins', 
array()), array('filesystem_attachments', 'jqueryui'));


Now i would like to list address sources
so i try to do:

$ka=new kolab_addressbook(null);

print_r($ka->get_address_sources()); - line 107

But this gives me:
PHP Fatal error:  Call to undefined method 
kolab_addressbook::get_address_sources() in abook.php on line 107

when i add $ka->init(); before line 107 i got:

HP Fatal error:  Call to a member function load_plugin() on a non-object 
in /program/lib/Roundcube/rcube_plugin.php on line 102


Have aby idea?

Regards
AK



More information about the devel mailing list