I don't much care for PHP, always using perl in the old days when given the choice, but I sure do wish the PHP I've had to work with over the years looked like this. I don't even care how it works yet, just looking at how well its laid out makes me feel like I can figure it out without much trouble. The comments and variable names alone start to draw me into the "story" as soon as I pop open a file. We don't say it e…
Show HN: Virtual File System in PHP
21–28 of 28 posts
Re: Show HN: Virtual File System in PHP
#22Earlier quoted context omitted.
Oh I see. I wish PHP had visibility for classes, oh well. Do you know what I do, I put everything that's not meant to be used by "the public" in sub-namespace "Internal". So, say "Vendor\Project\..." for public classes and "Vendor\Project\Internal\..." for volatile internal matters. This means there's no confusion about what people should use, and what's just the guts of the system they shouldn't mess with.
I personally think it's neater to mark the class with an @internal PHPDoc tag rather than add a sub-namespace. http://phpdoc.org/docs/latest/references/phpdoc/tags/interna...
In terms of neatness and ease of use, I choose like I'd choose how to optimize code - I focus on the parts that get most use. Users of a library are hopefully way more than its maintainers, so it feels like it's worth slightly inconveniencing the maintainers in order to have an instantly clear public interface.
Re: Show HN: Virtual File System in PHP
#23https://github.com/thornag/php-vfs
Similarly, I've been trying to make it behave just like the native functions under unix environment. Think the basic assumptions are the same.
Re: Show HN: Virtual File System in PHP
#24I 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…
Hm, I wonder if I can marry this with Flysystem ( https://github.com/thephpleague/flysystem ) so I can use PHP builtin functions rather than being tied to their API. Maybe I'll give it shot!
Re: Show HN: Virtual File System in PHP
#25Re: Show HN: Virtual File System in PHP
#26Earlier quoted context omitted.
Hm, I wonder if I can marry this with Flysystem ( https://github.com/thephpleague/flysystem ) so I can use PHP builtin functions rather than being tied to their API. Maybe I'll give it shot!
You can use PHP built-in functions. Check out the readme. The API is shown alongside using functions like file_put_contents and require.
Re: Show HN: Virtual File System in PHP
#27What is that gif from?
Re: Show HN: Virtual File System in PHP
#28That animated GIF is awesome.