Quick PHP caching

I received a question today:

I have some quick caching questions. What is the quickest way to get data into a PHP script? I have some data, I could store it in a database, but I want to avoid that dependency and slow down. I want PHP to compile the file into some data that it can access easily in the script’s name space. Periodically (every 1-2 mins) the system will check the modified time on the file, if it is different, it will reload the data.

The data is not large.

Speaking of caching, what is the best script system for caching these days APC?

Continue reading

PHP coders

I get e-mails often of companies looking to hire me or find a hot-shot front-end Ajax-style PHP coder. It’s very difficult to help and I don’t know who to recommend.

My policy is to cast a wide net and then grill the people in interviews until they break in order to see where their real knowledge is. Others can’t be so luxurious because they’re not me. Anyone who can string a web page together with MySQL can (and often does) call themselves a “front-end PHP coder.” The variance in quality is very high, so high that I often recommend a good solid C programmer over a PHP one, because the former can learn PHP if need be.

The problem here is this doesn’t work well for a front-end UI developer because the web is a tricky business.

Ben mentions a different problem. What should the going rate of such a person be?Continue reading

Big Trouble in Little OSCON

It turns out two of my talks have been accepted at OSCON this year.

OSCON 2k6 speakers

They are “0 to 60 in 45 minutes: A Down and Dirty Ajax Design Patterns firedrill” in the new AJAX track and “The Underpants Gnomes Strategy Guide: An Ecards Case Study” in the PHP track.

Given my penchant for working on my talk during the conference, I figure I am royally screwed this time. How am I supposed to cram two talks worth of slides during OSCON week? Does this mean I’ll actually have to prepare my talk beforehand? *shudder*

I knew I should have submitted my MAMP talk (Mac Apache MySQL PHP). That one has been rejected for six different conferences in a row.Continue reading

Building Liquid Websites with PHP

Okay because Apple upped my iDisk quotas, I’m putting up my OSCON talk there temporarily. Caitlin finished producing this talk last month, but I haven’t seen it because I can’t stand the sound of my own voice.

production Silver Keys Studio
video source HD and Keynote
size 104.8MB
run time 50 minutes, 32 seconds
format H.264 (Quicktime 7 required to play movie— free download)

You should: Right click-download this link or click on the image below.

Continue reading

PHP Security, the oxymoron

Well now that some of you have met me from OSCON, you are probably thinking to yourself, “What’s the deal with your blog? There is no PHP in there, you poser.”

How true.

I better start writing some stuff, before they kick me out of the “all-star PHP line up”.1

I think that when most people hear “PHP” and “security” used in the same sentence, it seems about as out-of-place as, say, putting “Rasmus” and “Terry” in the same sentence. Basically this thread summarizes how most people view PHP security.

I suppose the first thing I need to do in order to defend the honor of PHP is say that these losers have their own agenda: foisting Java or dotNet as “real” and “enterprise”2, or perhaps they’re just sore because PHP book sales are going up at their expense.

Nothing works better than a good ad hominem, I always say.

Well I suppose for the three of you left unsatisfied with my deconstruction, I should go through the tedious task of addressing the actual complaint which boils down to:

  1. “PHP has the worst security history of any language.”
  2. “PHP shoves a mess of shit into the global namespace” (or other assorted digs on register globals).
  3. “PHP doesn’t have the concept of a prepared statement.”
  4. “PHP security cures (magic quotes, safe mode, stripslashes) are sometimes worse than the disease.”

Continue reading

Sparklines

Sparklines

Bill mentioned that Edward Tufte has posted a chapter from his new book, Information Design about how good information design can distill multiple parameters into immediately comprehensible and intuitive information (sounds like his other two books).

<blockquote

“Also check-out Page 6, where he displays the win/loss record for an entire season for the Baltimore Orioles (162 games) inline with the text. Also notice how he uses just one additional color (red) to highlight unique data. This is great stuff.”
—Bill Tani
Continue reading

“God’s Own” AppleScript?

AutomatorAbout a year ago, when Tiger was in Public Beta, Thies told me to check out Automator. I didn’t get around to it because Thies is in the habit of saying things like, “Skype is God’s Own phone.” When everything is “God’s Own” X, then saying something like, “Automator is cool” isn’t going to get me jumping onto BitTorrent, especially since I never grokked AppleScript.

Earlier this year, I gave a talk in Vancouver. After Cal, the lead developer of Flickr, complimented me on it, I decided to see his talk. Okay, so his doesn’t have cool Keynote transitions like mine, but in terms of content, it totally rocks. What he and Ludicorp were able to do building Flickr is textbook case of why LAMP rules in the right hands. Go see his talk! I was impressed.

I registered for Flickr.

Continue reading