Experimental project

This is a sandbox project, which contains experimental code for developer use only.

This module is the initial result of an IRC conversation about replacing PHP filter with something more, umm, secure?

PHP filter has always been a tool of laziness and time constraints, and PHP handler doesn't intend to break tradition. While purists such as myself will always cry out to write a module, Views extension, CCK field type/handler/formatter, Rules event/condition/action, or so on, let's face it; in real-world projects, that can be overkill.

Modulate now exists, but I still think there are a lot of use cases that are not that module's goal to cover.

Writing a bit of PHP to do the job can be more practical. Even more so if, err, other programmers have already done so in a non-Drupal way, stuck it into a node, and you just want to version-control that code with minimal effort.

PHP handler aims to be your solution! It will focus on the eradication of PHP input boxes from anywhere and mandate the use of files to contain PHP. It will still let you be nearly just as lazy (you've probably already created a site-specific customizations module anyway, right? Put it to work!) or just as efficient as usual, but you get a few benefits:

  • Code is real code, so you can version-control it
  • Code is real code, so it can be called with variable functions (and potentially call_user_func/call_user_func_array)
  • Code is real code, so it avoids the use of eval(), which is one thing that will prevent you from running Hiphop PHP and Drupal together
  • Code is real code, so it can be found more easily when you hand over the site to someone else
  • Code is real code, so syntax errors won't break your site in an annoying-to-fix way
  • Code is real code, so clients won't feel as much like changing it on a whim, breaking their sites, and calling you

There's even more cool stuff that could be done. What if you could allow clients to use some custom, PHP-based functionality by way of assigning granular permissions and through drop-downs and other client-friendly interfaces? This is the kind of territory we may get into.

PHP handler is still in its architectural stage and looking for bright minds (and, of course, those who want to kill PHP filter!) to contribute ideas and code.

Read the initial IRC chat.

Check out this neat Four kitchens article about making Drupal more mundane.

Project information