Skip to content

Commit

Permalink
Fixed #1619 (#1629)
Browse files Browse the repository at this point in the history
  • Loading branch information
siad007 authored Aug 22, 2021
1 parent 7e6e753 commit 924fe09
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/Phing/Io/FileSystem.php
Original file line number Diff line number Diff line change
Expand Up @@ -395,12 +395,20 @@ public static function deleteFilesOnExit()
public function createDirectory(&$f, $mode = null)
{
if (null === $mode) {
$return = @mkdir($f->getAbsolutePath());
try {
$return = @mkdir($f->getAbsolutePath());
} catch (\Throwable $t) {
$return = false;
}
} else {
// If the $mode is specified, mkdir() is called with the $mode
// argument so that the new directory does not temporarily have
// higher permissions than it should before chmod() is called.
$return = @mkdir($f->getAbsolutePath(), $mode);
try {
$return = @mkdir($f->getAbsolutePath(), $mode);
} catch (\Throwable $t) {
$return = false;
}
if ($return) {
chmod($f->getAbsolutePath(), $mode);
}
Expand Down

0 comments on commit 924fe09

Please sign in to comment.