From 40570d6f56291f390c3bbfab514ecfff7e40bec4 Mon Sep 17 00:00:00 2001 From: Jack Bates Date: Sun, 9 Apr 2006 19:43:59 +0000 Subject: * Adding CalDAV server library --- lib/HTTP/CalDAV/Server.php | 116 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 116 insertions(+) create mode 100644 lib/HTTP/CalDAV/Server.php (limited to 'lib') diff --git a/lib/HTTP/CalDAV/Server.php b/lib/HTTP/CalDAV/Server.php new file mode 100644 index 0000000..eabc27b --- /dev/null +++ b/lib/HTTP/CalDAV/Server.php @@ -0,0 +1,116 @@ + + * @copyright 2006 The PHP Group + * @license PHP License 3.0 http://www.php.net/license/3_0.txt + * @version CVS: $Id: Server.php,v 1.1 2006/04/09 19:43:59 jablko Exp $ + * @link http://pear.php.net/package/HTTP_CalDAV_Server + * @see HTTP_WebDAV_Server + */ + +/** + * CalDav Server class + * + * Long description + * + * @category HTTP + * @package HTTP_CalDAV_Server + * @author Jack Bates + * @copyright 2006 The PHP Group + * @license PHP License 3.0 http://www.php.net/license/3_0.txt + * @version CVS: $Id: Server.php,v 1.1 2006/04/09 19:43:59 jablko Exp $ + * @link http://pear.php.net/package/HTTP_CalDAV_Server + * @see HTTP_WebDAV_Server + */ +class HTTP_CalDAV_Server extends HTTP_WebDAV_Server +{ + + /** + * REPORT request helper - prepares data-structures from REPORT requests + * + * @param options + * @return void + * @access public + */ + function report_request_helper(&$options) + { + $options = array(); + + return true; + } + + /** + * REPORT response helper - format REPORT response + * + * @param options + * @return void + * @access public + */ + function report_response_helper($options, $responses) + { + $this->_multistatus($responses); + } + + /** + * REPORT method wrapper + * + * @param void + * @return void + * @access public + */ + function report_wrapper() + { + // prepare data-structure from REPORT request + if (!$this->report_request_helper($options)) { + return; + } + + // call user handler + if (!$this->report($options, $responses)) { + return; + } + + // format REPORT response + $this->report_response_helper($options, $responses); + } + + /** + * Make a property in the CalDAV namespace + * + * @param string property name + * @param string property value + * @return array string property namespace + * string property name + * string property value + */ + function calDavProp($name, $value=null) { + return $this->mkprop('urn:ietf:params:xml:ns:caldav', $name, $value); + } +} + +/* + * Local variables: + * tab-width: 4 + * c-basic-offset: 4 + * c-handling-comment-ender-p: nil + * End: + */ + +?> -- cgit v1.2.3