3 ms·
It's an interesting exercise, although the first downside I noticed of the "one file" mantra is that all of the CSS is served inline in every response. Also, y
by cfinke 14y ago
It's an interesting exercise, although the first downside I noticed of the "one file" mantra is that all of the CSS is served inline in every response.
Also, you may want to consider handling MySQL errors in a manner other than just printing it to screen along with the query. At the very least, log them somewhere where you'll be alerted of the error. As a user, seeing "MySQLi Error: [...]" doesn't help me or you.
It'll be interesting to see if you continue the project and how far you take its functionality. Some of my co-workers were just today discussing the tendency to want to rewrite a system from scratch in order to simplify it and avoid any problems with backwards compatibility, only to slowly find yourself rewriting the "unnecessary" features from which you were trying to escape.
- samuellevy 14y agoThe CSS isn't actually that large. The entire home page (CSS included) is about 4-5KB. The analytics code from google is three times the size of the rest of my page. What MySQL error did you run in to? You're right that I should probably hide & log them, but at this stage logging is a low priority. I'll add it in later on. This is built largely for personal use, so I'll only implement features that I feel I actually need, and even then they may not all make it into the main code base.
- cfinke 14y agoI didn't encounter any errors; my comments were just from browsing the source.
- lostsock 14y agoThe CSS doesn't have to be inline. You can use a regular HTML stylesheet link with the SRC looping back to the same index.php file with a different GET value and a CSS header that serves the CSS. http://phpfm.sourceforge.net/ http://phpfm.sourceforge.net/ does something similar (A file manager in a single file)