jeremykendall / php-domain-parser

Public Suffix List based domain parsing implemented in PHP
MIT License
1.16k stars 128 forks source link

Cache.php has unchangable directory and file creation permissions #316

Closed Pi-George closed 3 years ago

Pi-George commented 3 years ago

Cache.php line 69 - 77 on version 5.7.2

    /**
     * @var int
     */
    private $dir_mode = 0775;

    /**
     * @var int
     */
    private $file_mode = 0664;

Since these are private, there's no setter, and the class is final. There's no way to change these values. I have a need for www-data to use this cache when it's originally created by root. Can these variables either be made public, have a setter added or the final flag removed from the class?

nyamsprod commented 3 years ago

@Pi-George thanks for using the library. As I understand your issue I think you are using version 5 of this library. If possible I would suggest upgrading to version 6 if you are building a new application.

If this is not possible the Cache class which is shipped with version 5 can be fully changed by using any other PSR-16 implementing library.

The current implementation only offers the bear minimum feature needed for a simple integration. If your application requires a more specific solution I would strongly suggest using a better Cache implementation provided by one of the package above.

And also as this was a source of constant issue and is not really the core of the package the full caching system was revamped to make it clear that even if caching is crucial it should be left to the user to actually handle it.

I hope this clarify your issue

Pi-George commented 3 years ago

Okay thanks, I'll upgrade to version 6 or change to a different PSR-16 cache class