Category Archive for 'PHP'

PHP UTF-8 string class

Friday, August 6th, 2010

A couple years ago I put together a class for UTF-8 strings, kind of a smart wrapper around Harry Fuecks’s phputf8 string functions. All Utf8String objects—if I’m not missing bugs!—are guaranteed to house valid UTF-8 strings. The factory, make(), enforces UTF-8 validity, stripping non-UTF-8 bytes (default) or replacing them with Utf8String::$replacement (? by default).
$str = [...]

MVC: M != the Database

Wednesday, July 14th, 2010

Great article on the misunderstood scope of the “Model” in the Model-View-Controller architecture. The takehome: Models are commonly thought of as wrappers for database access/stored objects, but application state and business logic need to go in them, too. Otherwise you get bloated controller and/or views that clumsily try to take care of these concerns.
Earlier today [...]

Hit the Shands Cafeteria

Wednesday, June 9th, 2010

When I worked in the HPNP building, friends and I frequented the Shands cafeteria. Their painful menu page drove me to hack together a nicer version with accompanying RSS feed. It still works!

Rough code to prevent Shibboleth-related Firefox Lockouts

Friday, May 7th, 2010

Reason this might be useful.
/*
* Remove all _shibstate cookies if there are too many of them. This usually
* occurs due to Firefox session restores. Unfortunately we don’t know which is
* the active state cookie, so we have to delete them all, but this is a lessor
* crime than locking the user [...]

Google’s School for Hackers

Thursday, May 6th, 2010

Google is offering programmers their own personal sandbox application—called Jarlsburg—and hints of how to exploit the common vulnerabilities purposefully left in it. Although Google is basically walking folks through how to attack apps, publicizing this info is a necessary evil in order to build safer programmers. We have to start thinking of each line of [...]

Elgg, ElggChat, and Greener HTTP Polling

Saturday, April 3rd, 2010

At my new job, we maintain a site powered by Elgg, the PHP-based social networking platform. I’m enjoying getting to know the system and the development community, but my biggest criticisms are related to plugins.
On the basis of “keeping the core light”, almost all functionality is outsourced to plugins, and you’ll need lots of them. [...]

SQL Server 2008, Domain Auth, PHP5, Ubuntu Server

Thursday, January 28th, 2010

May this save you pain.

Configuring Sendmail for UF’s SMTP

Friday, January 15th, 2010

Our Ubuntu web host, hosted with OSG, was not able to send mail (using PHP mail) outside of UF. An OSG tech said our From: header should be a valid address at UF (check) and that the logs at smtp.ufl.edu showed those messages never made it there.
The solution was to configure sendmail to use smtp.ufl.edu [...]

Minify 2.1.3 released

Tuesday, June 30th, 2009

This is how I spend my time off? I squashed a few more bugs and got Minify 2.1.3 finally out the door. It fixes a few HTTP bugs, including working around a Safari/webkit bug that was preventing efficient cache usage. There’s also code to make it far easier to diagnose users’ URI rewriting problems when [...]

Miško Hevery Programming Talks

Monday, June 29th, 2009

Miško Hevery gave several presentations at Google last year that are worth checking out, I think even if you’re familiar with Dependency Injections and unit testing. They cover the ways that global state can sneak into applications, how undeclared dependencies make classes harder to test and reuse, and how DI in general eases a lot [...]