Index: trunk/extensions/Deployment/includes/filesystems/FtpFilesystem.php |
— | — | @@ -457,7 +457,25 @@ |
458 | 458 | * @see Filesystem::makeDir |
459 | 459 | */ |
460 | 460 | public function makeDir( $path, $chmod = false, $chown = false, $chgrp = false ) { |
| 461 | + wfSuppressWarnings(); |
| 462 | + $ftp_mkdir = ftp_mkdir( $this->connection, $path ); |
| 463 | + wfRestoreWarnings(); |
461 | 464 | |
| 465 | + if ( !$ftp_mkdir ) { |
| 466 | + return false; |
| 467 | + } |
| 468 | + |
| 469 | + $this->chmod( $path, $chmod ); |
| 470 | + |
| 471 | + if ( $chown ) { |
| 472 | + $this->chown( $path, $chown ); |
| 473 | + } |
| 474 | + |
| 475 | + if ( $chgrp ) { |
| 476 | + $this->changeFileGroup( $path, $chgrp ); |
| 477 | + } |
| 478 | + |
| 479 | + return true; |
462 | 480 | } |
463 | 481 | |
464 | 482 | /** |
Index: trunk/extensions/Deployment/includes/filesystems/DirectFilesystem.php |
— | — | @@ -418,7 +418,36 @@ |
419 | 419 | * @see Filesystem::makeDir |
420 | 420 | */ |
421 | 421 | public function makeDir( $path, $chmod = false, $chown = false, $chgrp = false ) { |
| 422 | + // Safe mode fails with a trailing slash under certain PHP versions. |
| 423 | + $path = rtrim( $path, '/' ); |
422 | 424 | |
| 425 | + if ( empty( $path ) ) { |
| 426 | + $path = '/'; |
| 427 | + } |
| 428 | + |
| 429 | + if ( !$chmod ) { |
| 430 | + $chmod = FS_CHMOD_DIR; |
| 431 | + } |
| 432 | + |
| 433 | + wfSuppressWarnings(); |
| 434 | + $mkdir = mkdir($path); |
| 435 | + wfRestoreWarnings(); |
| 436 | + |
| 437 | + if ( !$mkdir ) { |
| 438 | + return false; |
| 439 | + } |
| 440 | + |
| 441 | + $this->chmod( $path, $chmod ); |
| 442 | + |
| 443 | + if ( $chown ) { |
| 444 | + $this->chown( $path, $chown ); |
| 445 | + } |
| 446 | + |
| 447 | + if ( $chgrp ) { |
| 448 | + $this->changeFileGroup( $path, $chgrp ); |
| 449 | + } |
| 450 | + |
| 451 | + return true; |
423 | 452 | } |
424 | 453 | |
425 | 454 | /** |