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

Don't create cache directory in constructor + Fix nested directory permissions #88

Merged
merged 4 commits into from
Jan 11, 2025

Conversation

vjik
Copy link
Member

@vjik vjik commented Jan 10, 2025

Q A
Is bugfix? ✔️
New feature?
Breaks BC?

@vjik vjik added the status:code review The pull request needs review. label Jan 10, 2025
@vjik vjik requested a review from a team January 10, 2025 15:45
Copy link

codecov bot commented Jan 10, 2025

Codecov Report

Attention: Patch coverage is 92.85714% with 1 line in your changes missing coverage. Please review.

Project coverage is 91.19%. Comparing base (71ddc00) to head (acc0a36).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
src/FileCache.php 92.85% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master      #88      +/-   ##
============================================
+ Coverage     91.13%   91.19%   +0.05%     
+ Complexity       72       69       -3     
============================================
  Files             1        1              
  Lines           158      159       +1     
============================================
+ Hits            144      145       +1     
  Misses           14       14              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

src/FileCache.php Outdated Show resolved Hide resolved
src/FileCache.php Outdated Show resolved Hide resolved
}

$result = !is_file($path) && mkdir(directory: $path, recursive: true) && is_dir($path);
mkdir($path, recursive: true);
Copy link
Member

Choose a reason for hiding this comment

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

Wouldn't it fail in case of race condition? is_dir + mkdir is not an atomic operation.

Copy link
Member Author

Choose a reason for hiding this comment

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

It will. Race condition don't fixed in this PR. I make it next PR.

vjik and others added 2 commits January 10, 2025 19:21
Co-authored-by: Alexander Makarov <sam@rmcreative.ru>
Co-authored-by: Alexander Makarov <sam@rmcreative.ru>
@vjik vjik requested a review from samdark January 10, 2025 17:04
@vjik vjik merged commit c4fcb8f into master Jan 11, 2025
23 checks passed
@vjik vjik deleted the improve branch January 11, 2025 12:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:code review The pull request needs review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants