[kronolith] What means "a:0:{}"
Ralf Lang
lang at b1-systems.de
Thu Apr 4 06:00:57 UTC 2019
Hi Ferdinand,
Am 03.04.19 um 21:00 schrieb Ferdinand Gruber:
> Am 03.04.19 um 14:49 schrieb Ralf Lang:
>> ... iirc you can talk to kronolith ...
>
> Hallo Ralf,
>
> in Deutsch kann ich mich besser ausdrücken:
>
> ich möchte eigentlich nur wissen, wie ich das anstellen soll, mit
> Hilfe der Kronolith API ein Calendar event in der Datenbank zu speichern,
> Mein Problem ist, dass mein direkter Zugriff auf die kronolith_events
> Tabelle (ohne API) zur Folge hat, dass die Synchronisation mit dem
> Smartphone nicht so richtig funktioniert.
>
> Danke für Hilfe.
>
> .. und jetzt - für in Englsch:
>
> I just want to know how to do that, using the Kronolith API to save a
> Calendar event in the database.
> My problem is, that after my direct access to the kronolith_events
> table (without API) the synchronization with the smartphone does not
> work properly.
>
> Thank you for trying to help me.
>
Let's do an exercise.
We will need the external API of kronolith, especially
put() https://github.com/horde/kronolith/blob/master/lib/Api.php#L263
browser() https://github.com/horde/kronolith/blob/master/lib/Api.php#L58
Create a new file kronolith/bin/events and make it executable (+x) - you
could also use the horde admin php shell and select context Kronolith
First some boilerplate
#!/usr/bin/env
php
<?php
$baseDir = __DIR__ . '/../';
require_once $baseDir . 'lib/Application.php';
Horde_Registry::appInit('kronolith', array('cli' => true));
This initializes kronolith as admin.
Now let's begin browsing.
// authorize as lang (replace with your name)
$registry->setAuth('lang', array(), array());
// Dive into the calendar path step by step (app, owner, calendar)
print_r($registry->call('calendar/browse', array()));
// This gives you the available calendars both as a dir of individual
event files and as an ics file of all events
print_r($registry->call('calendar/browse', array('kronolith/lang')));
// dive into one of these
print_r($registry->call('calendar/browse',
array('kronolith/lang/KI14jYtCMpbet4ecYzAg1bn.ics')));
print_r($registry->call('calendar/browse',
array('kronolith/lang/KI14jYtCMpbet4ecYzAg1bn')));
Now you know how to use the api and you see examples of event
description structure.
Now use put() to put an event into a calendar
* Saves a file into the Kronolith tree.
*
* @param string $path The path where to PUT the file.
* @param string $content The file content.
* @param string $content_type The file's content type.
*
* @return array The event UIDs.
* @throws Kronolith_Exception
*/
/**
Hope that helps a bit.
Regards
Ralf
--
Ralf Lang
Linux Consultant / Developer
Tel.: +49-170-6381563
Mail: lang at b1-systems.de
B1 Systems GmbH
Osterfeldstraße 7 / 85088 Vohburg / http://www.b1-systems.de
GF: Ralph Dehner / Unternehmenssitz: Vohburg / AG: Ingolstadt,HRB 3537
More information about the kronolith
mailing list