Repository navigation
Allow setting permissions on downloaded databases - #101
Merged
Merged
Conversation
Add the "permissions" option, it replaces the hardcoded 0755 mode of a downloaded database. The default keeps the previous 0755 value. The YAML parser does not treat "0644" as an octal number since Symfony 5, it returns a string, so the option accepts both the "0644" string and an integer. An integer out of the 0000-0777 range is rejected to catch a decimal value written instead of an octal one. The Downloader interface is untouched, the mode is an optional constructor argument of MaxMindDownloader. The directory of the database is still created with the 0755 permissions, it has to stay traversable. Closes gpslab#88 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #88
Adds a
permissionsoption that replaces the hardcoded0755mode applied to a downloaded database.Notes
0755, so the behaviour without the option is unchanged.0644as an octal number since Symfony 5, it returns the'0644'string. The option accepts the string form as well as an integer, which is what the YAML0o644and a PHP config give. An integer outside of the0000–0777range is rejected, which catches a decimal value written instead of an octal one.0755, it has to stay traversable.Backward compatibility
Nothing is broken:
Downloaderinterface is untouched, so third party implementations keep working;MaxMindDownloadergets the mode as an optional third constructor argument;Tests
165 tests (was 135). Verified locally on the stacks the CI matrix resolves: PHP 7.2 + Symfony 2.8, PHP 8.0 + Symfony 5.2, PHP 8.3 + Symfony 7.4 and PHP 8.5 + Symfony 8.1 — tests and PHPStan green on all of them, PHP CS Fixer clean.
🤖 Generated with Claude Code