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 libreadline5Note: 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.debAwsome!, now you're ready to rock, for help just do this:
create_drupal_mod --helpThough 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 :)
| Attachment | Size |
|---|---|
| drupal-module-builder_1.0.1_all.deb | 43.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