10 Aug

Switching from Mollom to Disqus: The aftermath

A while back, I stated here that I was switching from Drupal comments with Mollom to Disqus comments. Here are my preliminary results. First, AFAIK, I currently have no spam on my blog comments. Second, on an average day, I get about 4-5 spammish comments that I need to delete. Third, overall my legitimate comments are down, too. I get <1 a day. That may just be because I don't write anything inflammatory anymore. More likely, it's due to the higher barrier of entry. The net result: Disqus is far more manageable for me.

27 Jul

PhpDocumentor vs. Doxygen: Five Reasons I like Doxygen Better

in doxygen, php, phpdocumentor, programming

I like the fact that PhpDocumentor is implemented in PHP. I like that it has a mature feature set, and has a long history of support. But when it comes to generating API documentation from PHP, I am preferring Doxygen these days. Here are five reasons why.

26 Jul

PHP Arrays are NOT Arrays

in drupal, php, programming

I'm continually surprised by PHP programmers who argue tooth and nail that a PHP "array" is a "real array". These same programmers, who often program in at least one other language (JavaScript), seem confused over what an array is and how it ought to work. (One even referred to collections classes in other languages as "needless bloat," a telling symptom of this misunderstanding.) Conversely, new PHP developers who come from other languages are often confused by the fact that PHP arrays don't work as expected. Strange things happen to array ordering and such. The confusion can be cleared up at the terminological level. The simple fact is that PHP arrays are not arrays in the traditional sense. They are ordered hash tables. I will explain with several examples.

29 Jun

Testing Disqus Comments and Dealing with Spam

in spam

I have been inundated with Spam, with peaks of 1,400+ spam requests per day. I'm experimenting with various work-arounds. Mollom has not helped enough, so I'm trying Disqus and Akismet. Right now I have disabled old comments and enabled Disqus. This means old comments are no longer available. I might do a migration in the future, but during my testing phase, I don't think it's worth it.

So if your pithy comment is currently not available, please don't be offended. Blame the evil comment spammers... or my ineptitude.

07 Jun

Drupal Easy, Episode 59

in drupal, php

Yesterday, I had the privilege of hanging out with Ryan and Mike from DrupalEasy. We had a great time talking about recent changes in Drupal 7's bug release cycle, DataTables, Schema.org and other stuff. We talked a little about the Aloha Editor, too -- a project my friend Henry Bergius is involved in.

Two years ago I was on DrupalEasy talking about my Drupal 6, JavaScript, and jQuery book. This time we talked about Drupal 7 Module Development. I figure I might as well plan now on doing an episode in two years on a Drupal 8 book.

26 May

Sqlite: Database is Locked error and unlocking the database

in drupal, sqlite

On a few occasions, my Drupal sites that use SQLite have gotten into various states where Drupal was locked out with an error that reads something like this:

PDOException: SQLSTATE[HY000]: General error: 5 database is locked

Usually this happens after a server crash of some sort. As I understand it, the issue is that a lock was acquired by the process that died, but the lock was never removed. Unfortunately, I have found no obvious way to find and remove the lock. But there is a way to eliminate all of the locks.

22 Apr

TextMate Wishlist: Five features I wish TextMate had

in programming, textmate

I love TextMate. I've pretty much given up on IDEs in favor of TextMate's simple yet powerful code editing. I think I've written upwards of nine bundles, some of which are available at my GitHub repo. TextMate one of the few applications that is always running on my Mac.

But there are a few things that I wish TextMate had. Nope -- they're not the usual "I want more code completion" features. They're more generic requests; things that I imagine would improve my day-to-day workflow.

01 Apr

Drupal Without Functions: A Proposal for D8

in dont believe everything you read, drupal, php, programming

Drupal 8 is in the early stages of planning, and I have a proposal to add -- a proposal which, if implemented, would make Drupal the first of a new breed of faster, leaner, meaner and simpler web applications. Now is the time to grab the bull by the horns, and steer fate.

In my tireless fight against unnecessary complexity, I have argued in the past that OO and Drupal do not mesh well. But upon further reflection, I have come to see the bigger picture. Drupal's number one hinderance is it's reliance upon an antiquated abstraction called the function. And only when we completely eliminate userland functions will Drupal be able to entirely fulfill its true potential.

Let me give an example of a function anti-pattern that appears throughout the Drupal codebase. In the following code sample, I show the fundamental way that previous versions of Drupal have gone astray.

16 Mar

Analyzing Xdebug Trace Files: Tools we use to parse and examine Xdebug trace files

in drupal, php, xdebug

During DrupalCon Chicago 2011, I mentioned that we collect Xdebug trace files and analyze them to identify performance bottlenecks and other issues in our PHP code. Some of the Xdebug tracing tools we wrote in-house. As promised, we have now released two of our Xdebug tracing tool suites: ValaXdebugTools and XdebugUtils.

Read on for a description of each of these two tools.

11 Feb

Read This: 100 Things to Watch in 2011

JWT Intelligence has some pretty interesting predictions about what's gonna be big this year. Here's their slideshare deck, which I found inspirational.