[Catalyst-commits] r6397 -
trunk/Catalyst-Action-DAV/lib/Catalyst/Action
matthewt at dev.catalyst.perl.org
matthewt at dev.catalyst.perl.org
Sat May 12 19:52:49 GMT 2007
Author: matthewt
Date: 2007-05-12 19:52:48 +0100 (Sat, 12 May 2007)
New Revision: 6397
Modified:
trunk/Catalyst-Action-DAV/lib/Catalyst/Action/DAV.pm
Log:
SYNOPSIS for Catalyst::Action::DAV
Modified: trunk/Catalyst-Action-DAV/lib/Catalyst/Action/DAV.pm
===================================================================
--- trunk/Catalyst-Action-DAV/lib/Catalyst/Action/DAV.pm 2007-05-12 17:28:26 UTC (rev 6396)
+++ trunk/Catalyst-Action-DAV/lib/Catalyst/Action/DAV.pm 2007-05-12 18:52:48 UTC (rev 6397)
@@ -108,6 +108,35 @@
Catalyt::Action::DAV - WebDAV support for Catalyst
+=head1 SYNOPSIS
+
+To serve http://example.com/myapp/dav/ as DAV for /var/www/dav -
+
+ package MyApp::Controller::DAV;
+
+ use strict;
+ use warnings;
+ use Filesys::Virtual::Plain;
+ use Class::C3;
+ use base qw/Catalyst::Controller/;
+
+ __PACKAGE__->mk_accessors('filesys', 'fs_path');
+
+ __PACKAGE__->config(fs_path => '/var/www/dav');
+
+ sub new {
+ my ($class, @args) = @_;
+ my $new = $class->next::method(@args);
+ $new->filesys(Filesys::Virtual::Plain->new($new->fs_path));
+ }
+
+ sub handler :Path :ActionClass('DAV') {
+ my ($self, $c) = @_;
+ $c->stash(filesys => $self->filesys);
+ }
+
+ 1;
+
=head1 AUTHOR
Matt S Trout of http://www.shadowcatsystems.co.uk (mst at shadowcatsystems.co.uk)
More information about the Catalyst-commits
mailing list