- Interfaces for streams wrappers (clean up apis) - primarily userland, small to no BC
- Resources -> objects (engine storage and attachment) - primarily core, some BC issues
- finish implementations for callbacks - primarily feature addition
- async IO features (see: jpauli) - feature addition with core implications and some BC issues
- curl:// stream wrapper - feature addition (functionality of --with-curl-wrappers but with curl:// as prefix)
- filtering api - buckets hard to use, user_filter class is api possessed - userland and BC
- factory registration for wrapper creation - feature addition
- ability to plug into transports from php land instead of requiring C extensions
Streams Interfaces:
Rough draft of initial interfaces for stream and stream features
https://github.com/auroraeosrose/streams-exercises/blob/usage-examples/interfaces.php
I'm not attached to names - but current implementation drops on top of current PHP streams wrapper implementation
Why is stream open not the constructor? Several reasons
- streams are creating via factory - you'd want a NEW object for each file opened or http connection made - that's how OOP works
- you need control over opening/closing a stream - you may want to do so several times with the same stream
- for RAII the destructor should detect if the stream is open and close it
For those that don't quite understand how wrappers and wrapper registration is designed to work conceptually when you register a wrapper you're registering a DEFINITION of a stream - you're registering a CLASS when you use the stream somewhere in PHP (say, for example, file_get_contents) PHP uses the definition (class) to create a new stream resource (object instance) - it injects any parameters (context) that you've given into the stream class- the context is available in all methods in teh stream class
Allowing for registration of a factory callable along with your stream would simplify global injection of parameters without requiring setting of default context + merging of default + specific context in userland code
Awesome - so yes bring him in if you want, new ideas welcome... I guess I need to do a blog post or something about how streams wrappers conceptually map to objects - just with a REALLY ick pre-nice php objects way