5 ms·
There are cases where you want something silenced. In my code base, there is one place where it is used and I need it there. I frequently use file_get_contents
by maratd 14y ago
There are cases where you want something silenced. In my code base, there is one place where it is used and I need it there.
I frequently use file_get_contents to retrieve data stored on external servers. If there is a network error or the external service goes down temporarily, it will trigger an error. I don't want my log files flooded with transient error messages that are outside of my control. Instead, I just want it to try again. @ makes this possible.
- pavel_lishin 14y agoWe opt to use the curl functions for that.
- maratd 14y agoI understand that decision, but I actively try to remove any extensions that I can do without to keep the PHP binary slim and even more reliable. My personal way of doing things, that's all. file_get_contents can do everything the curl extensions can, provided that you use the context options, so I just use that and remove curl when I compile the PHP binary.