Alternative title: What every new Drupal developer should know Over the past few years I've been teaching various Drupal classes ranging from introductory courses to module development courses for seasoned developers. In fact what lit a fire under me to write up this entry was an upcoming course I'm doing with Chapter Three December 14-18th in San Francisco. I'm my classes nearly every student has asked me a variation of the same question; What do I need to know? If the student was a beginner I'd point them to one of the numerous Top X Drupal modules, such as Lullabot's Top 80, or direct them to review the awesome site showcases up on drupal.org. If the student was a developer (or aspiring developer) the answer was never as concrete. I would explain the concept of a hook, rattle off a few hooks I thought were important, point them to greggle's (or GVS's?) awesome Cheat sheet, tell them about t(), hook_menu, explain how db_query() worked, and then direct them to http://api.drupal.org. Being the geek I am this wasn't good enough for me so I set out to find out what the top hooks and functions were. I wanted something concrete.
I broke out my terminal and used CVS to checkout every module on drupal.org that was listed as stable for Drupal 6 (those in a DRUPAL-6 branch), 3,308 modules. I then wrote a quick and dirty BASH script that went through every function sorting, counting, and ultimately discovering what the most heavily used hooks were. I wrote this script over a year ago at a time when I was living behind the great firewall of China, which made blogging, twittering, and other fun Internet activities a frustrating experience, which is why I have not posted this sooner.
The next 12 significant implementations are:
Most Utilized Functions
My curiosity then led me to answer the question: What are the most frequented used functions in a Drupal module?
For the curious here are the BASH commands I ran to discover this information The completely inefficient but written in roughly ten minutes BASH script I used to discover the top hooks was: --count_functions.sh--
#!/bin/sh
module_dir="/Users/jredding/Downloads/contributions/modules"
for module_name in `find $module_dir -name *.info|xargs basename |awk -F.info '{print $1}'`
do
grep -hr "function * ${module_name}_" *|awk -F${module_name}_ '{print $2}'|awk -F"(" '{print $1}'
done
I then piped the output through sort |uniq -c |sort -nBe aware that this method takes a very long time to process, roughly three to four hours. I later modified the script to the following, which only took about seven minutes to run:
functions_tmp=/tmp/all_functions.txt
module_dir="/Users/jredding/Downloads/contributions/modules"
grep -hR "^function *" modules/* > $functions_tmp
for module in `find $module_dir -name *.info|xargs basename |awk -F".info" '{print $1}'`
do
grep -h "function * ${module}_" $functions_tmp |awk -F${module}_ '{print $2}'|awk -F"(" '{print $1}'
done
rm $functions_tmp
~
Of course I could probably save more time if I saved the data to two arrays and did all of this searching/sorting in memory instead of performing literally thousands of disk hits. I'll save that for another day.
To discover every function used I ran the following command:
find ./modules/ -exec awk '/[a-9]\(/ { for (i = 1; i <= NF; i++) printf "%s\n", $i }' {} \; |awk '/[a-9]\(/ {print}'|awk -F\( '{print $1}' |sort |uniq -c |sort
A few interesting statsI found the following stats interesting.
Raw DataTags:
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
As the first major budgeting process the Association undertook it was a bit of a long and mildly painful process. However we work out the kinks, set our goals, priorities and creating awesome working teams. Check out the newly published 2009 budget!. As always if you see something interesting and want to get involved contact us. |
|||
Another Drupalcon has come and gone but our work is not over. A dedicated team is actively at work on Drupalcon Paris and another team is being formed to put on Drupalcon 2010. Drupalcon is built by and is for the community. They are what you want them to be. Help us shape the future of Drupalcon by taking a few minutes to answer the questions in the Drupalcon Survey. Thanks to every one of the over 1,400 people that showed up in D.C, I hope that we can top that number in Paris and then again in 2010! |
|||
Are you presenting at Drupalcon D.C? Rock it! Drupalcon D.C is nearly upon us and the registration is slammed shut full. The D.C team found extra room released a few more tickets and hired white gloved people to shove everyone into rooms Japanese Subway style. This is going to be the largest and most packed Drupalcon ever. This is your chance to address hundreds and thousands of Drupalers about your module/API/technique/process or <Insert name of your session >. Put your best foot forward and rock your session. You were chosen to speak because you are an expert in your subject and people want to hear your thoughts, opinions and to learn from you. You were also chosen because you have an ability to convey yourself well and understand the time and other constraints imposed when speaking at a conference. With just two weeks left now is a good time to start practicing and getting ready for your session. The Drupalcon D.C team and Emma Jane have graciously stepped up to help you out. The day before the conference Emma will be hosting a session entitled "Presenting You!", all presenters ( seasoned or not) should try to attend. Presenting You! will go over techniques to overcome nervousness and maintain your collective self while on stage and being stared at by hundreds of eyeballs (not to mention cameras, phones, voice recorders, etc.). She'll will also give you tips on managing your time and controlling the presentation so that you use all of your time effectively. The session description also has great resources to help you prepare your slides as well as your talk. You don't have to wait until Drupalcon to get ready. If you haven't already present your session to your local Drupal meetup. Give it a good once through to work out any kinks. Your local community will appreciate it and you'll learn the nuances that can take your session from good to great. You may also consider attending your local Toastmasters to brush up on your public speaking skills if its been a while. Drupalcon is a success because of YOU. These resources are here to help you become the best presenter you can be and leave the audience wanting to know more. See you at Drupalcon! |
|||
TIme has flown by, its been almost a year since I ran for and was elected to the board of the Drupal Association. Over the past year I have been performing the duties of Event manager for the Drupal Association. In that time I worked to create and refine processes for Drupalcon as well to lay the foundation for supporting Drupalcamps and Drupal meetups around the world. Although I didn't accomplish everything I had set out to, for example I never sent buttons around to Drupalcamps, I did accomplish a few key items around Drupalcon that will help to ensure the success of Drupalcon for years to come. A big part of me wants to continue in this position for another year so that I could accomplish the goals I set out to when I started. However the prudent part of me says that its time to get some fresh blood into the position. I don't want to go too far away though. I have submitted my application for Treasurer. Why Treasurer? While serving as the events manager over the past year a sizable chunk of my time was spent on financial and business related matters. For example the legal entities surrounding Drupalcon as well as the receivables/payables accounts that arose from the conferences. These were a natural byproduct of the escalated size of the conferences. . Drupal has expanded rapidly in the past few years and the donations to the Association have also grown as rapidly. It became clear to me that some serious time needs to be dedicated to ensuring that the Association's accounts are managed properly and efficiently. To this point they have been managed beautifully by the current Treasurer, Dries Knapen, but his time has come to end. After successfully obtaining his PhD he has wisely decided to concentrate time on his research and work leaving a void in the current position. I hope to use my educational and work experience background, in accounting and finance, to fill this void and ensure the success of the Drupal Association. Call for a new events manager As I want to switch my position within the Association it leaves an excellent opportunity for the new events manager. One of my primary goals is to not only ensure a smooth transition to the newly elected individual but also to work with that individual to establish processes that create a sustainable position. This includes creating documentation and processes to successfully transfer knowledge, introduce them to the community, partners and key individuals so that the new events manager is not only prepared for their tasks but also so that external individuals are not confused by the transition and are ready to work with the new board member. The goal is to create continuity within the Association. My application for Treasurer |
|||

