$_data : string
The input data (compiled PHTML).
Provides a Stream Wrapper that reads a special Data-URI.
See the php docs on Stream Wrappers to get to know about this
It allows you to create own URL wrappers and handle them by yourself It works with most of the f*-functions of PHP (fopen, fread, fwrite, INCLUDE(!!!!), etc.)
stream_open(string $uri, string $mode, integer $options, $opened_path) : boolean
This gets called when a url-stream is opened with the wrapper-scheme.
(e.g. fopen('tale-jade://data;...'), INCLUDE('tale-jade://data;...')
the Data-URI this stream was opened with
the stream read/write-mode (useless here)
the flags for this stream instance (useless here)
stream_read(integer $length) : string
This gets called when anything tries to read from this.
(opened) stream (e.g. fread, fgets, fgetcsv, INCLUDE(!!!) etc.)
We return the fitting chunk of our PHTML and add that length of that to our current position so that the next call will read the next chunk, rinse and repeat
the length of the chunk to read