diff --git a/htdocs/rss.php b/htdocs/feed.php similarity index 87% rename from htdocs/rss.php rename to htdocs/feed.php index 839a0b91..f78cc7ff 100644 --- a/htdocs/rss.php +++ b/htdocs/feed.php @@ -1,12 +1,12 @@ * @author Andrew McMillan * @license GPL v2 or later */ require_once("./always.php"); -dbg_error_log( "rss", " User agent: %s", ((isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : "Unfortunately Mulberry and Chandler don't send a 'User-agent' header with their requests :-(")) ); +dbg_error_log( "feed", " User agent: %s", ((isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : "Unfortunately Mulberry and Chandler don't send a 'User-agent' header with their requests :-(")) ); dbg_log_array( "headers", '_SERVER', $_SERVER, true ); require_once("HTTPAuthSession.php"); @@ -23,10 +23,10 @@ function hyperlink( $text ) { return preg_replace( '@(https?://([-\w\.]+[-\w])+(:\d+)?(/([\w/_\.#-]*(\?\S+)?[^\.\s])?)?)@', '$1', $text ); } -function caldav_get_rss( $request ) { +function caldav_get_feed( $request ) { global $c; - dbg_error_log("rss", "GET method handler"); + dbg_error_log("feed", "GET method handler"); require_once("vComponent.php"); require_once("DAVResource.php"); @@ -40,7 +40,7 @@ function caldav_get_rss( $request ) { if ( $collection->IsCollection() ) { if ( ! $collection->IsCalendar() && !(isset($c->get_includes_subcollections) && $c->get_includes_subcollections) ) { - $request->DoResponse( 405, translate("RSS feeds are only supported for calendars at present.") ); + $request->DoResponse( 405, translate("Feeds are only supported for calendars at present.") ); } $principal = $collection->GetProperty('principal'); @@ -60,23 +60,23 @@ function caldav_get_rss( $request ) { $sql .= 'caldav_data.collection_id = :collection_id '; $params = array( ':collection_id' => $collection->resource_id() ); } - $c->rss_item_limit = "ALL"; + $c->feed_item_limit = "ALL"; $sql .= ' ORDER BY caldav_data.modified DESC'; - $sql .= ' LIMIT '.(isset($c->rss_item_limit) ? $c->rss_item_limit : 15); + $sql .= ' LIMIT '.(isset($c->feed_item_limit) ? $c->feed_item_limit : 15); $qry = new AwlQuery( $sql, $params ); if ( !$qry->Exec("GET",__LINE__,__FILE__) ) { $request->DoResponse( 500, translate("Database Error") ); } /** - * Here we are constructing the RSS feed response for this collection, including + * Here we are constructing the feed response for this collection, including * the timezones that are referred to by the events we have selected. * Library used: http://framework.zend.com/manual/en/zend.feed.writer.html */ require_once('AtomFeed.php'); $feed = new AtomFeed(); - $feed->setTitle('CalDAV RSS Feed: '. $collection->GetProperty('displayname')); + $feed->setTitle('CalDAV Feed: '. $collection->GetProperty('displayname')); $url = $c->protocol_server_port . $collection->url(); $url = preg_replace( '{/$}', '.ics', $url); $feed->setLink($url); @@ -177,12 +177,12 @@ function caldav_get_rss( $request ) { } if ( $request->method == 'GET' ) { - caldav_get_rss( $request ); + caldav_get_feed( $request ); } else { - dbg_error_log( 'rss', 'Unhandled request method >>%s<<', $request->method ); - dbg_log_array( 'rss', '_SERVER', $_SERVER, true ); - dbg_error_log( 'rss', 'RAW: %s', str_replace("\n", '',str_replace("\r", '', $request->raw_post)) ); + dbg_error_log( 'feed', 'Unhandled request method >>%s<<', $request->method ); + dbg_log_array( 'feed', '_SERVER', $_SERVER, true ); + dbg_error_log( 'feed', 'RAW: %s', str_replace("\n", '',str_replace("\r", '', $request->raw_post)) ); } $request->DoResponse( 500, translate('The application program does not understand that request.') ); diff --git a/inc/AtomFeed.php b/inc/AtomFeed.php index e9e43a0d..50f24ac6 100644 --- a/inc/AtomFeed.php +++ b/inc/AtomFeed.php @@ -38,7 +38,7 @@ class AtomEntry { 2008-10-25T11:07:49+13:00 2010-12-27T06:49:16+13:00 - http://mycaldav/rss.php/rss.php/user1/home/MICROPARTY-77C6-4FB7-BDD3-6882E2F1BE74.ics#UID:MICROPARTY-77C6-4FB7-BDD3-6882E2F1BE74 + http://mycaldav/feed.php/user1/home/MICROPARTY-77C6-4FB7-BDD3-6882E2F1BE74.ics#UID:MICROPARTY-77C6-4FB7-BDD3-6882E2F1BE74 Time: 2008-11-21 16:00:00Description:Have a microparty. All the best parties are monthly! @@ -144,16 +144,16 @@ class AtomFeed extends XMLDocument { } /* - http://mycaldav/rss.php/user1/home.ics - CalDAV RSS Feed: User 1's Calendaranza + http://mycaldav/feed.php/user1/home.ics + CalDAV Feed: User 1's Calendaranza 2010-12-26T17:49:16+13:00 Zend_Feed_Writer - - + + User 1 user1@example.net - http://mycaldav/rss.php/caldav.php/user1/ + http://mycaldav/feed.php/caldav.php/user1/ */