Skip to content

Conversation

@snapshotpl
Copy link
Member

This pr make installation simple as possible and make middleware ready to use out-of-box. Solution for #2

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better: create a new stream instance and pass it to the response on creation. When creating the stream instance, give it the path to the file:

$stream = new Stream($fullPathToFile, 'r');
$staticResponse = new Response($stream);

That way you don't have any memory overhead from reading the file, and keep I/O down to a minimum.

@weierophinney
Copy link
Contributor

I like it! Let me know when you've merged and tagged, and I'll update the expressive docs (as I have detailed the copy + baseUrl method currently).

@snapshotpl
Copy link
Member Author

Thanks for advice! I will merge it tomorrow.

snapshotpl added a commit that referenced this pull request Jan 9, 2016
Autoload static files without copy/paste
@snapshotpl snapshotpl merged commit e9b7f6d into master Jan 9, 2016
@snapshotpl snapshotpl deleted the autoload-static-files branch November 14, 2016 08:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants