Index: trunk/extensions/Deployment/includes/filesystems/FtpFilesystem.php |
— | — | @@ -169,7 +169,35 @@ |
170 | 170 | * @see Filesystem::delete |
171 | 171 | */ |
172 | 172 | public function delete( $path, $recursive = false ) { |
| 173 | + if ( empty( $path ) ) { |
| 174 | + return false; |
| 175 | + } |
| 176 | + |
| 177 | + if ( $this->isFile( $path ) ) { |
| 178 | + return (bool)@ftp_delete( $this->connection, $path ); |
| 179 | + } |
| 180 | + |
| 181 | + if ( !$recursive ) { |
| 182 | + return (bool)@ftp_rmdir( $this->connection, $path ); |
| 183 | + } |
| 184 | + |
| 185 | + // Recursive approach required. |
| 186 | + $path = rtrim( $path, '/' ) . '/'; |
| 187 | + $files = $this->listDir( $path ); |
173 | 188 | |
| 189 | + $success = true; |
| 190 | + |
| 191 | + foreach ( $files as $fileName ) { |
| 192 | + if ( !$this->delete( $path . $fileName, $recursive ) ) { |
| 193 | + $success = false; |
| 194 | + } |
| 195 | + } |
| 196 | + |
| 197 | + if ( $success && $this->exists( $path ) && !@ftp_rmdir( $this->link, $path ) ) { |
| 198 | + $success = false; |
| 199 | + } |
| 200 | + |
| 201 | + return $success; |
174 | 202 | } |
175 | 203 | |
176 | 204 | /** |
Index: trunk/extensions/Deployment/includes/filesystems/DirectFilesystem.php |
— | — | @@ -145,7 +145,7 @@ |
146 | 146 | $success = true; |
147 | 147 | |
148 | 148 | foreach ( $files as $fileName ) { |
149 | | - if ( !$this->delete( $path . $fileName, $owner, $recursive ) ) { |
| 149 | + if ( !$this->delete( $path . $fileName, $recursive ) ) { |
150 | 150 | $success = false; |
151 | 151 | } |
152 | 152 | } |