r68960 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r68959‎ | r68960 | r68961 >
Date:18:35, 3 July 2010
Author:jeroendedauw
Status:deferred
Tags:
Comment:
Work on porting WP filesystem abstraction classes
Modified paths:
  • /trunk/extensions/Deployment/includes/Filesystem.php (modified) (history)
  • /trunk/extensions/Deployment/includes/filesystems/DirectFilesystem.php (modified) (history)
  • /trunk/extensions/Deployment/includes/filesystems/FtpFilesystem.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Deployment/includes/filesystems/FtpFilesystem.php
@@ -224,14 +224,16 @@
225225 * @see Filesystem::exists
226226 */
227227 public function exists( $file ) {
228 -
 228+ $list = @ftp_nlist( $this->connection, $file );
 229+ return !empty( $list );
229230 }
230231
231232 /**
232233 * @see Filesystem::getChmod
233234 */
234235 public function getChmod( $file ) {
235 -
 236+ $dir = $this->listDir( $file );
 237+ return $dir[$file]['permsn'];
236238 }
237239
238240 /**
Index: trunk/extensions/Deployment/includes/filesystems/DirectFilesystem.php
@@ -185,14 +185,16 @@
186186 * @see Filesystem::exists
187187 */
188188 public function exists( $file ) {
189 -
 189+ return @file_exists( $file );
190190 }
191191
192192 /**
 193+ * FIXME does not handle errors in fileperms()
 194+ *
193195 * @see Filesystem::getChmod
194196 */
195197 public function getChmod( $file ) {
196 -
 198+ return substr( decoct( @fileperms( $file ) ), 3 );
197199 }
198200
199201 /**
Index: trunk/extensions/Deployment/includes/Filesystem.php
@@ -117,7 +117,7 @@
118118 public abstract function getOwner( $file );
119119
120120 /**
121 - * Returns file permissions.
 121+ * Returns file permissions.
122122 *
123123 * @param string $file Path to the file.
124124 *

Status & tagging log