7. Doubles in size each
release
source: http://acko.net/blog/drupal-org-explosion-and-trends source: http://buytaert.net/drupal-site-statistics
8. Statistics
• 840+ code contributors
• 160+ local user groups
• 430+ attendees at Drupalcon Barcelona
• 200,000+ users on drupal.org
• 3 million+ lines of code (core+contrib)
• 52 SoC mentors for 20 students
• 100,000+ downloads/month
10. xml-rpc
file api jquery
database abstraction layer form
api file api session management node
system url routing theme system string
handling filter system content versioning
installation profiles access control trans-
latable output user system caching
date/time handling unicode support mail
handling image manipulation installation
system hook system menu system
module system user authentication
themable output
12. Core
• Lightweight framework
Drupal Core
• Library of common Content User
Forms API
Management Management
functions
Install Theming
•
Localization
Allows Drupal to Profiles Layer
bootstrap and serve a
request
Library of Common Functions
• What you get when you
download Drupal
13. Modules
Drupal Core
Content User
Forms API
•
Management Management
How Drupal is extended
Install Theming
Localization
•
Profiles Layer
Lean and mean and
versatile
•
Library of Common Functions
Inversion of control design
pattern
Modules
• Actions/ Content
Drupal exposes hooks Ecommerce
Workflows Creation Kit
for modules
Organic
Views
Groups
Custom
Module
14. INSTALL.txt index.php themes
install.php update.php modules
sites xmlrpc.php includes
17. Yes
Is site Return
offline? MENU_SITE_OFFLINE
No
Get menu array
Is callback No
Parse $path from Trim last '/' from
defined for
$_GET['q'] $path
$path?
No
Does callback Return
function exist? MENU_NOT_FOUND
User allowed
No Return
to access this
MENU_ACCESS_DENIED
item?
Marshall parameters
from URL and item's Call callback
callback arguments
20. How Drupal Finds Hooks
/**
* Determine whether a module implements a hook.
*
* @param $module
* The name of the module (without the .module extension).
* @param $hook
* The name of the hook (e.g. quot;helpquot; or quot;menuquot;).
*/
function module_hook($module, $hook) {
return function_exists($module .'_'. $hook);
}
21. Naming Hooks
Module Hook Function name
pants user pants_user()
pants menu pants_menu()
pants perm pants_perm()
24. FormAPI
• Form elements are PHP arrays so you can
programmatically manipulate any form
• Chain validator and submitter routines
• Theme overrides - down to the element!
• Built-in security
25. Form Example
$form['user_name'] = array(
'#title' => t('Your Name'),
'#type' => 'textfield',
'#description' => t('Please enter your name.'),
);
$form['submit'] = array(
'#type' => 'submit',
'#value' => t('Submit')
);
26. Security
• Verifies that $_POST values have
corresponding $form elements
• Form rendering sanitized for potential XSS
• $form[‘token’] used to prevent CSRF