Skip to content

Instantly share code, notes, and snippets.

@daniel-sc
Created November 3, 2014 09:59
Show Gist options
  • Save daniel-sc/68b34f38eaabd97d28ef to your computer and use it in GitHub Desktop.
Save daniel-sc/68b34f38eaabd97d28ef to your computer and use it in GitHub Desktop.
Extend Flightphp to stream file
Flight::map('stream', function($resource){
Flight::response()->sendHeaders();
while ($buf = fread($resource, 1024)) {
echo $buf;
ob_flush();
flush();
}
exit(0);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment