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

Fix unlink no such file or directory #2675

Merged
merged 1 commit into from
Jan 13, 2023
Merged

Fix unlink no such file or directory #2675

merged 1 commit into from
Jan 13, 2023

Conversation

luigifab
Copy link
Contributor

@luigifab luigifab commented Nov 6, 2022

Description

Sometimes, when a folder is removed, an error occurred.

bug-unlink-deleteFolder

OpenMage 20.0.16 / PHP 8.0.25

Contribution checklist

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All automated tests passed successfully (all builds are green)

@github-actions github-actions bot added Component: lib/Varien Relates to lib/Varien Component: lib/* Relates to lib/* labels Nov 6, 2022
@elidrissidev
Copy link
Member

Cool website 👀 😉

@@ -377,6 +377,7 @@ public function rmdir($dir, $recursive = false)
*/
public static function rmdirRecursive($dir, $recursive = true)
{
$result = true;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since unlink was returning false when it can't find the file, shouldn't we switch this to false?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there are nothing to remove, I think it's good to return true.

@fballiano fballiano merged commit 2d96091 into OpenMage:1.9.4.x Jan 13, 2023
@fballiano
Copy link
Contributor

merged and cherrypicked to v20

@luigifab luigifab deleted the no-such-file branch January 14, 2023 08:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: lib/Varien Relates to lib/Varien Component: lib/* Relates to lib/*
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants