Skip navigation.

Syndicate

Syndicate content

User login

wordpress

PHP Sucks

My work on a tool to migrate Drupal content to Wordpress’ eXtended RSS (‘WXR) led me into some dusty corners of the WordPress codebase, and I’ve been meaning to write a grumpy post about how much I hate PHP (in which Wordpress is written), but Jeff Atwood at Coding Horror beat me to it with his own PHP sucks lament. Like me, Jeff wonders at the success of PHP given what a dreadfully sucky software engineering tool it is, and scratches his head at the many major Internet properties (Wikipedia, Digg, and Wordpress among them) which are successful notwithstanding an implementation in a language a VB6 programmer might reasonable call “shit”.

Interestingly, though, Jeff and I arrived at two different conclusions on the matter. Jeff surmises:

Some of the largest sites on the internet — sites you probably interact with on a daily basis — are written in PHP.

Requirements for Drupal migration tool

After my flash of insight I’ve decided to build a tool to help me migrate apocryph.org away from drupal.

Requirements are:

  • Work with my Drupal configuration
  • Not so tightly coupled to my Drupal configuration that no one else can use it
  • Output posts in a neutral format that users can post-process and import into other tools
  • Preserve all the important elements of each post, including:
    • Formatting. Most posts are in Markdown, and a few are in SmartyPants. Those must be converted to XHTML using the same rules which generate the markup in Drupal
    • Files. A few of my posts have files attached, usually images but sometimes other stuff. Those files must be preserved themselves, and any references to the files from within a post (like IMG or A elements) must be preserved as well
    • Metadata. The tags, author, timestamp, published/unpublished flags must be preserved
    • Links.

Added a virtual host to Apache and installing WordPress on FreeBSD

Recently I had cause to set up a WordPress blog engine on a virtual host on bonzo. My experience follows:

First I need to set up DNS for the domain. The owner of the domain used the registrar’s control panel to set the authoritative nameservers to ns1.afraid.org through ns4.afraid.org, which are the nameservers provided by FreeDNS.

Next, I log into my FreeDNS account, add the new domain to my domains, and point the domain and www. to bonzo’s IP address. I don’t have mail setup yet, so I’ll ignore the MX record for now.

Now, querying the domain in a web browser should bring me to my site on bonzo…sure enough, it does.

Syndicate content