Commandline tool for Drupal Module Development on Debian/Ubuntu

Sick of repeating the same steps every time I wrote a custom module for a project, I decided to write a simple script that generated the base structure for creating a Drupal module.

Being a developer who likes to make stuff take less time by spending ages on the tools that make it take less time, I extended the simple script and turned it into a debian package.

So! I give to you! a debian package to easily download and install on your Ubuntu or Debian machine and start using this great tool.

Firstly you need to some stuff that makes the tool work: php5-cli and libreadline:

sudo apt-get install php5-cli libreadline5

Note: if you use a 64-bit system, you may need lib64readline5 instead of libreadline5
Then you need my awesome tool (version 1.0.1). Download it and install like so:
sudo dpkg -i drupal-module-builder_1.0.1_all.deb

Awsome!, now you're ready to rock, for help just do this:

create_drupal_mod --help

Though the basic deal is you run the script create_drupal_mod then it will ask you a bunch of questions like 'What is the name of you module?' and 'What hooks are you going to implement?' - Its all pretty straight forward stuff, really easy to use.

I will try to keep this tool up-to-date, but, if you do want to checkout the the code from the source (which is executable, cause its PHP) then you can do through github. Checkout http://github.com/fiasco/Drupal-Module-Builder/tree/master
You will of course need to know how to use git to check it out.

Patches Welcome :)

AttachmentSize
drupal-module-builder_1.0.1_all.deb43.16 KB

Please remove <code>.. from

Please remove <code>.. from teaser. It's spoiling the markup on Drupal planet.

That is a bug with in planet

That is a bug with in planet Drupal, that evenif I did take it out, would not fix planet Drupal. Sorry.

The code issue is messing up

The code issue is messing up your blogs front page as well. It's where the teaser is splitting it that looks to be the problem. Anyplace that shows (on your site included) it's breaking the formatting.

I've added the HTML

I've added the HTML correcting filter, hopefully this should fix the problem for the future, apologies for messing up planet.drupal.org

That is a bug with in planet

That is a bug with in planet Drupal, that evenif I did take it out, would not fix planet Drupal. Sorry.

No, it takes a few hours before aggregator module on drupal.org fetches updated feed contents.

Want to integrate it into

Want to integrate it into drush? Would fit perfectly, and save the hazzle of installing yet another one-off tool. Would also save you quite some code (e.g. providing help and dealing with arguments).

I noticed that there already

I noticed that there already is a tool that is suppose to do this in Drush. However it doesn't looked to well maintained, also does Drush have tab completion? This is one of the key features of this tool for listing which hooks to implement.

Nice. I will certainly use

Nice. I will certainly use it. Facilitates a lot!

I've got still one question though. I looked into your code and I still wonder how to create an install file/package for debian/ubuntu. Do you have a guide/tutorial for this? It would be nice if you shared this. Thanks!

Oh yeah!, sorry I should

Oh yeah!, sorry I should document this. Once you understand the code in create_drupal_mod, if you wich to make a change and complie it into a deb to install on you're computer, you can just type 'make' in the root directory (I'm assuming you check this out from git).

The deb I've uploaded here is actually a ready to go script not really make to be altered, though you can add futher hooks in /var/lib/drupal_module_builder/apis/6 and you can alter the script in /usr/sbin/create_drupal_mod.

There is already a very

There is already a very established module that does this very well, with both a web and command line interface:
http://drupal.org/project/module_builder

I would suggest you look at merging your efforts :)

Interestingly I just posted a

Interestingly I just posted a feature request on code generation layers for module in Drupal. Like to hear your thought about it.

http://drupal.org/node/533192

Nice. I will certainly use

Nice. I will certainly use it. Facilitates a lot!
I looked into your code and I still wonder how to create an install file/package for debian/ubuntu. Do you have a guide/tutorial for this? It would be nice if you shared this. Thanks!.William from best web hosting company.

you should be able to just

you should be able to just execute 'make' in the root directory and the debian package will build.

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <h2><h3><h4><a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <p> <div> <span>
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • Glossary terms will be automatically marked with links to their descriptions. If there are certain phrases or sections of text that should be excluded from glossary marking and linking, use the special markup, [no-glossary] ... [/no-glossary]. Additionally, these HTML elements will not be scanned: a, abbr, acronym, code, pre.
  • You may insert videos with [video:URL]

More information about formatting options