Drupal development environment

You are here

As a Drupal click monkey I came away from Drupalcon Sydney determined that I was going to contribute back to Drupal in some way. The big push in the community is to help with core development and the issue cues if you are able. But to a new Drupaler it is like looking at a mountain you need to climb and the only tool you have is a toothpick. I was listening to a Drupalise.me podcast that was discussing contributing back to the community, what I found interesting about the conversation was when they started to contribute it was like looking at a mountain to climb and only having a toothpick. I was not alone it seems. These two points made me more determined that ever.  At this stage I think I will need to warn all new Drupalers out there that there is a market for Drupal *Nicorette* patches, once you start down this path it is very quick and easy to get addicted to Drupal and you do strange things that geeks love  =) .  The Drupal community are working hard on fixing the issues newbies have when contributing to the community tools like Drupal ladder and different podcasts can be very helpful. With all the inspiration you can get I knew there is a time in every little Drupalers life they need to start being big and brave and, ahem, do it for themselves. Before landing in the issue queues trying to work out this monolith I decided to try and document the process, here it is..

 

My Drupal development module environment

Firstly lets start with the basics. To create any sort of software you need a plan, a software repository, bug-tracking tool and a development environment to write and test the code. After some searching around drupal.org I found this page contributed modules for developers it gives you a list of modules that a developer can use in assisting in the development of Drupal, and the one tool I always use is Xdebug in conjunction with Netbeans. But for this first small project it has a very specific goal - use Drupal tools to create Drupal code. Git is a given of course and the development environment only needed to install a Drupal build with the following modules installed to help me devel, coder, libraries, and testing to install them I used Drush but below for anyone new I have given both examples.

 

How to install Drupal testing module

The testing module was the easiest to install it comes with Drupal core. Once installed you can run tests on all the core modules if you like to see how it works. A warning it takes forever to do a test this could have something to do with my development environment granted but I have not worked out how to fix this. To enable it from the command line move to the root directory of your Drupal build and use the Drush command (if you have it installed),

drush en simpletest

Or to enable via the web interface you can go to the url  <url>admin/modules and look for the testing module in core packages

 

Drupal devel libraries coder module

The devel module is used to see what the code is doing when developing a website and in conjuction with the coder module which checks to see if your code is spaced and commented properly, I found them an amazing tool in assisting in the development of the coded entity. You will also need the libraries module for the coder module as it depends on it to check your code. To use the web interface instead of using Drush download the modules from drupal.org and uncompress them then place them into <site_directory>sites/all/modules/contrib. But if you have Drush installed the commands below will make life very easy.

drush dl coder //download module
drush dl devel
drush dl libraries

To install them all using Drush or the web interface are both an option

drush en coder //enable module
drush en devel 
drush en libraries

then again got to  <url>admin/modules  and enable the modules

This has now setup the environment so that I can code module.  In the next post I will work on how to create a coded entity I know that you can click your way through the Drupal web UI but I wanted to understand how Drupal standards work and Drupal 7 and 8 uses Entities in them extensively.