Index: trunk/extensions/Deployment/includes/filesystems/FtpFilesystem.php |
— | — | @@ -224,14 +224,16 @@ |
225 | 225 | * @see Filesystem::exists |
226 | 226 | */ |
227 | 227 | public function exists( $file ) { |
228 | | - |
| 228 | + $list = @ftp_nlist( $this->connection, $file ); |
| 229 | + return !empty( $list ); |
229 | 230 | } |
230 | 231 | |
231 | 232 | /** |
232 | 233 | * @see Filesystem::getChmod |
233 | 234 | */ |
234 | 235 | public function getChmod( $file ) { |
235 | | - |
| 236 | + $dir = $this->listDir( $file ); |
| 237 | + return $dir[$file]['permsn']; |
236 | 238 | } |
237 | 239 | |
238 | 240 | /** |
Index: trunk/extensions/Deployment/includes/filesystems/DirectFilesystem.php |
— | — | @@ -185,14 +185,16 @@ |
186 | 186 | * @see Filesystem::exists |
187 | 187 | */ |
188 | 188 | public function exists( $file ) { |
189 | | - |
| 189 | + return @file_exists( $file ); |
190 | 190 | } |
191 | 191 | |
192 | 192 | /** |
| 193 | + * FIXME does not handle errors in fileperms() |
| 194 | + * |
193 | 195 | * @see Filesystem::getChmod |
194 | 196 | */ |
195 | 197 | public function getChmod( $file ) { |
196 | | - |
| 198 | + return substr( decoct( @fileperms( $file ) ), 3 ); |
197 | 199 | } |
198 | 200 | |
199 | 201 | /** |
Index: trunk/extensions/Deployment/includes/Filesystem.php |
— | — | @@ -117,7 +117,7 @@ |
118 | 118 | public abstract function getOwner( $file ); |
119 | 119 | |
120 | 120 | /** |
121 | | - * Returns file permissions. |
| 121 | + * Returns file permissions. |
122 | 122 | * |
123 | 123 | * @param string $file Path to the file. |
124 | 124 | * |