Sean Reiser

Hi I'm Seán Reiser, this is my Personal Blog

#NewYorker #DrupalDeveloper #InfoSec #Photographer #GEEK #Whovian #MYSTie #LetsGoYankees #LongSufferingJetsFan #NAKnight #Quinquagenarian #CommitAwesome

OK, I’m trying the best way to handle this:

On a Drupal 7 site I had a poor man’s URL shorter.  I create a slug by encoding a node’s NID using an algorithm that wouldn’t contain a vowel.  In hook_boot I’d test to see if there was a vowel and in the URL’s path.  If there wasn’t I’d decode the slug and redirect to /node/nid otherwise Drupal would continue doing its thing.   Since all the content is in English any aliases would contain vowels so I was OK.  It worked well and would redirect before Drupal fully bootstrapped, saving some cycles.

I’m thinking about moving this to Drupal 8.  I’ve been debating between building a module with an event subscriber and just putting the code at the top of settings.php.    Any thoughts or advice please answer on stack exchange.

A quick PHP one liner to calculate US Thanksgiving day. Leaving this for future reference.

    $thanksgiving = date('m d, Y', strtotime('fourth thursday of november '.date('Y')));

Had some tough Drupal 7 deployments to do this evening.  Although things can be a little ore complicated in Drupal 8, I really prefer the built in configuration management.  It certainly makes updates and deployments much easier.