summaryrefslogtreecommitdiffstats
path: root/karm/test/__webdav.pl
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commit460c52653ab0dcca6f19a4f492ed2c5e4e963ab0 (patch)
tree67208f7c145782a7e90b123b982ca78d88cc2c87 /karm/test/__webdav.pl
downloadtdepim-460c52653ab0dcca6f19a4f492ed2c5e4e963ab0.tar.gz
tdepim-460c52653ab0dcca6f19a4f492ed2c5e4e963ab0.zip
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'karm/test/__webdav.pl')
-rwxr-xr-xkarm/test/__webdav.pl57
1 files changed, 57 insertions, 0 deletions
diff --git a/karm/test/__webdav.pl b/karm/test/__webdav.pl
new file mode 100755
index 00000000..b0987575
--- /dev/null
+++ b/karm/test/__webdav.pl
@@ -0,0 +1,57 @@
+#!/usr/bin/perl -w
+
+# This script requires the following Perl modules:
+#
+# $ perl -MCPAN -e 'shell'
+# cpan> install Net::DAV::Server
+# cpan> install Filesys::Virtual::Plain
+# cpan> install File::Find::Rule::Filesys::Virtual
+# cpan> install XML::LibXML
+#
+# The last Perl module needs the libxml2 development libraries installed
+# (the libxml2-dev package on Debian).
+
+use Net::DAV::Server;
+use Filesys::Virtual::Plain;
+use HTTP::Daemon;
+
+# If 1, output request and response headers
+my $DEBUG=0;
+
+my $filesys = Filesys::Virtual::Plain->new();
+$filesys->root_path('/tmp');
+$filesys->cwd('/tmp');
+#print foreach ($filesys->list('/'));
+
+my $webdav = Net::DAV::Server->new();
+$webdav->filesys($filesys);
+
+my $d = new HTTP::Daemon
+ LocalAddr => 'localhost',
+ LocalPort => 4242,
+ ReuseAddr => 1 || die;
+print "Please contact me at: ", $d->url, "\n";
+while (my $c = $d->accept) {
+ while (my $request = $c->get_request) {
+ if ( $DEBUG ) {
+ print qq|------------------------------------------------------------
+REQUEST
+------------------------------------------------------------\n|;
+ while ( ($k,$v) = each %{$request} ) {
+ print " $k => $v\n";
+ }
+ }
+ my $response = $webdav->run($request);
+ if ( $DEBUG ) {
+ print qq|------------------------------------------------------------
+RESPONSE
+------------------------------------------------------------\n|;
+ while ( ($k,$v) = each %{$response} ) {
+ print " $k => $v\n";
+ }
+ }
+ $c->send_response ($response);
+ }
+ $c->close;
+ undef($c);
+}