arthur's blog

Now With More Register

In the interest of creating a faster registration process based off of this post, here's some prototyped code that changes the user/register form into an email form and allows for immediate user creation. Actually this is just used right on top of Login Toboggan and assumes that the setting for register immediately is on. This is a quick (and hopefully simply and somewhat "secure") way to implement this functionality. First alter the registration form to use the users email address.

Once Again, Configuration Matters- or Don't Assume APC is Doing You Favors

APC Status

A classic unhealthy cache- high miss rate and high fragmentation.

When people talk about performance and Drupal it is rare to not hear APC get mentioned. It is probably the must have performance solution for Drupal. Which makes sense- it's easy to install, effectively reduces the time it takes to load all of the .module, .php, and .inc files, and is usually enable and forget. Basically an easy win.

And yet as I'm about to point out, every article you will ever read about performance should tell you that you need to analyze what you're doing before you assume you've made things better.

KCachegrind Redux

kcachegrind

KCachegrind- or in this case QCachegrind- has a great visulaization of the call graph.

There are a number of tools that are quite wonderful for investigating PHP's call stack. I am rather fond of KCachegrind (which I suppose makes me a bit nostaglic). Having regretfully followed Apple's upgrade path I have found myself without KCachegrind. The instructions that I wrote previously for installing KCachegrind on OSX no longer work because Fink's KDE packages are unfortunately not ready for 10.7+.

Happily there is a fairly painless way to work around this. This post is where I started from. Basically it eshews using KDE and instead just installs the QT libraries to run KCachegrind. This makes the process much less time consuming and seemingly less prone to dependency issues. I had to change a few things so I've repeated the steps here, however credit goes to Paul Kehrer for the direction.

  • Download QT and install it. I used 5.0 beta version and seems to work fine.
  • Install Graphviz.  I used fink -b install graphviz
  • Download KCachegrind from: http://kcachegrind.sourceforge.net/html/Download.html
  • Unpack KCachegrind and navigate into the directory and into qcachegrind. I used qmake-4.8 -spec macx-g++; make
  • open qcachegrind.app should open up the application. You can move it to your Applications directory if you want.
  • I modified my xdebug settings in php.ini to use: xdebug.profiler_output_name = callgrind.%R.%t This lets KCachegrind open the grind files without having to select the "All Files (*)" option. There is a patch metioned here: https://gist.github.com/1029580 that lets KCachegrind open any file type though I think this has actually been applied to current releases. Plus, if you change the output file name I think this is somewhat moot.

Faster Registration?

How do you reduce the barrier to becoming an authenticated user in Drupal? There are a few goto solutions: Email Regiatration, Login Toboggan, captcha on the user registration form, etc. These are effective and well tested solutions that allow new users to register and reduce the threat of bot registrations. Single signons with Facebook or Twitter are also viable options and arguably reduce the barrier with the lowest risk. Unfortunately they require third party account which doesn't meet the need for a user who wants an account only on your site. 

In my mind Login Toboggan offers an interesting solution to this issue by creating a specific role for a user that can be created and logged in but not given full rights until they confirm their registration. Where it doesn't lower the barrier is that it still requires creating a username and password during account creation. 

The thought experiment here is how much of the registration form can we strip away to get a user created without out overly risking bot registrations. Since email addresses are for the most part unique, is it possible to use only an email address to create an account without a username or password? The following is a flow chart that this kind of registration might use with a nod to Email Registration module. Proto code forthcoming.

Pages