/**
  * @static
  * @return Sabre_CalDAV_Backend_Friendica
  */
 public static function getInstance()
 {
     if (self::$instance == null) {
         self::$instance = new Sabre_CalDAV_Backend_Friendica();
     }
     return self::$instance;
 }
/**
 * @param int $namespace
 * @param int $namespace_id
 * @param string $uri
 * @param array $calendar
 * @return Sabre_CalDAV_Backend_Common
 * @throws Exception
 */
function wdcal_calendar_factory($namespace, $namespace_id, $uri, $calendar = null)
{
    switch ($namespace) {
        case CALDAV_NAMESPACE_PRIVATE:
            if ($uri == CALDAV_FRIENDICA_MINE || $uri == CALDAV_FRIENDICA_CONTACTS) {
                return Sabre_CalDAV_Backend_Friendica::getInstance();
            } else {
                return Sabre_CalDAV_Backend_Private::getInstance();
            }
    }
    throw new Exception("Calendar Namespace not found");
}
Exemple #3
0
/**
 * @param App $a
 * @param object $b
 */
function dav_event_updated_hook(&$a, &$b)
{
    dav_include_files();
    // @TODO Updating the cache instead of completely invalidating and rebuilding it
    Sabre_CalDAV_Backend_Friendica::invalidateCache($a->user["uid"], CALDAV_FRIENDICA_CONTACTS);
    Sabre_CalDAV_Backend_Friendica::invalidateCache($a->user["uid"], CALDAV_FRIENDICA_MINE);
}