Skip to content
Open
2 changes: 1 addition & 1 deletion CalDAVClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -1065,7 +1065,7 @@ function GetEntryByUid( $uid, $relative_url = null ) {
*
* @param string $href The href from a call to GetEvents or GetTodos etc.
*
* @return string The iCalendar of the calendar entry
* @return array The iCalendar of the calendar entry
*/
function GetEntryByHref( $href ) {
//$href = str_replace( rawurlencode('/'),'/',rawurlencode($href));
Expand Down
28 changes: 26 additions & 2 deletions CalDAVObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
* The assignment of an entity tag ensures, that you know what you are changing/deleting. It ensures, that no one
* changed the resource between your viewing of the resource and your change/delete-request. Assigning an entity tag
* provides you of accidently destroying the work of others.
* cal: The {@link CalDAVCalendar} this object belongs to.
*
* @package simpleCalDAV
*
Expand All @@ -26,26 +27,49 @@ class CalDAVObject {
private $data;
private $etag;

public function __construct ($href, $data, $etag) {
/**
* @param string $href
* @param string $data
* @param string $etag
* @param CalDAVCalendar|null $cal
*/
public function __construct ($href, $data, $etag, $cal = null) {
$this->href = $href;
$this->data = $data;
$this->etag = $etag;
$this->cal = $cal;
}


// Getter

/**
* @return string
*/
public function getHref () {
return $this->href;
}

/**
* @return string
*/
public function getData () {
return $this->data;
}

/**
* @return string
*/
public function getEtag () {
return $this->etag;
}

/**
* Returns the {@link CalDAVCalendar} this object belongs to.
* @return CalDAVCalendar|null
*/
public function getCalendar() {
return $this->cal;
}
}

?>
59 changes: 0 additions & 59 deletions README

This file was deleted.

74 changes: 74 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
simpleCalDAV
============

Copyright 2014 Michael Palm <palm.michael@gmx.de>

Table of contents
-----------------

1. [About](#1-about)
2. [Requirements](#2-requirements)
3. [Installation](#3-installation)
4. [How to get started](#4-how-to-get-started)
5. [Example Code](#5-example-code)

------------------------

## 1. About

simpleCalDAV is a php library that allows you to connect to a calDAV-server to get event-, todo-
and free/busy-calendar resources from the server, to change them, to delete them, to create new
ones, etc.
simpleCalDAV was made and tested for connections to the CalDAV-server Baikal 0.2.7. But it should
work with any other CalDAV-server too.

It contains the following functions:
- connect()
- findCalendars()
- setCalendar()
- getCalendar()
- create()
- change()
- delete()
- getEvents()
- getAllEvents()
- getTODOs()
- getAllTODOs()
- getCustomReport()

All of those functions are really easy to use, self-explanatory and are delivered with a big initial
comment, which explains all needed arguments and the return values.

This library is heavily based on AgenDAV caldav-client-v2.php by Jorge López Pérez <jorge@adobo.org>
which again is heavily based on DAViCal caldav-client-v2.php by Andrew McMillan
<andrew@mcmillan.net.nz>.
Actually, I hardly added any features. The main point of my work is to make everything straight
forward and easy to use. You can use simpleCalDAV without a deeper understanding of the
calDAV-protocol.


## 2. Requirements

Requirements of this library are
- The php extension cURL ( http://www.php.net/manual/en/book.curl.php )


## 3. Installation

Just navigate into a directory on your server and execute

git clone https://github.com/wvrzel/simpleCalDAV.git

Assure yourself that cURL is installed.

Import `SimpleCalDAVClient.php` in your code and you are ready to go ;-)


## 4. How to get started

Read the comments in `SimpleCalDAVClient.php` and the example code.


## 5. Example Code

Example code is provided under "/example code/".
Loading