The Boston Diaries

The ongoing saga of a programmer who doesn't live in Boston, nor does he even like Boston, but yet named his weblog/journal “The Boston Diaries.”

Go figure.

Thursday, July 22, 2010

How not to design a PHP web site

I don't even know where to begin.

One of the tasks our team is currently working on for “Project: SocialSpace2.0” is to separate the user uploaded content (images, videos, etc) to its own webserver (what we're calling “the static content”) to make it easier to scale out the site.

My task is to figure out how the content is uploaded to the site. This is not an easy task. The proprietary PHP framework (where have I heard that tale before?) consists of over 400,000 lines of undocumented code (but of course!) spread across 3,000 files (really!) that is a prime example of why object oriented programming can be a Bad Thing™ (early on in the project, I was curious as to how far down the rabbit hole this code went, so I spent some time starting with the topmost PHP file and replacing each require_once() function call with the code it referenced; I stopped after including over 15,000 lines of code and that's before anything is executed).

The automagical code is amazing. Even though I changed

$EO->set_setting('FS_IMAGE_UPLOAD_PATH','uploads/images/ );

which is relative to the DOCUMENT_ROOT and thus, hard to move to its own domain, to

$EO->set_setting('FS_IMAGE_UPLOAD_PATH','/home/spc/tmp/images/');

the content is still save to the old location, thus making it harder to move the content to its own domain.

Going further—the actual upload control on the webpage is a Flash program (lovely), which apparently is controled by some Javascript (oh it's getting better) that is generated on the fly (can you feel the love) and yet still manages to hardcode the destination directory.

Wow! I'm seriously impressed by the previous team's work.

This is going to be painful, I can tell.

Obligatory Picture

An abstract representation of where you're coming from]

Obligatory Contact Info

Obligatory Feeds

Obligatory Links

Obligatory Miscellaneous

Obligatory AI Disclaimer

No AI was used in the making of this site, unless otherwise noted.

You have my permission to link freely to any entry here. Go ahead, I won't bite. I promise.

The dates are the permanent links to that day's entries (or entry, if there is only one entry). The titles are the permanent links to that entry only. The format for the links are simple: Start with the base link for this site: https://boston.conman.org/, then add the date you are interested in, say 2000/08/01, so that would make the final URL:

https://boston.conman.org/2000/08/01

You can also specify the entire month by leaving off the day portion. You can even select an arbitrary portion of time.

You may also note subtle shading of the links and that's intentional: the “closer” the link is (relative to the page) the “brighter” it appears. It's an experiment in using color shading to denote the distance a link is from here. If you don't notice it, don't worry; it's not all that important.

It is assumed that every brand name, slogan, corporate name, symbol, design element, et cetera mentioned in these pages is a protected and/or trademarked entity, the sole property of its owner(s), and acknowledgement of this status is implied.

Copyright © 1999-2024 by Sean Conner. All Rights Reserved.