ics-parser
ics-parser copied to clipboard
Decouple file download from "file" call
Hey everyone,
great parser, and thank you for development. I have problem using file to download external resources by PHP configuration allow_url_fopen=0. Do you think about decouple the download logic from PHP internal file function? Some ideas...
- Move the fileOrUrl function to a separate class for easier handling/overwriting/patching this class for external developer
- Or using a widespread lib like Guzzle to handle the download to support multiple download options (curl, file, custom handler)
- Or using a interface based HTTP client abstraction like https://docs.php-http.org/en/latest/httplug/library-developers.html to develop against an interface (fallback could be your current function), so consumers of your lib could add the adapter-client of their choice without touching/patching you lib.
Regards, Tim
Hi Tim, happy for you to take this forwards and develop a PR for @s0600204 and I to take a look at. I think option 1 is likely the best option.
Please feel free to reopen if/when you'd like to submit a PR.