Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 15.35.2 #1100

Merged
merged 1 commit into from
Dec 15, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 16 additions & 18 deletions common/persistence/class.PhpFileDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -260,30 +260,28 @@ private function writeFile($id, $value, $preWriteValueProcessor = null)

/**
* Create directory and suppress warning message
* @param $path
* @param string $path
* @param int $mode
* @return bool
*/
private function makeDirectory(string $path, int $mode)
private function makeDirectory(string $path, int $mode): void
{
if (is_dir($path) || @mkdir($path, $mode, true)) {
return true;
}

if (is_dir($path)) {
\common_Logger::w(sprintf('Directory already exists. Path: \'%s\'', $path));
} elseif (is_file($path)) {
\common_Logger::w(
sprintf(
'Directory was not created. File with the same name already exists. Path: \'%s\'',
if (file_exists($path)) {
if (is_dir($path)) {
$message = sprintf('Directory already exists. Path: "%s"', $path);
} elseif (is_file($path)) {
$message = sprintf(
'Directory was not created. File with the same name already exists. Path: "%s"',
$path
)
);
} else {
\common_Logger::w(sprintf('Directory was not created. Path: \'%s\'', $path));
);
} else {
$message = sprintf('Directory was not created. Path: "%s"', $path);
}
\common_Logger::i($message);

return;
}

return false;
@mkdir($path, $mode, true);
}

/**
Expand Down
Loading