Show HN: Virtual File System in PHP
github.com
Show HN: Virtual File System in PHP
1–10 of 28 posts
Re: Show HN: Virtual File System in PHP
#2It's been used before as part of a mustache template runtime evaluator and in test suites.
Current issues:
- Test coverage is okay but could definitely be improved (currently ~60%)
- Symlinks
- Proper support for perms/ACL
If anyone's got any feedback or wants to contribute, go ahead.
Re: Show HN: Virtual File System in PHP
#3I know PHP isn't the "coolest" of languages around, but I thought I'd just show my project I started a few years ago and never really got around to finishing. It's been used before as part of a mustache template runtime evaluator and in test suites. Current issues: - Test coverage is okay but could definitely be improved (currently ~60%) - Symlinks - Proper support for perms/ACL If anyone's got any feedback or wants…
Many projects make the same mistake. The registry/service locator/DI container or whatever flavor you prefer should be an application concern.
Applications should create this for themselves, and not every library having its own registry just for instances of its own classes.
Similarly you have factories and builders which wrap a constructor and don't add or change anything. You can remove some of that code and focus on the essence of your library. This way it might gain more supporters and contributors.
Re: Show HN: Virtual File System in PHP
#4Re: Show HN: Virtual File System in PHP
#5I know PHP isn't the "coolest" of languages around, but I thought I'd just show my project I started a few years ago and never really got around to finishing. It's been used before as part of a mustache template runtime evaluator and in test suites. Current issues: - Test coverage is okay but could definitely be improved (currently ~60%) - Symlinks - Proper support for perms/ACL If anyone's got any feedback or wants…
I didn't have time to review the project in detail, but one thing that made an impression on me is having a registry in there. Many projects make the same mistake. The registry/service locator/DI container or whatever flavor you prefer should be an application concern. Applications should create this for themselves, and not every library having its own registry just for instances of its own classes. Similarly you hav…
The registry in this library, however, isn't meant to be a registry used outside of the internals of the library. It's an unfortunate side effect of trying to marry up object instances with PHPs static stream wrapper API.
Re: Show HN: Virtual File System in PHP
#6Re: Show HN: Virtual File System in PHP
#7Re: Show HN: Virtual File System in PHP
#8I am curious, what is the point of using something like this?
Re: Show HN: Virtual File System in PHP
#9Re: Show HN: Virtual File System in PHP
#10How does this compare to vfsStream[1]? I've used that in the past for mocking in unit tests. Does this offer anything more than vfsStream? [1]: https://github.com/mikey179/vfsStream
I believe that the implementation is truer to the behaviour of how these builtin functions behave with a unix FS. Amongst some other subtleties, here's some examples:
- vfsStream simply ignores handle modifiers (except for +)[1]
- some effort has gone into showing where errors were triggered in userland code[2]
- node types are represented as `fstat` would see them[3] rather than using simple types[4]
vfsStream works perfectly fine, but if you want to use it more with testing file system operations; the closer you are to a true environment the better. Obviously this project isn't quite there yet, but it should be once a few issues have been ironed out.
[1]: https://github.com/mikey179/vfsStream/blob/master/src/main/p...
[2]: https://github.com/adlawson/vfs.php/blob/master/src/Logger/P...
[3]: https://github.com/adlawson/vfs.php/blob/master/src/Node/Sta...
[4]: https://github.com/mikey179/vfsStream/blob/master/src/main/p...