I don't want to require the use of an AccessMode class, but I want it to maybe be an option? Or maybe IO\Stream uses it internally? Think about it...
[x] Write new CSVelte\IO\Resource class
[x] Add __invoke() method so that calling it as a function returns the underlying stream resource (it calls $this->getResource() Actually now it opens the resource if it isn't opened/connected and then returns the IO\Stream object.
[ ] Is it possible to implement __sleep() and __wakeup() on this thing?
[ ] What about __toString()? What would that do? My guess would be that either there isn't a meaningful way to convert it to a string, OR return string representation of underlying resource OR return URI (but this last one doesn't even come close to representing the entire stream resource as a string so I dont like #it)
[x] Figure out where stream_get_meta_data goes
[ ] Unit testing - this is a surprisingly complex class. It is going to need a significant amount of unit testing in order to be considered safe to use.
[ ] Test uses of __invoke()
[ ] Documentation
[ ] API Docs (thorough docblock comments)
[ ] RTD User's Guide documentation - add a section to the streams guide
Check out how they are doing their access mode in this class:
https://github.com/binsoul/io-stream/blob/master/src/AccessMode.php
I don't want to require the use of an AccessMode class, but I want it to maybe be an option? Or maybe IO\Stream uses it internally? Think about it...
CSVelte\IO\Resource
classAddActually now it opens the resource if it isn't opened/connected and then returns the__invoke()
method so that calling it as a function returns the underlying stream resource (it calls$this->getResource()
IO\Stream
object.__sleep()
and__wakeup()
on this thing?__toString()
? What would that do? My guess would be that either there isn't a meaningful way to convert it to a string, OR return string representation of underlying resource OR return URI (but this last one doesn't even come close to representing the entire stream resource as a string so I dont like #it)stream_get_meta_data
goes__invoke()