SlideShare uma empresa Scribd logo
1 de 109
Baixar para ler offline
Modernize Your Drupal Development 
Chris Tankersley 
php[world] 2014
2 
Who Am I? 
● A PHP Developer for 10 Years 
● Drupal Dev for 4 years 
● Lots of projects no one uses, and a few 
some do 
● https://github.com/dragonmantank
3 
We've got a lot to cover 
● Development Environments 
● Version Control 
● drush 
● Coding Standards 
● Building Better Modules 
● Moving Out of the Database 
● Putting it all together
4 
Development Environments
5 
Local Stack 
● Run everything off of your local 
machine! 
● Most performant of the options
6 
Local Stack 
● Not very portable 
● More junk on your PC to maintain 
● Probably not at all like Production
7 
Don't use Portable *AMP stacks
8 
If you have to... 
● Acquia Dev Desktop 
● Zend Server
9 
Acquia Dev Desktop 
● Pre-built *AMP Stack 
● Available for Drupal 6 or 7 
● Install and Ready to Go
10 
Acquia Dev Desktop 
● Not built for multiple installs 
● Can’t use for existing sites 
● Only for Windows and Mac
11 
Zend Server 
● Uses OS's server 
● Has some cool tools like Z-Ray 
● Mostly a wrapper around the local stack 
● Support! 
● Has a Development and Production 
version
12 
Zend Server 
● Weird issues with permissions 
● Works best with other Zend tools 
● Pricey
13 
How it looks 
Your OS 
Applications 
Your App 
Web Server DB Server
14 
docker 
● Containers for applications 
● Makes deployment very easy 
● Very easy to get set up 
● Way more performant than VMs
15 
docker 
● If you're not on Linux, think really hard 
about using 
● Mostly a deployment fixer
16 
How it looks - Linux 
Your OS 
Applications 
Your App 
Web Server DB Server
17 
How it looks – Everywhere Else 
Your App 
Web Server DB Server 
Virtualized OS 
Applications Virtualization Layer 
Your OS
18 
vagrant 
● Full server to run code 
● Self contained and can be replicated 
● Most modern machines can do VM
19 
vagrant 
● Uses more resources 
● Easier to break 
● When it breaks, it breaks hard
20 
How it looks 
Your App 
Web Server DB Server 
Virtualized OS 
Applications Virtualization Layer 
Your OS
21 
A quick demo
22 
Considerations 
● How special is my Production environment? 
● What resources do my dev machines have? 
● How many things am I working on? 
● What's the tech level of my coworkers? 
● What's the tech level of my clients?
23 
Version Control
24 
What is version control? 
● Some system that keeps track of 
changes to source code
25 
Many different systems 
● Git 
● Subversions 
● Mercurial
26 
It doesn't matter which one you use
27 
A Quick Demo
28 
Workflows 
● Github/Pull Request 
● Gitflow 
● Rebase
29 
GitHub Workflow
30 
For more info... 
https://guides.github.com/introduction/flow/index.html
31 
Rebase Workflow
32 
For more info... 
http://randyfay.com/content/rebase-workflow-git
33 
gitflow
34 
develop master 
Tag: 0.9.2 
blog_rework staff_page v0.9 
Tag: 1.0.0 
v1.0 
Tag: 0.9.3
35 
For more info... 
http://nvie.com/posts/a-successful-git-branching-model/
36 
Jeff Carouth's „Git and Github – Working 
Effectively on a Team“ 
https://speakerdeck.com/jcarouth/git-and-github- 
working-effectively-on-a-team-at-php-tek- 
2014
37 
Any questions?
38 
Are we finally ready for some actual Drupal?
39
40 
drush
41 
What is drush?
42 
What is drush? 
● Command line interface for (much of) 
Drupal 
● Allows modules to be CLI driven 
● Much, much quicker than the GUI
43 
How does it work?
44 
Common Commands
45 
Download Drupal 
$ drush dl drupal --drupal-project-rename="drupal" 
Project drupal (7.32) downloaded to /vagrant/drupal-7.32. 
[success] 
Project drupal contains: 
[success] 
- 3 profiles: testing, standard, minimal 
- 4 themes: stark, seven, garland, bartik 
- 47 modules: drupal_system_listing_incompatible_test, 
drupal_system_listing_compatible_test, user, update, trigger, translation, tracker, 
toolbar, taxonomy, system, syslog, statistics, simpletest, shortcut, search, rdf, profile, 
poll, php, path, 
overlay, openid, node, menu, locale, image, help, forum, filter, file, field_ui, text, 
options, number, list, field_sql_storage, field, dblog, dashboard, contextual, contact, 
comment, color, book, blog, block, aggregator
46 
Install Drupal 
$ drush site-install standard -y --db-url=mysql://drupal:DrupalR0cks@localhost/drupaldb 
--account-name=admin --account-pass=admin --site-name="My Drupal Site" --site-mail= 
youremail@domain.com
47 
Run a development server 
$ drush runserver 8080 
$ drush runserver 0.0.0.0:8080
48 
Watching the Watchdog 
// Show the last 10 messages 
$ drush watchdog-show 
// Show the last 50 messages 
$ drush watchdog-show --count=50 
// Show only entries of a specific severity 
$ drush watchdog-show --severity=notice 
// Search for a specific message 
$ drush watchdog-show "cron run successful"
49 
Viewing Watchdog Entries 
$ drush watchdog-show 54 
ID : 54 
Date : 30/Jan 22:10 
Type : system 
Severity : info 
Message : overlay module disabled.
50 
Cleaning Up After the (Watch)dog 
// Destroy it all! 
$ drush watchdog-delete all 
// Delete a specific one to hide an error you generated that no one can know about 
$ drush watchdog-delete 50 
// Delete all messages containing a string 
$ drush watchdog-delete "cron run successfull" 
// Delete everything of a specific severity 
$ drush watchdog-delete --severity=debug
51 
Working with modules 
$ drush pm-download backup_migrate 
$ drush pm-enable backup_migrate 
$ drush pm-update
52 
drush Aliases 
● Allows you to tell drush where an 
external site is located at 
● Requires drush on the other end, and 
shell access
53 
Creating an alias 
// sites/all/drush/prod.alias.drushrc.php 
$aliases['prod'] = array( 
'uri' => 'mysite.com', 
'root' => '/public_html/', 
'remote-host' => '10.0.2.2', 
'remote-user' => 'mysite', 
);
54 
Using an alias 
$ drush @prod status 
PHP configuration : /Applications/acquia-drupal/php5_3/bin/php.ini 
Drush version : 5.7 
Drush configuration :
55 
Common uses for aliases 
$ drush rsync sites/default/files/ @prod:sites/default/files 
$ drush sql-sync @prod @self 
$ drush @prod site-install standard [...]
56 
Deploying code with drush 
$ drush rsync @self @prod 
You will destroy data from ctankersley@10.0.2.2:'~/Sites/deploy/' and 
replace with data from /vagrant/ 
Do you really want to continue? (y/n): y
57 
Questions?
58 
Coding Standards
59 
Huh? 
Coding standards are a list of rules regarding 
the layout and structure of source code.
60 
What? 
● Two space indents 
● Spaces between casts 
– $id = (int) $_POST['id']; 
● Not using else if, using elseif 
● Always using curly braces on control 
structures
61 
Why? 
● Makes it easy to read code 
● Makes it easy to merge code 
● You're on a team, act like it 
● If you want your code on drupal.org, you're 
going to need to follow it 
● If you want to contribute, you'll need to follow it
62 
For the nitty-gritty... 
● https://www.drupal.org/coding-standards
63 
Tools 
● Code Sniffer with Drupal rules 
● Coder 
● PAReview 
● Grammer Parser
64 
Code Sniffer 
● Compares your code to some coding 
standard 
● General PHP tool, not specific to Drupal 
● CLI
65 
Code Sniffer 
https://www.drupal.org/node/1419988
66 
Demo Time
67 
Coder 
● GUI to check your code against coding 
standards 
● https://www.drupal.org/project/coder
68 
Demo Time
69 
PAReview 
● Project Application Review 
● First line of defense against bad 
modules 
● Online code sniffer for drupal.org
70 
Self Hosted 
● Add the Drupal, DrupalSecure, 
DrupalPractice, and Codespell 
standards to CodeSniffer 
● Download the bash script from Github
71 
Install DrupalPractice 
$ git clone https://github.com/klausi/drupalpractice.git ~/.drush/drupalpractice 
$ ln -sv ~/.drush/drupalpractice/DrupalPractice 
~/.composer/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/
72 
Quick Demo
73 
Questions?
74 
Building Better Modules
75 
Drupal supplies a lot of things for you 
● Form API 
● Schema API 
● Theme Layer 
● Unit Testing 
● Entities
76 
Unit Testing
77 
How Test Driven Development works 
● Write your tests before your code 
● Watch it fail 
● Write code to make your test pass 
● Feel better! (and refactor)
78 
TDD In Drupal 
● Drupal ships with SimpleTest baked in 
● Supports unit testing and functional testing 
● Unit tests are done by extending 
DrupalUnitTestCase 
● Functional tests are done by extending 
DrupalWebTestCase
79 
Unit Tests vs Functional Tests 
● Unit tests should focus on testing an 
individual piece of code 
● Functional tests should focus on testing 
output/pages
80 
Unit Tests vs Functional Tests 
● Unit tests do not bootstrap Drupal, so 
are very quick 
● Functional tests do bootstrap Drupal, so 
are very slow
81 
Downsides to TDD in Drupal 
● The GUI is an AJAX runner, which breaks a lot 
– Use drush for a better experience 
● Debugging can be very hard, since the 
environment is created and destroyed each 
test 
– Use $this->verbose() or debug()
82 
Let's build a test
83 
Let's build a test
84 
Caching and Asset Aggregation 
● Drupal has a caching layer 
● Drupal has a basic asset pipeline
85 
Turn it on on Performance
86 
Turn it on on Performance
87 
Caching 
● Caching saves a chunk of the render 
array to the DB 
● Caching still requires a DB hit
88 
Two Different Caches 
● Page caching for full output 
● Block caching for dynamic content
89 
Asset Aggregation 
● Groups CSS and JS together, reducing 
HTTP calls 
● Will minify the CSS, reducing the 
transmission size
90 
Easy to take advantage of 
● Let Drupal know about your files 
– drupal_add_js() 
– drupal_add_css() 
– Through #attached 
– Add it to your .info file 
● Don't just add straight to templates
91 
Adding JS
92 
Using #attached
93 
Entities 
● Basic building blocks of 'things' in 
Drupal 
● You already use them 
● Entity API provides an interface for 
making your own
94 
Why use them? 
● Drupal takes care of a lot of scaffolding 
● Allows site builders to extend them
95 
What is an entity? 
● A [Drupalized] thing 
● Series of classes and functions that tell 
Drupal how to deal with your thing
96 
What do we need? 
● A dependency on the Entities module
97 
A place to store things...
98 
And now we create a class for our entity
99 
And now we tell Drupal about it
100 
Let's create an admin form
101 
Now let's use it!
102 
Moving Out of the Database
103 
The Database Sucks 
● Drupal stores a lot of things in the 
database 
● Databases are hard to version 
● Database info is hard to move
104 
Features! 
● Features allow you to package up stuff 
into modules 
● Makes deploying code much easier
105 
Bundle things together
106 
Bundle lots of things
107
108 
Questions?
109 
Thanks! 
● http://joind.in/talk/view/11901 
● @dragonmantank 
● chris@ctankersley.com

Mais conteúdo relacionado

Mais procurados

Docker and Containers for Development and Deployment — SCALE12X
Docker and Containers for Development and Deployment — SCALE12XDocker and Containers for Development and Deployment — SCALE12X
Docker and Containers for Development and Deployment — SCALE12XJérôme Petazzoni
 
Ganeti Web Manager: Cluster Management Made Simple
Ganeti Web Manager: Cluster Management Made SimpleGaneti Web Manager: Cluster Management Made Simple
Ganeti Web Manager: Cluster Management Made SimpleOSCON Byrum
 
Hands on Virtualization with Ganeti (part 1) - LinuxCon 2012
Hands on Virtualization with Ganeti (part 1)  - LinuxCon 2012Hands on Virtualization with Ganeti (part 1)  - LinuxCon 2012
Hands on Virtualization with Ganeti (part 1) - LinuxCon 2012Lance Albertson
 
Настройка окружения для кросскомпиляции проектов на основе docker'a
Настройка окружения для кросскомпиляции проектов на основе docker'aНастройка окружения для кросскомпиляции проектов на основе docker'a
Настройка окружения для кросскомпиляции проектов на основе docker'acorehard_by
 
Hands on Docker - Launch your own LEMP or LAMP stack - SunshinePHP
Hands on Docker - Launch your own LEMP or LAMP stack - SunshinePHPHands on Docker - Launch your own LEMP or LAMP stack - SunshinePHP
Hands on Docker - Launch your own LEMP or LAMP stack - SunshinePHPDana Luther
 
Hands on Virtualization with Ganeti
Hands on Virtualization with GanetiHands on Virtualization with Ganeti
Hands on Virtualization with GanetiOSCON Byrum
 
Aug penguin16
Aug penguin16Aug penguin16
Aug penguin16alhino
 
Deploying software at Scale
Deploying software at ScaleDeploying software at Scale
Deploying software at ScaleKris Buytaert
 
Tutorial to setup OpenStreetMap tileserver with customized boundaries of India
Tutorial to setup OpenStreetMap tileserver with customized boundaries of IndiaTutorial to setup OpenStreetMap tileserver with customized boundaries of India
Tutorial to setup OpenStreetMap tileserver with customized boundaries of IndiaArun Ganesh
 
GDG-ANDROID-ATHENS Meetup: Build in Docker with Jenkins
GDG-ANDROID-ATHENS Meetup: Build in Docker with Jenkins GDG-ANDROID-ATHENS Meetup: Build in Docker with Jenkins
GDG-ANDROID-ATHENS Meetup: Build in Docker with Jenkins Mando Stam
 
How to swim with a whale
How to swim with a whaleHow to swim with a whale
How to swim with a whaleŁukasz Siudut
 
Docman - The swiss army knife for Drupal multisite docroot management and dep...
Docman - The swiss army knife for Drupal multisite docroot management and dep...Docman - The swiss army knife for Drupal multisite docroot management and dep...
Docman - The swiss army knife for Drupal multisite docroot management and dep...Aleksey Tkachenko
 
Building android for the Cloud: Android as a Server (AnDevConBoston 2014)
Building android for the Cloud: Android as a Server (AnDevConBoston 2014)Building android for the Cloud: Android as a Server (AnDevConBoston 2014)
Building android for the Cloud: Android as a Server (AnDevConBoston 2014)Ron Munitz
 
PHP & JavaScript & CSS Coding style
PHP & JavaScript & CSS Coding stylePHP & JavaScript & CSS Coding style
PHP & JavaScript & CSS Coding styleBo-Yi Wu
 

Mais procurados (20)

Docker and Containers for Development and Deployment — SCALE12X
Docker and Containers for Development and Deployment — SCALE12XDocker and Containers for Development and Deployment — SCALE12X
Docker and Containers for Development and Deployment — SCALE12X
 
Ganeti Web Manager: Cluster Management Made Simple
Ganeti Web Manager: Cluster Management Made SimpleGaneti Web Manager: Cluster Management Made Simple
Ganeti Web Manager: Cluster Management Made Simple
 
Hands on Virtualization with Ganeti (part 1) - LinuxCon 2012
Hands on Virtualization with Ganeti (part 1)  - LinuxCon 2012Hands on Virtualization with Ganeti (part 1)  - LinuxCon 2012
Hands on Virtualization with Ganeti (part 1) - LinuxCon 2012
 
Настройка окружения для кросскомпиляции проектов на основе docker'a
Настройка окружения для кросскомпиляции проектов на основе docker'aНастройка окружения для кросскомпиляции проектов на основе docker'a
Настройка окружения для кросскомпиляции проектов на основе docker'a
 
Hands on Docker - Launch your own LEMP or LAMP stack - SunshinePHP
Hands on Docker - Launch your own LEMP or LAMP stack - SunshinePHPHands on Docker - Launch your own LEMP or LAMP stack - SunshinePHP
Hands on Docker - Launch your own LEMP or LAMP stack - SunshinePHP
 
Hands on Virtualization with Ganeti
Hands on Virtualization with GanetiHands on Virtualization with Ganeti
Hands on Virtualization with Ganeti
 
Aug penguin16
Aug penguin16Aug penguin16
Aug penguin16
 
Deploying software at Scale
Deploying software at ScaleDeploying software at Scale
Deploying software at Scale
 
Tutorial to setup OpenStreetMap tileserver with customized boundaries of India
Tutorial to setup OpenStreetMap tileserver with customized boundaries of IndiaTutorial to setup OpenStreetMap tileserver with customized boundaries of India
Tutorial to setup OpenStreetMap tileserver with customized boundaries of India
 
Tech Talk - Vagrant
Tech Talk - VagrantTech Talk - Vagrant
Tech Talk - Vagrant
 
GDG-ANDROID-ATHENS Meetup: Build in Docker with Jenkins
GDG-ANDROID-ATHENS Meetup: Build in Docker with Jenkins GDG-ANDROID-ATHENS Meetup: Build in Docker with Jenkins
GDG-ANDROID-ATHENS Meetup: Build in Docker with Jenkins
 
A Hands-on Introduction to Docker
A Hands-on Introduction to DockerA Hands-on Introduction to Docker
A Hands-on Introduction to Docker
 
Native Hadoop with prebuilt spark
Native Hadoop with prebuilt sparkNative Hadoop with prebuilt spark
Native Hadoop with prebuilt spark
 
How to swim with a whale
How to swim with a whaleHow to swim with a whale
How to swim with a whale
 
Docker 1.11
Docker 1.11Docker 1.11
Docker 1.11
 
Docman - The swiss army knife for Drupal multisite docroot management and dep...
Docman - The swiss army knife for Drupal multisite docroot management and dep...Docman - The swiss army knife for Drupal multisite docroot management and dep...
Docman - The swiss army knife for Drupal multisite docroot management and dep...
 
Building android for the Cloud: Android as a Server (AnDevConBoston 2014)
Building android for the Cloud: Android as a Server (AnDevConBoston 2014)Building android for the Cloud: Android as a Server (AnDevConBoston 2014)
Building android for the Cloud: Android as a Server (AnDevConBoston 2014)
 
Developing web apps
Developing web appsDeveloping web apps
Developing web apps
 
Of Docker and Drupal
Of Docker and DrupalOf Docker and Drupal
Of Docker and Drupal
 
PHP & JavaScript & CSS Coding style
PHP & JavaScript & CSS Coding stylePHP & JavaScript & CSS Coding style
PHP & JavaScript & CSS Coding style
 

Semelhante a Modernize Your Drupal Development

Drupal 8 improvements for developer productivity php symfony and more
Drupal 8 improvements for developer productivity  php symfony and moreDrupal 8 improvements for developer productivity  php symfony and more
Drupal 8 improvements for developer productivity php symfony and moreAcquia
 
Becoming A Drupal Master Builder
Becoming A Drupal Master BuilderBecoming A Drupal Master Builder
Becoming A Drupal Master BuilderPhilip Norton
 
Help! I inherited a Drupal Site! - DrupalCamp Atlanta 2016
Help! I inherited a Drupal Site! - DrupalCamp Atlanta 2016Help! I inherited a Drupal Site! - DrupalCamp Atlanta 2016
Help! I inherited a Drupal Site! - DrupalCamp Atlanta 2016Paul McKibben
 
Face your fears: Drush and Aegir
Face your fears: Drush and AegirFace your fears: Drush and Aegir
Face your fears: Drush and AegirIztok Smolic
 
Lean Drupal Repositories with Composer and Drush
Lean Drupal Repositories with Composer and DrushLean Drupal Repositories with Composer and Drush
Lean Drupal Repositories with Composer and DrushPantheon
 
Super powered Drupal development with docker
Super powered Drupal development with dockerSuper powered Drupal development with docker
Super powered Drupal development with dockerMaciej Lukianski
 
Improving your Drupal 8 development workflow DrupalCampLA
Improving your Drupal 8 development workflow DrupalCampLAImproving your Drupal 8 development workflow DrupalCampLA
Improving your Drupal 8 development workflow DrupalCampLAJesus Manuel Olivas
 
Drupal 8 - Improving your development workflow
Drupal 8 - Improving your development workflowDrupal 8 - Improving your development workflow
Drupal 8 - Improving your development workflowvaluebound
 
Drupal VM for Drupal 8 Dev - Drupal Camp STL 2017
Drupal VM for Drupal 8 Dev - Drupal Camp STL 2017Drupal VM for Drupal 8 Dev - Drupal Camp STL 2017
Drupal VM for Drupal 8 Dev - Drupal Camp STL 2017Jeff Geerling
 
Drupal + composer = new love !?
Drupal + composer = new love !?Drupal + composer = new love !?
Drupal + composer = new love !?nuppla
 
Docker4Drupal 2.1 for Development
Docker4Drupal 2.1 for DevelopmentDocker4Drupal 2.1 for Development
Docker4Drupal 2.1 for DevelopmentWebsolutions Agency
 
Docker 0.11 at MaxCDN meetup in Los Angeles
Docker 0.11 at MaxCDN meetup in Los AngelesDocker 0.11 at MaxCDN meetup in Los Angeles
Docker 0.11 at MaxCDN meetup in Los AngelesJérôme Petazzoni
 
Drupal 8 DevOps . Profile and SQL flows.
Drupal 8 DevOps . Profile and SQL flows.Drupal 8 DevOps . Profile and SQL flows.
Drupal 8 DevOps . Profile and SQL flows.Andrii Podanenko
 
Drush workshop
Drush workshopDrush workshop
Drush workshopJuampy NR
 
Cloudera hadoop installation
Cloudera hadoop installationCloudera hadoop installation
Cloudera hadoop installationSumitra Pundlik
 
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis OverviewLeo Lorieri
 
Nagios Conference 2014 - Spenser Reinhardt - Detecting Security Breaches With...
Nagios Conference 2014 - Spenser Reinhardt - Detecting Security Breaches With...Nagios Conference 2014 - Spenser Reinhardt - Detecting Security Breaches With...
Nagios Conference 2014 - Spenser Reinhardt - Detecting Security Breaches With...Nagios
 
Drupal Overview For Techies
Drupal Overview For TechiesDrupal Overview For Techies
Drupal Overview For TechiesRobert Carr
 
Building and Maintaining a Distribution in Drupal 7 with Features
Building and Maintaining a  Distribution in Drupal 7 with FeaturesBuilding and Maintaining a  Distribution in Drupal 7 with Features
Building and Maintaining a Distribution in Drupal 7 with FeaturesNuvole
 

Semelhante a Modernize Your Drupal Development (20)

Drupal 8 improvements for developer productivity php symfony and more
Drupal 8 improvements for developer productivity  php symfony and moreDrupal 8 improvements for developer productivity  php symfony and more
Drupal 8 improvements for developer productivity php symfony and more
 
Becoming A Drupal Master Builder
Becoming A Drupal Master BuilderBecoming A Drupal Master Builder
Becoming A Drupal Master Builder
 
Help! I inherited a Drupal Site! - DrupalCamp Atlanta 2016
Help! I inherited a Drupal Site! - DrupalCamp Atlanta 2016Help! I inherited a Drupal Site! - DrupalCamp Atlanta 2016
Help! I inherited a Drupal Site! - DrupalCamp Atlanta 2016
 
Face your fears: Drush and Aegir
Face your fears: Drush and AegirFace your fears: Drush and Aegir
Face your fears: Drush and Aegir
 
Lean Drupal Repositories with Composer and Drush
Lean Drupal Repositories with Composer and DrushLean Drupal Repositories with Composer and Drush
Lean Drupal Repositories with Composer and Drush
 
Super powered Drupal development with docker
Super powered Drupal development with dockerSuper powered Drupal development with docker
Super powered Drupal development with docker
 
Improving your Drupal 8 development workflow DrupalCampLA
Improving your Drupal 8 development workflow DrupalCampLAImproving your Drupal 8 development workflow DrupalCampLA
Improving your Drupal 8 development workflow DrupalCampLA
 
Drupal 8 - Improving your development workflow
Drupal 8 - Improving your development workflowDrupal 8 - Improving your development workflow
Drupal 8 - Improving your development workflow
 
Drupal VM for Drupal 8 Dev - Drupal Camp STL 2017
Drupal VM for Drupal 8 Dev - Drupal Camp STL 2017Drupal VM for Drupal 8 Dev - Drupal Camp STL 2017
Drupal VM for Drupal 8 Dev - Drupal Camp STL 2017
 
Drupal + composer = new love !?
Drupal + composer = new love !?Drupal + composer = new love !?
Drupal + composer = new love !?
 
Docker4Drupal 2.1 for Development
Docker4Drupal 2.1 for DevelopmentDocker4Drupal 2.1 for Development
Docker4Drupal 2.1 for Development
 
Docker 0.11 at MaxCDN meetup in Los Angeles
Docker 0.11 at MaxCDN meetup in Los AngelesDocker 0.11 at MaxCDN meetup in Los Angeles
Docker 0.11 at MaxCDN meetup in Los Angeles
 
Drupal 8 DevOps . Profile and SQL flows.
Drupal 8 DevOps . Profile and SQL flows.Drupal 8 DevOps . Profile and SQL flows.
Drupal 8 DevOps . Profile and SQL flows.
 
Drush workshop
Drush workshopDrush workshop
Drush workshop
 
Cloudera hadoop installation
Cloudera hadoop installationCloudera hadoop installation
Cloudera hadoop installation
 
Docker linuxday 2015
Docker linuxday 2015Docker linuxday 2015
Docker linuxday 2015
 
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
 
Nagios Conference 2014 - Spenser Reinhardt - Detecting Security Breaches With...
Nagios Conference 2014 - Spenser Reinhardt - Detecting Security Breaches With...Nagios Conference 2014 - Spenser Reinhardt - Detecting Security Breaches With...
Nagios Conference 2014 - Spenser Reinhardt - Detecting Security Breaches With...
 
Drupal Overview For Techies
Drupal Overview For TechiesDrupal Overview For Techies
Drupal Overview For Techies
 
Building and Maintaining a Distribution in Drupal 7 with Features
Building and Maintaining a  Distribution in Drupal 7 with FeaturesBuilding and Maintaining a  Distribution in Drupal 7 with Features
Building and Maintaining a Distribution in Drupal 7 with Features
 

Mais de Chris Tankersley

Docker is Dead: Long Live Containers
Docker is Dead: Long Live ContainersDocker is Dead: Long Live Containers
Docker is Dead: Long Live ContainersChris Tankersley
 
Bend time to your will with git
Bend time to your will with gitBend time to your will with git
Bend time to your will with gitChris Tankersley
 
Using PHP Functions! (Not those functions, Google Cloud Functions)
Using PHP Functions! (Not those functions, Google Cloud Functions)Using PHP Functions! (Not those functions, Google Cloud Functions)
Using PHP Functions! (Not those functions, Google Cloud Functions)Chris Tankersley
 
Dead Simple APIs with OpenAPI
Dead Simple APIs with OpenAPIDead Simple APIs with OpenAPI
Dead Simple APIs with OpenAPIChris Tankersley
 
Killer Docker Workflows for Development
Killer Docker Workflows for DevelopmentKiller Docker Workflows for Development
Killer Docker Workflows for DevelopmentChris Tankersley
 
Docker for Developers - PHP Detroit 2018
Docker for Developers - PHP Detroit 2018Docker for Developers - PHP Detroit 2018
Docker for Developers - PHP Detroit 2018Chris Tankersley
 
BASHing at the CLI - Midwest PHP 2018
BASHing at the CLI - Midwest PHP 2018BASHing at the CLI - Midwest PHP 2018
BASHing at the CLI - Midwest PHP 2018Chris Tankersley
 
You Were Lied To About Optimization
You Were Lied To About OptimizationYou Were Lied To About Optimization
You Were Lied To About OptimizationChris Tankersley
 
Docker for PHP Developers - php[world] 2017
Docker for PHP Developers - php[world] 2017Docker for PHP Developers - php[world] 2017
Docker for PHP Developers - php[world] 2017Chris Tankersley
 
Docker for PHP Developers - Madison PHP 2017
Docker for PHP Developers - Madison PHP 2017Docker for PHP Developers - Madison PHP 2017
Docker for PHP Developers - Madison PHP 2017Chris Tankersley
 
Docker for Developers - php[tek] 2017
Docker for Developers - php[tek] 2017Docker for Developers - php[tek] 2017
Docker for Developers - php[tek] 2017Chris Tankersley
 
Why Docker? Dayton PHP, April 2017
Why Docker? Dayton PHP, April 2017Why Docker? Dayton PHP, April 2017
Why Docker? Dayton PHP, April 2017Chris Tankersley
 
OOP Is More Then Cars and Dogs - Midwest PHP 2017
OOP Is More Then Cars and Dogs - Midwest PHP 2017OOP Is More Then Cars and Dogs - Midwest PHP 2017
OOP Is More Then Cars and Dogs - Midwest PHP 2017Chris Tankersley
 
From Docker to Production - SunshinePHP 2017
From Docker to Production - SunshinePHP 2017From Docker to Production - SunshinePHP 2017
From Docker to Production - SunshinePHP 2017Chris Tankersley
 
Docker for Developers - Sunshine PHP
Docker for Developers - Sunshine PHPDocker for Developers - Sunshine PHP
Docker for Developers - Sunshine PHPChris Tankersley
 
Coming to Terms with OOP In Drupal - php[world] 2016
Coming to Terms with OOP In Drupal - php[world] 2016Coming to Terms with OOP In Drupal - php[world] 2016
Coming to Terms with OOP In Drupal - php[world] 2016Chris Tankersley
 
How We Got Here: A Brief History of Open Source
How We Got Here: A Brief History of Open SourceHow We Got Here: A Brief History of Open Source
How We Got Here: A Brief History of Open SourceChris Tankersley
 

Mais de Chris Tankersley (20)

Docker is Dead: Long Live Containers
Docker is Dead: Long Live ContainersDocker is Dead: Long Live Containers
Docker is Dead: Long Live Containers
 
Bend time to your will with git
Bend time to your will with gitBend time to your will with git
Bend time to your will with git
 
Using PHP Functions! (Not those functions, Google Cloud Functions)
Using PHP Functions! (Not those functions, Google Cloud Functions)Using PHP Functions! (Not those functions, Google Cloud Functions)
Using PHP Functions! (Not those functions, Google Cloud Functions)
 
Dead Simple APIs with OpenAPI
Dead Simple APIs with OpenAPIDead Simple APIs with OpenAPI
Dead Simple APIs with OpenAPI
 
Killer Docker Workflows for Development
Killer Docker Workflows for DevelopmentKiller Docker Workflows for Development
Killer Docker Workflows for Development
 
You Got Async in my PHP!
You Got Async in my PHP!You Got Async in my PHP!
You Got Async in my PHP!
 
Docker for Developers - PHP Detroit 2018
Docker for Developers - PHP Detroit 2018Docker for Developers - PHP Detroit 2018
Docker for Developers - PHP Detroit 2018
 
Docker for Developers
Docker for DevelopersDocker for Developers
Docker for Developers
 
They are Watching You
They are Watching YouThey are Watching You
They are Watching You
 
BASHing at the CLI - Midwest PHP 2018
BASHing at the CLI - Midwest PHP 2018BASHing at the CLI - Midwest PHP 2018
BASHing at the CLI - Midwest PHP 2018
 
You Were Lied To About Optimization
You Were Lied To About OptimizationYou Were Lied To About Optimization
You Were Lied To About Optimization
 
Docker for PHP Developers - php[world] 2017
Docker for PHP Developers - php[world] 2017Docker for PHP Developers - php[world] 2017
Docker for PHP Developers - php[world] 2017
 
Docker for PHP Developers - Madison PHP 2017
Docker for PHP Developers - Madison PHP 2017Docker for PHP Developers - Madison PHP 2017
Docker for PHP Developers - Madison PHP 2017
 
Docker for Developers - php[tek] 2017
Docker for Developers - php[tek] 2017Docker for Developers - php[tek] 2017
Docker for Developers - php[tek] 2017
 
Why Docker? Dayton PHP, April 2017
Why Docker? Dayton PHP, April 2017Why Docker? Dayton PHP, April 2017
Why Docker? Dayton PHP, April 2017
 
OOP Is More Then Cars and Dogs - Midwest PHP 2017
OOP Is More Then Cars and Dogs - Midwest PHP 2017OOP Is More Then Cars and Dogs - Midwest PHP 2017
OOP Is More Then Cars and Dogs - Midwest PHP 2017
 
From Docker to Production - SunshinePHP 2017
From Docker to Production - SunshinePHP 2017From Docker to Production - SunshinePHP 2017
From Docker to Production - SunshinePHP 2017
 
Docker for Developers - Sunshine PHP
Docker for Developers - Sunshine PHPDocker for Developers - Sunshine PHP
Docker for Developers - Sunshine PHP
 
Coming to Terms with OOP In Drupal - php[world] 2016
Coming to Terms with OOP In Drupal - php[world] 2016Coming to Terms with OOP In Drupal - php[world] 2016
Coming to Terms with OOP In Drupal - php[world] 2016
 
How We Got Here: A Brief History of Open Source
How We Got Here: A Brief History of Open SourceHow We Got Here: A Brief History of Open Source
How We Got Here: A Brief History of Open Source
 

Último

2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelDeepika Singh
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfOverkill Security
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 

Último (20)

2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 

Modernize Your Drupal Development

  • 1. Modernize Your Drupal Development Chris Tankersley php[world] 2014
  • 2. 2 Who Am I? ● A PHP Developer for 10 Years ● Drupal Dev for 4 years ● Lots of projects no one uses, and a few some do ● https://github.com/dragonmantank
  • 3. 3 We've got a lot to cover ● Development Environments ● Version Control ● drush ● Coding Standards ● Building Better Modules ● Moving Out of the Database ● Putting it all together
  • 5. 5 Local Stack ● Run everything off of your local machine! ● Most performant of the options
  • 6. 6 Local Stack ● Not very portable ● More junk on your PC to maintain ● Probably not at all like Production
  • 7. 7 Don't use Portable *AMP stacks
  • 8. 8 If you have to... ● Acquia Dev Desktop ● Zend Server
  • 9. 9 Acquia Dev Desktop ● Pre-built *AMP Stack ● Available for Drupal 6 or 7 ● Install and Ready to Go
  • 10. 10 Acquia Dev Desktop ● Not built for multiple installs ● Can’t use for existing sites ● Only for Windows and Mac
  • 11. 11 Zend Server ● Uses OS's server ● Has some cool tools like Z-Ray ● Mostly a wrapper around the local stack ● Support! ● Has a Development and Production version
  • 12. 12 Zend Server ● Weird issues with permissions ● Works best with other Zend tools ● Pricey
  • 13. 13 How it looks Your OS Applications Your App Web Server DB Server
  • 14. 14 docker ● Containers for applications ● Makes deployment very easy ● Very easy to get set up ● Way more performant than VMs
  • 15. 15 docker ● If you're not on Linux, think really hard about using ● Mostly a deployment fixer
  • 16. 16 How it looks - Linux Your OS Applications Your App Web Server DB Server
  • 17. 17 How it looks – Everywhere Else Your App Web Server DB Server Virtualized OS Applications Virtualization Layer Your OS
  • 18. 18 vagrant ● Full server to run code ● Self contained and can be replicated ● Most modern machines can do VM
  • 19. 19 vagrant ● Uses more resources ● Easier to break ● When it breaks, it breaks hard
  • 20. 20 How it looks Your App Web Server DB Server Virtualized OS Applications Virtualization Layer Your OS
  • 21. 21 A quick demo
  • 22. 22 Considerations ● How special is my Production environment? ● What resources do my dev machines have? ● How many things am I working on? ● What's the tech level of my coworkers? ● What's the tech level of my clients?
  • 24. 24 What is version control? ● Some system that keeps track of changes to source code
  • 25. 25 Many different systems ● Git ● Subversions ● Mercurial
  • 26. 26 It doesn't matter which one you use
  • 27. 27 A Quick Demo
  • 28. 28 Workflows ● Github/Pull Request ● Gitflow ● Rebase
  • 30. 30 For more info... https://guides.github.com/introduction/flow/index.html
  • 32. 32 For more info... http://randyfay.com/content/rebase-workflow-git
  • 34. 34 develop master Tag: 0.9.2 blog_rework staff_page v0.9 Tag: 1.0.0 v1.0 Tag: 0.9.3
  • 35. 35 For more info... http://nvie.com/posts/a-successful-git-branching-model/
  • 36. 36 Jeff Carouth's „Git and Github – Working Effectively on a Team“ https://speakerdeck.com/jcarouth/git-and-github- working-effectively-on-a-team-at-php-tek- 2014
  • 38. 38 Are we finally ready for some actual Drupal?
  • 39. 39
  • 41. 41 What is drush?
  • 42. 42 What is drush? ● Command line interface for (much of) Drupal ● Allows modules to be CLI driven ● Much, much quicker than the GUI
  • 43. 43 How does it work?
  • 45. 45 Download Drupal $ drush dl drupal --drupal-project-rename="drupal" Project drupal (7.32) downloaded to /vagrant/drupal-7.32. [success] Project drupal contains: [success] - 3 profiles: testing, standard, minimal - 4 themes: stark, seven, garland, bartik - 47 modules: drupal_system_listing_incompatible_test, drupal_system_listing_compatible_test, user, update, trigger, translation, tracker, toolbar, taxonomy, system, syslog, statistics, simpletest, shortcut, search, rdf, profile, poll, php, path, overlay, openid, node, menu, locale, image, help, forum, filter, file, field_ui, text, options, number, list, field_sql_storage, field, dblog, dashboard, contextual, contact, comment, color, book, blog, block, aggregator
  • 46. 46 Install Drupal $ drush site-install standard -y --db-url=mysql://drupal:DrupalR0cks@localhost/drupaldb --account-name=admin --account-pass=admin --site-name="My Drupal Site" --site-mail= youremail@domain.com
  • 47. 47 Run a development server $ drush runserver 8080 $ drush runserver 0.0.0.0:8080
  • 48. 48 Watching the Watchdog // Show the last 10 messages $ drush watchdog-show // Show the last 50 messages $ drush watchdog-show --count=50 // Show only entries of a specific severity $ drush watchdog-show --severity=notice // Search for a specific message $ drush watchdog-show "cron run successful"
  • 49. 49 Viewing Watchdog Entries $ drush watchdog-show 54 ID : 54 Date : 30/Jan 22:10 Type : system Severity : info Message : overlay module disabled.
  • 50. 50 Cleaning Up After the (Watch)dog // Destroy it all! $ drush watchdog-delete all // Delete a specific one to hide an error you generated that no one can know about $ drush watchdog-delete 50 // Delete all messages containing a string $ drush watchdog-delete "cron run successfull" // Delete everything of a specific severity $ drush watchdog-delete --severity=debug
  • 51. 51 Working with modules $ drush pm-download backup_migrate $ drush pm-enable backup_migrate $ drush pm-update
  • 52. 52 drush Aliases ● Allows you to tell drush where an external site is located at ● Requires drush on the other end, and shell access
  • 53. 53 Creating an alias // sites/all/drush/prod.alias.drushrc.php $aliases['prod'] = array( 'uri' => 'mysite.com', 'root' => '/public_html/', 'remote-host' => '10.0.2.2', 'remote-user' => 'mysite', );
  • 54. 54 Using an alias $ drush @prod status PHP configuration : /Applications/acquia-drupal/php5_3/bin/php.ini Drush version : 5.7 Drush configuration :
  • 55. 55 Common uses for aliases $ drush rsync sites/default/files/ @prod:sites/default/files $ drush sql-sync @prod @self $ drush @prod site-install standard [...]
  • 56. 56 Deploying code with drush $ drush rsync @self @prod You will destroy data from ctankersley@10.0.2.2:'~/Sites/deploy/' and replace with data from /vagrant/ Do you really want to continue? (y/n): y
  • 59. 59 Huh? Coding standards are a list of rules regarding the layout and structure of source code.
  • 60. 60 What? ● Two space indents ● Spaces between casts – $id = (int) $_POST['id']; ● Not using else if, using elseif ● Always using curly braces on control structures
  • 61. 61 Why? ● Makes it easy to read code ● Makes it easy to merge code ● You're on a team, act like it ● If you want your code on drupal.org, you're going to need to follow it ● If you want to contribute, you'll need to follow it
  • 62. 62 For the nitty-gritty... ● https://www.drupal.org/coding-standards
  • 63. 63 Tools ● Code Sniffer with Drupal rules ● Coder ● PAReview ● Grammer Parser
  • 64. 64 Code Sniffer ● Compares your code to some coding standard ● General PHP tool, not specific to Drupal ● CLI
  • 65. 65 Code Sniffer https://www.drupal.org/node/1419988
  • 67. 67 Coder ● GUI to check your code against coding standards ● https://www.drupal.org/project/coder
  • 69. 69 PAReview ● Project Application Review ● First line of defense against bad modules ● Online code sniffer for drupal.org
  • 70. 70 Self Hosted ● Add the Drupal, DrupalSecure, DrupalPractice, and Codespell standards to CodeSniffer ● Download the bash script from Github
  • 71. 71 Install DrupalPractice $ git clone https://github.com/klausi/drupalpractice.git ~/.drush/drupalpractice $ ln -sv ~/.drush/drupalpractice/DrupalPractice ~/.composer/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/
  • 75. 75 Drupal supplies a lot of things for you ● Form API ● Schema API ● Theme Layer ● Unit Testing ● Entities
  • 77. 77 How Test Driven Development works ● Write your tests before your code ● Watch it fail ● Write code to make your test pass ● Feel better! (and refactor)
  • 78. 78 TDD In Drupal ● Drupal ships with SimpleTest baked in ● Supports unit testing and functional testing ● Unit tests are done by extending DrupalUnitTestCase ● Functional tests are done by extending DrupalWebTestCase
  • 79. 79 Unit Tests vs Functional Tests ● Unit tests should focus on testing an individual piece of code ● Functional tests should focus on testing output/pages
  • 80. 80 Unit Tests vs Functional Tests ● Unit tests do not bootstrap Drupal, so are very quick ● Functional tests do bootstrap Drupal, so are very slow
  • 81. 81 Downsides to TDD in Drupal ● The GUI is an AJAX runner, which breaks a lot – Use drush for a better experience ● Debugging can be very hard, since the environment is created and destroyed each test – Use $this->verbose() or debug()
  • 82. 82 Let's build a test
  • 83. 83 Let's build a test
  • 84. 84 Caching and Asset Aggregation ● Drupal has a caching layer ● Drupal has a basic asset pipeline
  • 85. 85 Turn it on on Performance
  • 86. 86 Turn it on on Performance
  • 87. 87 Caching ● Caching saves a chunk of the render array to the DB ● Caching still requires a DB hit
  • 88. 88 Two Different Caches ● Page caching for full output ● Block caching for dynamic content
  • 89. 89 Asset Aggregation ● Groups CSS and JS together, reducing HTTP calls ● Will minify the CSS, reducing the transmission size
  • 90. 90 Easy to take advantage of ● Let Drupal know about your files – drupal_add_js() – drupal_add_css() – Through #attached – Add it to your .info file ● Don't just add straight to templates
  • 93. 93 Entities ● Basic building blocks of 'things' in Drupal ● You already use them ● Entity API provides an interface for making your own
  • 94. 94 Why use them? ● Drupal takes care of a lot of scaffolding ● Allows site builders to extend them
  • 95. 95 What is an entity? ● A [Drupalized] thing ● Series of classes and functions that tell Drupal how to deal with your thing
  • 96. 96 What do we need? ● A dependency on the Entities module
  • 97. 97 A place to store things...
  • 98. 98 And now we create a class for our entity
  • 99. 99 And now we tell Drupal about it
  • 100. 100 Let's create an admin form
  • 101. 101 Now let's use it!
  • 102. 102 Moving Out of the Database
  • 103. 103 The Database Sucks ● Drupal stores a lot of things in the database ● Databases are hard to version ● Database info is hard to move
  • 104. 104 Features! ● Features allow you to package up stuff into modules ● Makes deploying code much easier
  • 105. 105 Bundle things together
  • 106. 106 Bundle lots of things
  • 107. 107
  • 109. 109 Thanks! ● http://joind.in/talk/view/11901 ● @dragonmantank ● chris@ctankersley.com