Protocol Relative URLs in Drupal 7

Posted: December 27, 2011 In / 2 Comments

When I first started tackling the problem of https and Drupal caching I wanted an interim solution and started by making the database caching layer smarter. Neil Drumm had the idea to use protocol-relative (a.k.a, schemeless) URLs. This turns out to be a great idea and thanks to some hooks in Drupal it's something we can implement fairly easily. Read more »

Drupal Does Not Respect https:// When Caching

Posted: December 26, 2011 In / 4 Comments

One of the problems I recently discovered with the Drupal cache is that it doesn't properly handle https transactions when caching happens. Let's take a look at understanding the problem, an interim solution for the database cache, and finding a long term solution.

The Problem

page-cache-https-issue.png Read more »

DrupalCamp Michigan Registration Re-Opened

Posted: October 17, 2011 In

DrupalCampMI-2011.pngWhen we first started planning DrupalCamp Michigan we didn't have high expectations for turnout. Southeast Michigan, where the camp is being held, is not known for a large or active Drupal community. When we sold out less than 3 weeks after we had the idea for the camp it was a very present surprise. But, we knew there were more people who wanted to come and an opportunity to reach more people. So, we've added more space and re-opened registration.

Special thanks to Jason Savino for jumping all over this, coordinating with others in the local community (especially Mike O'Connor from the Commerce Guys who was also working on this), and making the extra space happen quickly. Read more »

The First DrupalCamp Michigan

Posted: October 3, 2011 In / 2 Comments

DrupalCampMI-2011.pngThis December 3rd will be the very first DrupalCamp Michigan. Our initial go at a DrupalCamp will be a one day event at the Crowne Plaza in Novi. The event is being sponsored and attended by the local Drupal shops of Commerce Guys, Mustardseed Media, Switchback, and Commercial Progression.

If you're interested in attending head on over to http://drupalcampmi.org for more details and to register. Space is limited. Read more »

The Drupal Community and Front End Performance

Posted: September 20, 2011 In / 9 Comments

Drupal has a presence problem when it comes to front end performance. Drupal has for the most part ignored front end performance. According to a study by Strangeloop, 97% of the time it takes a mobile page to render is in the front end. For desktop browser the front end makes up 85% of the time. These numbers may feel high. But, when pages take 500ms to render in Drupal but 6 seconds to display in an end users browser you can see where this comes from. Read more »

PHP Needs A New Package Manager

Posted: September 13, 2011 In / 6 Comments

After working with Pear, the PHP package manager, recently one thing has become apparent. PHP needs a new package manager. Over the last couple years I've worked with npm, homebrew, and gem which are great package managers for other languages and systems. Using Pear requires extra thought and work as a user, pain for creating packages, and suffering for those handling deployment outside a standard workflow. Read more »

SplFixedArray, An Underutilized PHP Gem

Posted: September 8, 2011 In / 2 Comments

Arrays in PHP are not arrays per the typical array data type. Instead, as Matt Butcher recently pointed out arrays in PHP are similar to hashes in other languages. This can be a very important point to know when tracking down bugs in code and to programmers coming to PHP from other languages. But, what if we wanted something like a traditional array data type? Maybe something that preserved numeric order. Enter SplFixedArray. Read more »

PHP 5.3 Performance: __toString() vs. A Method

Posted: July 20, 2011 In / 2 Comments

Ever since Larry Garfield wrote about PHP magic calls and their slow performance I've been hesitant to use them. In the time since his post was written in 2007, magic methods have seen improvements and I've started taking a look at them again. The first one I've started to explore using in the __toString() method on objects. Read more »

JavaScript Theme Functions in Drupal

Posted: May 16, 2011 In / 5 Comments

Drupal has an extensive theming system which includes theme functions that can be overridden and an extensible template system. There is an expectation that all markup go through the theme system and it is considered a bug when that doesn't happen. Most of the talk surrounding this system focuses on the server side system and what we can do in PHP. But, that's not all there is to the theme system. Drupal provides a theme system for JavaScript as well. One with callbacks that can be overridden by themes, just like on the PHP side. Read more »

Translatable Strings In Drupal JavaScript

Posted: May 2, 2011 In / 1 Comment

Drupal is known for being highly translatable. The localization team has done a fantastic job building out tools to make Drupal translatable and it's rare to find a module that doesn't properly wrap its strings in the t() function or the lesser known format_plural() function. While the Drupal community is doing fairly well on the PHP side, many people don't know there is a translation system for Drupal JavaScript as well through the use of the Drupal.t() and Drupal.formatPlural() functions. Read more »