r68954 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r68953‎ | r68954 | r68955 >
Date:17:20, 3 July 2010
Author:jeroendedauw
Status:deferred
Tags:
Comment:
Work on porting WP filesystem abstraction classes
Modified paths:
  • /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
@@ -117,7 +117,7 @@
118118 * @see Filesystem::changeFileGroup
119119 */
120120 public function changeFileGroup( $file, $group, $recursive = false ) {
121 -
 121+ return false;
122122 }
123123
124124 /**
Index: trunk/extensions/Deployment/includes/filesystems/DirectFilesystem.php
@@ -42,7 +42,24 @@
4343 * @see Filesystem::changeFileGroup
4444 */
4545 public function changeFileGroup( $file, $group, $recursive = false ) {
 46+ if ( !$this->exists( $file ) ) {
 47+ return false;
 48+ }
4649
 50+ // Not recursive, so just use chgrp.
 51+ if ( !$recursive || !$this->is_dir($file) ) {
 52+ return @chgrp( $file, $group );
 53+ }
 54+
 55+ // Recursive approach required.
 56+ $file = rtrim( $file, '/' ) . '/';
 57+ $files = $this->listDir( $file );
 58+
 59+ foreach ( $files as $fileName ) {
 60+ $this->changeFileGroup( $file . $fileName, $group, $recursive );
 61+ }
 62+
 63+ return true;
4764 }
4865
4966 /**

Status & tagging log