APC: get a key's expiration time

It’s always surprising to me, but APC is still the best kept secret. APC offers a bunch of very useful features — foremost a realpath cache and an opcode cache. However, my favorite is neither: it’s being able to cache data in shared memory. How so? Simple: use apc_store() and apc_fetch() to persist data between requests. The other day, I wanted use a key’s expiration date to send the appropriate headers (Expires and Last-Modified) to the client, but it didn’t seem like APC supports this out of the box yet....

November 8, 2010 · 1 min

PHP SDK for Amazon Web Services

Yesterday, Jeff Barr announced Amazon’s own PHP SDK for their web services — own, because AWS hired CloudFusion’s lead developer earlier this year (in March) and I guess after a while they decided it was time to incorporate his open source efforts into the company. The full story is on getcloudfusion.com. So what? What’s more than just pretty interesting about all of this, is that not only is the AWS PHP SDK hosted on Github (bonus points for sure), but since it implements almost the entire API of all infrastructural services and is backed by the API provider, this library currently presents the most feasible way for PHP developers to work with AWS....

September 29, 2010 · 2 min

Google Chrome: useful extensions for developers

While Chrome likes to emphasize how speedy it is, it is also sometimes a pretty bare-metal browser. But all the speed comes at an expensive — Chrome is doing less out of the box, which some people will say means, “Chrome is focusing on the essentials”. So because I’m thankful for said speedyness and overall painlessness, I also realize how I little extra bells and whistles I really need for a great browsing experience....

September 22, 2010 · 2 min

Debugging Zend_Test

Sometimes, I have to debug unit tests and usually this is a situation I’m trying to avoid. If I have to spend too much time debugging a test it’s usually a bad test. Which usually means that it’s too complex. However, with Zend_Test_PHPUnit_ControllerTestCase, it’s often not the actual test, but the framework. This is not just tedious for myself, it’s also not the most supportive fact when I ask my developers to write tests....

September 20, 2010 · 3 min

Find space hogs and prettify output using AWK

I really love awk. You might disagree and call me crazy, but while awk might be a royal brainfuck at first, here’s a very simple example of its power which should explain my endorsement. Figuring out space hogs Every once in a while I run out of diskspace on /home. Even though I am the only user on this laptop I’m always puzzled as of why and I start running du trying to figure out which install or program stole my diskspace....

September 18, 2010 · 3 min