
Six years ago this month the Zend framework preview was released and Rasmus Lerdorf published a blog post titled “The no-framework PHP MVC framework” (italics added). R. Rajesh Jeba Anbiah noted irony.
I have Matthew Batchelder to thank for introducing me to PHPQuery. I haven’t used it yet, but someday I’ll have need to select text elements from HTML using the PHP5 PEAR module. From the description “server-side, chainable, CSS3 selector driven Document Object Model (DOM) API based on jQuery JavaScript Library.”
Regular Expression Matching Can Be Simple And Fast, by Russ Cox: Perl [and PHP and others] could not now remove backreference support, of course, but they could employ much faster algorithms when presented with regular expressions that don’t have backreferences. How much faster? About a million times (no, I do not exaggerate). I use a [...]
There it is in the PHP manual for return(): Note: since return() is a language construct and not a function, the parentheses surrounding its arguments are not required. It is common to leave them out, and you actually should do so as PHP has less work to do in this case. I knew the parentheses were [...]
This two year old post about Rasmus Lerdorf’s PHP scaling tips (slides) is interesting in the context of what we’ve learned since then. APC now seems common, and it’s supposedly built-in to PHP6. Still, I’d be interested in seeing an update. Are MySQL prepared statements still slow? And that’s where Rasmus’ latest presentation comes in. [...]
Yum up some packages: yum install php-pear php-devel httpd-devel Install APC using pear (the pear installer is smarter than the pecl installer): When the installer asks about APXS, say ‘no’. pear install pecl/apc Tell PHP to load APC: echo extension=apc.so > /etc/php.d/apc.ini Restart Apache: /sbin/service httpd graceful

I’ve been pretty aware of the risks of SQL injection and am militant about keeping my database interactions clean. Mark Jaquith today reminded me about the need to make sure my browser output is filtered through clean_url(), sanitize_url(), and attribute_escape(). Furthermore, we all need to remember current_user_can(), check_admin_referer(), and nonces.
David Cloutman pointed to Craiglist’s job ads as an indicator of programming language popularity. Here’s the hit counts for “web design jobs” and “internet engineering jobs” in the Bay Area: PHP Java Ruby Python PERL internet engineering jobs 167 246 85 98 109 web design jobs 110 71 22 19 31 Cloutman has a [...]
I spoke of this the other day, but now I’ve learned of PHP’s DOM functions, including loadHTML(). Use it in combination with simplexml_import_dom like this: $dom = new domDocument; $dom->loadHTML(’<ul><li>one</li><li>two</li><li>three<ul><li>sublist item</li></ul></li></ul>’); if($dom){ $xml = simplexml_import_dom($dom); print_r($xml); } This IBM developerWorks article has some more useful info.
p0ps Harlow tweeted something about trying to get an AMP environment running on his Mac. Conversation followed, and eventually I sent along an email that look sorta like this: If you’re running 10.4 (I doubt it, but it’s worth mentioning because I’m most familiar with it), here’s how I’ve setup dozens of machines for web [...]
This is how I did it
Posted in Technology | Leave a Comment »