-
-
Notifications
You must be signed in to change notification settings - Fork 436
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
fopen() and fclose() missing as public methods for Varien_Io_File class #810
Comments
Which coding standard is triggering this warnings? Because the class does not offer a general safeguard as far as I see |
Hello. This is just an idea for solving OpenMage#810 closes OpenMage#810
I'd actually consider much of this class to be an anti-pattern.. For example the file_put_contents($path.DS.$filename, $data); That's just my opinion. We're happy to consider a pull request, but I don't think putting effort into adding new functionality to this class is something we will personally be spending time on. If you want to use an OO approach to filesystem handling I'd suggest looking at PHP "flysystem" which is probably much better maintained and supports also external file systems like S3. |
The coding standard is MEQP1. In the end, that library uses internally the fopen() method, and offers several common and useful methods. So, why not to add these simple methods? |
Ahh, I see now your motivation more clearly. If it is the marketplace you are concerned about then you should be asking Magento to patch the official version, but that is futile given that M1 is EOL as far as they are concerned. I'm not opposed to accepting your PR, btw, just offering you some alternatives. |
Thanks, @colinmollenhour |
Hi, team.
Congrats for the library Varien_Io_File. It has been useful.
On https://github.com/OpenMage/magento-lts/blob/1.9.4.x/lib/Varien/Io/File.php
many functions helps Magento developers to avoid coding standard notifications about using directly mkdir(), file_exists()...So I have used this library in order to "clean" our project code. And I arrived to the point where I didn't find any function which allow developers replace fopen() and fclose() PHP functions.
And maybe it will be necessary a new method which allows to access the resource returned by the new fopen() function equivalent.
I think this is a need, there is not an equivalent way to access to the returned value for fopen() function. And sometimes, some third party functions/methods use this resource as a param.
Thanks.
The text was updated successfully, but these errors were encountered: