Destructionator XIII wrote:
Eh, not really. When I do cgi in C, I just recreate the little pieces I need as I need them. I do have some CGI stuff in the D language, but I keep hacking it up and breaking it, so that's not redistributable either. Though, FastCGI and CGI aren't the same thing anyway...
The issue is I would actually need to write it and be competitive with -and more stable than- php+APC-stat. Flup is neither stable enough nor fast enough to handle thousands of connections per second on my server.
PHP, actually, is.
There's fastcgipp, but that was designed for integration with mod_fcgid. PHP's raw fastcgi overhead is actually significantly less than the difference between Apache and nginx.
For PHP, what I find most hilarious are the people who layer shit on top of it. Ever used the Smarty template system? why God?! WHY?!
I tried to. It's ostensibly to allow end users to do semi-code level things with some level of security.
I think I'll just whitelist allowable css elements and unicode points, myself.
I've been dealing with this php shit for a client for months now. The client paid like $2000 for a license to this fucking thing - for that kind of money, you'd expect it to be decent, right? Wrong, it's PHP!
There is a vBulletin plugin to Sphinx search that costs $2k. It is only marginally more impressive than the one built for SMF. The one the phpBB team built is a joke, and who does the phpBB dev blame?
Sphinx's author.
Insane.
On the top level, the code is spaghetti, of course. Things are repeated all over the place - every single file in it has about 80 lines of the same boilerplate, only slightly different each time. (Functions? What are they for?) Every function it does have starts with a long list of globals - about 15 of them. Among them is a database class... that just wraps the built in mysql library, obfuscating the myriad sql injection holes.
What's really annoying is that mysql(i)_real_escape_string still has a major security hole, as no widely used cms's database wrapper uses prepared statements and all of the major forum softwares encourage utf8 conversion.
Which means the database's default character set may be latin1, but if the forum/cms owner got convinced to use utf8 tables,
every single one of those forums is vulnerable to SQL injection via unicode code points. Because none of them know about prepared statements.
The Internet functions because smart people are not in general evil.
Seriously.
Then, there is this retarted, utterly worthless Smarty thing. All it does is duplicate the one thing PHP itself does reasonably well, but with more slowness. You add a pile of boilerplate to the PHP to use it... then the template just has more embedded PHP! And of course, repeated instances of nested tables all over.
How the fuck did something this messed up pass review? Easy - it didn't have review!
In the time I've wasted trying to work around the shit and deal with the repeated bloat, I could have just rewritten the thing from scratch myself. But noooo, we must reuse existing code!
It's faster to write code than to read it. A very important distinction that I like to remind clients of.
Fortunately, for my current major project, the only person I answer to is me.
Give fire to a man, and he will be warm for a day.
Set him on fire, and he will be warm for life.