futuresight / futurebb

The forum system by FutureSight Technologies. A live sample can be seen at http://futuresight.org/forums
http://futurebb.futuresight.org
2 stars 2 forks source link

Improved Memory Usage #143

Closed cythral closed 8 years ago

cythral commented 8 years ago

Don't load a file into memory using file_get_contents if you're just going to echo it. Use readfile to directly output contents to the output buffer without touching the memory. also it looks better (less typing). Also fixed a couple messy areas such as retrieving the page info and outputting the content type for png/svg files. Avoid switch statements wherever possible.

jacob-g commented 8 years ago

This broke the home page, but everything else seems to work. I am about to add an exception for that page, as it is a special case.

jacob-g commented 8 years ago

The home page issue has been fixed in commit adfc7fdd98610a474cd0230a595fae43f5d607f2. Thank you for your code!

cythral commented 8 years ago

Good deal, I'll take a look at your other files, its a good dispatcher. I've made a similar one that dispatches multiple websites. Makes life easy doesnt it?

jacob-g commented 8 years ago

Yeah. I had trouble making the URLs and includes work the way I wanted before, and the dispatcher has made it much easier to do that, since I can control exactly how URLs are handled by the server.