PHP Streams Rock my World!

PHP streams are absolutely amazing. As mentioned by Elizabeth Smith (a great read if you don’t know how to use streams) PHP streams are super powerful. Streams is something that is (to my knowledge) unique to PHP.

The closest thing I’ve seen to it, is Linux’s FUSE “user space” (i.e. not kernel module) file systems; this is how you see things like being able to mount SSH, FTP or Google Mail :-)

Does anybody know of a feature like streams in any other language? I’m just curious :-)

I’d love to see if it’s possible to pass something like “s3://some/file/path” to any native file IO function and have it query Amazon’s S3 storage in Ruby, or Java, or Python – odds are there are nice APIs for this, but you can’t switch those out easily in place of native file storage.

For me, being able to do something like the following is simply mindblowing:

[php]
// Config.php
// Default is "file://", use "s3://" for Amazon S3, "ftp://" for a remote FTP site, "phar://" for a PHP Archive etc
$storage_engine = "file://";

// img.php
readfile($storage_engine . "/the/requested/file.ext");
?>
[/php]

- Davey

P.S.
I’m working on something that uses streams and is hopefully even cooler than PHP_Archive, look for an alpha soon

Comments are closed.

Twitter

BAM! I just unlocked the White Hat cap on @mojolive! http://t.co/GWVUht8R

@dshafik [2 weeks ago]

@rdohms @weierophinney especially here in Florida.

@dshafik [2 weeks ago]

@Arkantoze yeah, but NOT RIGHT OUTSIDE THE FRIGGEN DOOR

@dshafik [2 weeks ago]

@dshafik cool looking spider web!

@Arkantoze [2 weeks ago]

@dshafik Very pretty… and remember, spiders eat other insects…

@weierophinney [2 weeks ago]

Books & Things

Search

Archives

Tags