Archive for March 2008

Foo9.net URL Shortening Service Online

Friday, March 21 2008 - 0 comments

Back in October I created my own URL shortening service called Foo9.net. There are lots of them out there already — you can read my reasons for building one myself. Unfortunately, shortly after opening it to the public I had to close down because of spammers abusing the service.

I'm happy to say that Foo9 is back online now thanks to reCAPTCHA. Hopefully this will keep the spammers at bay for the time being.

Incidentally, I can't say enough good things about reCAPTCHA. It took me fifteen minutes — from start to finish — to implement their captcha on the website. That fifteen minutes included signing up for an account, reading their docs, and adding it into my code. Awesome.

Simple PHP Framework 1.0 Beta

Thursday, March 13 2008 - 0 comments

I'm happy to announce we're nearing the release of our first "downloadable" version of the Simple PHP Framework. We've never offered a zipped-up package for download before — users had to access the code via SVN. But after two years of production use it's high time to change that.

Last night I committed a large update that will serve as the basis for our final 1.0 release later this month. This is the Simple PHP Framework after all, so don't expect any drastic changes. Our intentions with this release is to provide a stable branch that users can depend on while we continue to commit bleeding edge code to the SVN head. That said, please send in any outstanding bug reports you may have so we can work them into the final release. An overview of the changes are below.

functions.inc.php

  • human_readable() renamed to bytes2str()
  • added time2str()
  • slugify() improved. Can double-slug a string without problems. Collapses multiple hyphens into a single character.
  • added WEBROOT()

Unit Test Framework

As you can imagine, our testing framework is very simple. Test have been written for functions.inc.php and class.loop.php.

Built-in Tagging Support

  • Most projects seem to require tagging nowadays, so we've baked it directly into DBObject along with a new Tag class.
  • To enable support, set $this->taggable = true in your DBObject constructor.
  • addTag($name)
  • removeTag($name)
  • tags() - Get object's tags
  • tagged($name) - Get objects tagged $name

Auth Class

  • Refactored code
  • Can now impersonate users

master.inc.php

  • Defined WEB_ROOT
  • Cleans up global namespace

Database Class

  • Lazy connecting.

Stylesheets

Removed YUI stylesheet. Instead, the homepage now includes a link to the Y!API hosted reset-fonts-grids.css file. (It's commented out by default.)

Default pages are now linked with a WEBROOT() prefix so they can work in absolute or relative path environments.