$v ) { switch ( $v['tag'] ) { case 'URN:IETF:PARAMS:XML:NS:CALDAV:CALENDAR-QUERY': if ( $v['type'] == "open" ) { $putnum++; $put_type = substr($v['tag'],30); $put[$putnum]['type'] = $put_type; } else { unset($put_type); } break; case 'DAV::PROP': if ( isset($put_type) ) { if ( $v['type'] == "open" ) { $put_properties = array(); } else if ( $v['type'] == "close" ) { $put[$putnum]['properties'] = $put_properties; unset($put_properties); } else { error_log( "DBG: Unexpected DAV::PROP type of ".$v['type'] ); } } else { error_log( "DBG: Unexpected DAV::PROP type of ".$v['type']." when no active put type."); } break; case 'DAV::GETETAG': if ( isset($put_properties) ) { if ( $v['type'] == "complete" ) { $put_properties['GETETAG'] = 1; } } break; default: error_log("caldav: DBG: Unhandled tag >>".$v['tag']."<<"); } } dbg_log_array( 'RPT', $put_request, true ); dbg_log_array( 'REPORT', $put, true ); header("Content-type: text/xml"); echo << http://mycaldav/?andrewmcmillan.ics "fffff-abcd1" BEGIN:VCALENDAR VERSION:2.0 PRODID:-//Andrew's CalDAV Server//PHP//0.0.1 EOXML; echo iCalendar::vTimeZone("Pacific/Auckland"); $event = new vEvent( '20060517T150000Z', 'PT2H', 'andrew@catalyst.net.nz', '', 'A Test Event for Andrew' ); echo $event->ToString(); echo << HTTP/1.1 200 OK EOXML; ?>