cvs: pear /HTTP_WebDAV_Server/Server Filesystem.php

From: Date: Sat, 16 Apr 2005 22:32:21 +0000
Subject: cvs: pear /HTTP_WebDAV_Server/Server Filesystem.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-31207@lists.php.net to get a copy of this message
hholzgra Sat Apr 16 18:32:21 2005 EDT Modified files: /pear/HTTP_WebDAV_Server/Server Filesystem.php Log: whitespace fix http://cvs.php.net/diff.php/pear/HTTP_WebDAV_Server/Server/Filesystem.php?r1=1.11&r2=1.12&ty=u Index: pear/HTTP_WebDAV_Server/Server/Filesystem.php diff -u pear/HTTP_WebDAV_Server/Server/Filesystem.php:1.11 pear/HTTP_WebDAV_Server/Server/Filesystem.php:1.12 --- pear/HTTP_WebDAV_Server/Server/Filesystem.php:1.11 Mon Apr 4 02:28:38 2005 +++ pear/HTTP_WebDAV_Server/Server/Filesystem.php Sat Apr 16 18:32:20 2005 @@ -325,11 +325,11 @@ // sanity check if (!file_exists($fspath)) return false; - // is this a collection? - if (is_dir($fspath)) { - return $this->GetDir($fspath, $options); - } - + // is this a collection? + if (is_dir($fspath)) { + return $this->GetDir($fspath, $options); + } + // detect resource type $options['mimetype'] = $this->_mimetype($fspath); @@ -348,48 +348,48 @@ return true; } - /** - * GET method handler for directories - * - * This is a very simple mod_index lookalike. - * See RFC 2518, Section 8.4 on GET/HEAD for collections - * - * @param string directory path - * @return void function has to handle HTTP response itself - */ - function GetDir($fspath, &$options) - { - // fixed width directory column format - $format = "%15s %-19s %-s\n"; - - $handle = @opendir($fspath) or return false; - - echo "<html><head><title>Index of ".$options['path']."</title></head>\n"; - - echo "<h1>Index of ".$options['path']."</h1>\n"; - - echo "<pre>"; - printf($format, "Size", "Last modified", "Filename"); - echo "<hr>"; - - while ($filename = readdir($handle)) { - if ($filename != "." && $filename != "..") { - $fullpath = $fspath."/".$filename; - printf($format, - number_format(filesize($fullpath)), - strftime("%Y-%m-%d %H:%M:%S", filemtime($fullpath)), - htmlspecialchars($filename)); - } - } + /** + * GET method handler for directories + * + * This is a very simple mod_index lookalike. + * See RFC 2518, Section 8.4 on GET/HEAD for collections + * + * @param string directory path + * @return void function has to handle HTTP response itself + */ + function GetDir($fspath, &$options) + { + // fixed width directory column format + $format = "%15s %-19s %-s\n"; + + $handle = @opendir($fspath) or return false; - echo "</pre>"; + echo "<html><head><title>Index of ".$options['path']."</title></head>\n"; + + echo "<h1>Index of ".$options['path']."</h1>\n"; + + echo "<pre>"; + printf($format, "Size", "Last modified", "Filename"); + echo "<hr>"; + + while ($filename = readdir($handle)) { + if ($filename != "." && $filename != "..") { + $fullpath = $fspath."/".$filename; + printf($format, + number_format(filesize($fullpath)), + strftime("%Y-%m-%d %H:%M:%S", filemtime($fullpath)), + htmlspecialchars($filename)); + } + } + + echo "</pre>"; - closedir($handle); + closedir($handle); - echo "</html>\n"; + echo "</html>\n"; - exit; - } + exit; + } /** * PUT method handler

« previous php.pear.cvs (#31207) next »