“Drupal is written in PHP, which is uttterly offensive to people.” H o r r i b l e T r u t h 1.

Slides:



Advertisements
Similar presentations
Drupal in the Enterprise
Advertisements

MEMCACHE FOR BIGINNERS
A brief overview of Drupal 7 By Robin Isard, Systems Librarian Algoma University.
1.  Understanding about How to Working with Server Side Scripting using PHP Framework (CodeIgniter) 2.
Seattle Drupal Clinic Introduction to Drupal and Web Content Management.
Management Reporter By Zara Beckstein/Matt Saad. Basic Navigation Similar to GP 2013 R2 windows, there is a Navigation Pane in the lower left. This will.
Drupal Online Tutorial A Product of an ENGL 421 class at Purdue University Page 1.
Introduction to Module Development Yi Zhang & Nikki Massaro Kauffman.
Our aims ease the pain – for all our users get with the times better communication with our supporters recruit and engage people to our campaigns raise.
Drupal Blocks David Manela, Mark Ritzman, Chad Campbell.
What is it? –Large Web sites that support commercial use cannot be written by hand What you’re going to learn –How a Web server and a database can be used.
Publishing your Events with Views & CCK SandCamp 2011 January 8-9, 2011 John Romine (jromine) publishing-your-events-views-cck.
Drupal Create a website/web app quickly with this Content Management System Jiaying Xu Spring 2011 COMS E6125 Web-enHanced Information.
Online Magazine Bryan Ng. Goal of the Project Product Dynamic Content Easy Administration Development Layered Architecture Object Oriented Adaptive to.
Justin Klein Keane Drupal Training Session 1 Introduction to Drupal.
Drupal Workshop Introduction to Drupal Part 1: Web Content Management, Advantages/Disadvantages of Drupal, Drupal terminology, Drupal technology, directories.
Walking the walk and talking the talk… T HE L ANGUAGE OF D RUPAL.
Drupal and the CMS Project. Lesson Learned #1 Keep your modules updated, especially when there are security concerns in the update notes 2010 | The Sky’s.
Drupal 7 as an enterprise web application framework Why as a developer you should use Drupal to build web applications? Klaus Harris DrupalCon Munich 2012.
Hook, Drush, and Alters Oh Mai! Bryan Ollendyke.
How WebMD Maintains Operational Flexibility with NoSQL Rajeev Borborah, Sr. Director, Engineering Matt Wilson – Director, Production Engineering – Consumer.
Distributed Data Stores – Facebook Presented by Ben Gooding University of Arkansas – April 21, 2015.
The Drupal 6 menu system: architecture, do, don't and tricks (part 1) Peter Wolanin August 27, 2008 Drupalcon, Szeged.
TOP 20 MISTAKES YOU WILL MAKE IN YOUR 1ST DRUPAL PROJECT IZTOK SMOLIČ, ZAGREB.
Drupal Content Management System Mallikarjuna Pinjala CIS 764, Nov
Introduction: Drupal is a free and open-source content management system (CMS). A content management system(CMS) is a computer program that allows publishing,
NextGen Technology upgrade – Synerizip - Sandeep Kamble.
1/30/11 Hacking your way through the Drupal API, a themers intro Baris Wanschers (BarisW)
SCHOOL OF INFORMATION UNIVERSITY OF MICHIGAN si.umich.edu Drupal: Configuration and Customization Week 4: Installation, Module Development January 25,
Drupal Training Syllabus Chaitanya Lakshmi
How to extend and configure Drupal without user interaction or database dump By Damien Snoeck for Switzerland Romandy Drupal Group January 27, 2010 Work.
INFM603 Project Presentation Jenny Wu Prachi Chhokar.
PHP TUTORIAL. HISTORY OF PHP  PHP as it's known today is actually the successor to a product named PHP/FI.  Created in 1994 by Rasmus Lerdorf, the very.
Content Management Systems Drupal. Content Introduction Setting up Drupal Structure Features Core functions Comparison of Joomla and Drupal Total Cost.
Navigating database with windows forms.. Tiered applications  Provide a means to develop many presentations of the same app  Makes changes to the back.
Managing Drupal with Aegir Chris Burge Burge Consulting, LLC 30 June 2013 Dublin, Ireland Drupal Dev Days.
Drupal Commerce Better than Uber Andrew Root: druroot.
Creating Dynamic Web Pages Using PHP and MySQL CS 320.
SYST Web Technologies SYST Web Technologies Databases & MySQL.
Writing macros and programs for Voyager cataloging Kathryn Lybarger ELUNA 2013 May 3, #ELUNA2013.
Proposal for the new group web infrastructure SFT Group meeting 3/7/2009 Yves Perrin.
Friend Connect Integration. WordPress Open source blog engine PHP / MySQL based Completely customizable Plugin friendly.
Forensic Drupal Debugging Dan Harris daneesia on drupal.org.
Seattle Drupal Clinic Introduction to Drupal Part 1: Web Content Management, Advantages/Disadvantages of Drupal, Drupal terminology.
Introduction to Module Development John Fiala and Ezra Barnett Gildesgame.
Outline Working together Working with Nodes Working with Blocks Working with Taxonomy The Form API jQuery Summary.
Drush: The Drupal Shell Utility Trevor Mckeown Founder & Owner Sublime Technologies
How does Drupal Work? Information Systems 337 Prof. Harry Plantinga.
Introduction to Views Stanford Drupal Camp April 6, 2013.
Drupal for client Maria Sherskova skype: sherskova.
David Lawrence 7/8/091Intro. to PHP -- David Lawrence.
DrupalCon 2011: Feedback ENTICE meeting 8 April 2011 Silvia Tomanin DG-CO.
OpenMRS Create New Module.
OO: Geting the Uh-oh’s out of Object Oriented Drupal 8.
We Behatin’. INTRODUCTION Behat background 3 Behat prep Getting started
Web Cache. What is Cache? Cache is the storing of data temporarily to improve performance. Cache exist in a variety of areas such as your CPU, Hard Disk.
Module of the week Webform 7.x-4.0-alpha9 – admin/config/content/webform Add content types, choose allowed fields, default values and advanced options.
Cofax Scalability Document Version Scaling Cofax in General The scalability of Cofax is directly related to the system software, hardware and network.
How to use Drupal Awdhesh Kumar (Team Leader) Presentation Topic.
Drupal Basics May 30, 2012 By Sean Fitzpatrick. Sean Fitzpatrick | Welcome We're going to talk about Drupal We're going to keep it pretty.
I2CE Framework I2CE: Intrahealth Informatics Core Engine Base Web Framework on which iHRIS Manage and iHRIS Qualify are built on: Module Structure Magic.
Advanced Drush Scripting Jim Taylor Drupal Developer at Large Principal/Senior Engineer Rooty Hollow LLC.
Introducing Drush: Command line productivity for Drupal.
Custom search forms with Apache Solr David Hernández
WordPress Development
FAST Administration Training
Global Drupal Training Day
Building Web Applications
WordPress Development
WordPress Development
Presentation transcript:

“Drupal is written in PHP, which is uttterly offensive to people.” H o r r i b l e T r u t h 1

“Drupal loads too much code” -rasmus H o r r i b l e T r u t h 2

Is Drupal too Modular?

“Drupal is basically a 404 page to which you can add modules”” H o r r i b l e T r u t h 4

drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL); index.php includes/bootstrap.inc - load necessary functions drupal_page_header() starts timer, sets up caching, module callout includes/common.inc - utility functions such as path formatting functions, form generation and validation, etc. fix_gpc_magic() sets $status 404 switch - case Not Found case Access Denied drupal_page_footer()

drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL); drupal_load() drupal_not_found(); drupal_access_denied(); drupal_site_offline(); $return = menu_execute_active_handler(); print theme('page', $return); drupal_page_footer();

What's on the menu api? MENU_CALLBACK MENU_DEFAULT_LOCAL_TASK MENU_LOCAL_TASK MENU_MAX_DEPTH MENU_MAX_PARTS MENU_NORMAL_ITEM MENU_SUGGESTED_ITEM MENU_CALLBACK MENU_DEFAULT_LOCAL_TASK MENU_LOCAL_TASK MENU_MAX_DEPTH MENU_MAX_PARTS MENU_NORMAL_ITEM MENU_SUGGESTED_ITEM

Scream API

The Dreaded Hooks of Torture H o r r i b l e T r u t h 7

Hooks of Torture to implement a hook, create a function that 'extends' hooks into an existing hook (“hook function”) not functions but can be overloaded call user function array used to make dynamic function calls

module_invoke_all <?php function module_invoke_all() { $args = func_get_args(); $hook = $args[0]; unset($args[0]); $return = array(); foreach (module_implements($hook) as $module) { $function = $module.'_'. $hook; $result = call_user_func_array($function, $args); if (isset($result) && is_array($result)) { $return = array_merge_recursive($return, $result); } else if (isset($result)) { $return[] = $result; } return $return; } ?>

hook_admin /** * channels_admin * implements hook_admin * Provides channels admin form to save settings for the following fields: * */ function channels_admin() { $form['channels'] = array( '#type' => 'textfield', '#title' => t('Channel'), '#default_value' => variable_get('channels', ''), '#size' => 25, '#maxlength' => 128, '#description' => t("channel_theme"), '#required' => TRUE, ); return system_settings_form($form); }

hook_perms /** * Implements hook_perm(). */ function channels_perm() { return array( 'access channel content', 'administer channels', ); }

hook_menu /** * Implements hook_menu(). anne/ function channels_menu() { $items = array(); $items['admin/settings/channels'] = array( 'title' => 'channel settings', 'description' => 'select channel', 'page callback' => 'drupal_get_form', 'page arguments' => array('channels_admin'), 'access arguments' => array('administer channels'), 'type' => MENU_NORMAL_ITEM, ); return $items; }

hook_block /** * Implementation of hook_block(). */ function channels_block($op = 'list', $delta = 0, $edit = array()) { switch ($op) { case 'list': $blocks[0]['info'] = t('current_channel'); return $blocks; case 'view': $totals = _channels_get_theme(); if (!empty($webstream)) { $content = theme('channels_current_theme', $webstream); } $blocks['subject'] = t('You're What's On!'); $blocks['content'] = $content; return $blocks; }

hook_menu_alter /** Implementation of hook_menu_alter(). */ function noaccess_menu_alter(&$items) { $items['node']['access arguments'] = array('access node path'); } /** Implementation of hook_perm(). */ function noaccess_perm() { return array('access node path'); }

Hook Soup

Does Drupal have a Learning Curve...

…or a Learning Brick Wall ?

“Community Plumbing”

Drupal is a Pushme - Pullyou Framework! Product!

What's a Node? Field API

“Drupal Isn't 'Classy”'? H o r r i b l e T r u t h 9

“Drupal isn't Object Oriented?” H o r r i b l e T r u t h 10

Drupal Design Pattern DRUPAL DESIGN PATTERN

Drupal Design Pattern REALITY CHECK.

Drupal Anti-Pattern “Load Everything then Cherry Pick What You Need.”

Drupal Encourages Slavery H o r r i b l e T r u t h 11

Making Drupal “Slave Safe!”

Actions * & Triggers *(not slave safe)

Database TNG

Performance & Scaling Sample Metrics from a large Drupal site: 50 million page views per month 6.5 million site visitors per month 150,000 page views per hour load tests to levels of greater than 500,000 page views per hour Drupal.org delivers approximately 1M/day/month

Object Caching APC Advantages Low latency No need to serialize/unserialize items Scales perfectly with more web servers Disadvantages No enforced consistency across multiple web servers Cache is not shared; each web server must generate each item memcached Advantages Consistent across multiple web servers Cache is shared across all web servers; items only need to be generated once Disadvantages High latency Requires serializing/unserializing items Easily shards data across multiple web servers, but is still a big, shared cache

Cache Headers

* Download and enable devel module: drush dl devel drush enable devel * Run cron: drush cron * Refresh modules and core updates informartion: drush refresh * Take a snapshot of the DB: drush sql dump > mydb.sql * Open a mysql console for running SQL commands into Drupal DB: drush sql cli * Clear Drupal cache: drush cache clear drush

drush_make core = "7.x" projects[] = "drupal" projects[] = "acquia_connector" projects[apachesolr][download][type] = "cvs" projects[apachesolr][download][module] = "contributions/modules/apachesolr" projects[apachesolr][download][revision] = "DRUPAL-7--0" projects[acquia_search][type] = "module" projects[acquia_search][download][type] = "svn" projects[acquia_search][download][url] = " 7.x/modules/acquia/acquia_search/" libraries[SolrPhpClient][download][type] = "get" libraries[SolrPhpClient][download][url] = " client.googlecode.com/files/SolrPhpClient.r tgz" libraries[SolrPhpClient][destination] = "modules/apachesolr"

touch ~/.logrotate.state ~/.logrotate.config emacs ~/.logrotate.config ~/backup/dev.sql.gz { rotate 7 daily nocompress nocopytruncate postrotate /usr/bin/drush -r ~/web.root.org/web/ sql dump | gzip > ~/backup/dev.sql.gz endscript } /usr/bin/drush -r ~/web.root.org/web/ sql dump | gzip > ~/backup/dev.sql.gz Automated Backup