SlideShare uma empresa Scribd logo
1 de 46
Baixar para ler offline
Pantheon.io / Prometsource.com
JULY 22-24, 2015
NATIONAL INSTITUTES OF HEALTH CAMPUS
BETHESDA, MD
Composer Tools and Frameworks for Drupal
Pantheon.io / Prometsource.com
Why you should care about composer
Today
➢ Dependency Management Hell
➢ Manually Include Classes at runtime
➢ Large unmanagable repository
➢ Composer manages dependencies
➢ Autoloader lazy-includes class files
➢ Repository remains clean and lean
With Composer
Pantheon.io / Prometsource.com
Composer Tools and Frameworks for Drupal
+ =+
COMPOSER DRUPAL DRUSH WIN
Pantheon.io / Prometsource.com 4
Who Are We?
Greg Anderson
Doug Dobrzynski
Pantheon.io / Prometsource.com 5
Who Are We?
Allan Chappell
Senior Solutions Architect
Pantheon.io / Prometsource.com 6
Agenda
‣What is Composer?
‣Installing Drupal 7 with Composer
•composer_vendor + custom-installer
•drupal-tangler
‣Managing Your Project
Pantheon.io / Prometsource.com
WHAT IS COMPOSER?
PART
ONE
Pantheon.io / Prometsource.com 8
What Is Composer?
An Installer A Dependency Manager An Autoloader
{
"require": {
"php": ">=5.4.0",
"symfony/browser-kit": "~2.1",
"symfony/css-selector": "~2.1",
"symfony/dom-crawler": "~2.1",
"guzzlehttp/guzzle": ">=4,<6"
},
…
}
Evaluate and select <?php
$client = new GuzzleHttpClient();
>=4,<6
guzzlehttp/guzzle
5.*
guzzlehttp/guzzle
v5.2.0
guzzlehttp/guzzle
"autoload": {
"psr-4": {
"GuzzleHttp": "src/"
}
},
composer.json
Pantheon.io / Prometsource.com 9
Why Use Composer?
‣Standard
‣Easiest for developers
•Dependency resolution
•Code updates
•Autoloading of classes
‣Composer is being adopted everywhere
Pantheon.io / Prometsource.com 1
What Projects Are Using Composer?
Not Using Composer
… and many others!
http/guzzle
fabpot/goutteDrupal Modules Drush Extensions
PHP APIs
symfony/yaml
twig/twig
Not Using ComposerUsing Composer
Pantheon.io / Prometsource.com 11
Drupal 7 and Composer
Can we do this?
?+ =
Pantheon.io / Prometsource.com 12
Composer Parts of the Whole
Composer
PHP
dependency
management
software.
Packagist
A software
repository
manager.
Custom Installer
An executable
Composer
component.
Optional.
autoload.php
A generated file
that must be
included
by your app.
composer.json
A structured file
that defines a
project.
Pantheon.io / Prometsource.com 13
Repository Data for Drupal Projects
packagist.drupal-composer.org
A third-party repository
containing data on projects
from drupal.org.
Pantheon.io / Prometsource.com 14
Semantic Versioning
Drupal Module Version
7.x-1.5
DRUPAL-x.MODULE.MINOR
Versions are converted to semantic versioning before being
published on packagist.drupal-composer.org.
7.1.5
MAJOR.MINOR.PATCH
Composer Version
Pantheon.io / Prometsource.com 15
Comparison with Drush Make
composer.json
Repository and
custom installers
(previously
explained)
Drupal module that
provides an autoload
strategy (next).
Drush Make
{
"name": "organization/project",
"description": "Drupal composer.json file",
"repositories": [
{
"type": "composer",
"url": "http://packagist.drupal-composer.org/"
}
],
"require": {
"davidbarratt/custom-installer": "dev-master",
"derhasi/composer-preserve-paths": "0.1.*",
"drupal/drupal": "7.*",
"drupal/composer_vendor": "7.1.*",
"http/guzzle": "~5",
"drupal/devel": "7.1.*",
},
…
}
; Drush make file that uses guzzle
; API
api = 2
; Core
core = 7.x
; Drupal project.
projects[drupal][type] = core
projects[drupal][version] = 7.x
projects[drupal][download][type] = git
projects[drupal][download][branch] = 7.x
; Modules
projects[] = composer_manager
projects[] = aws_glacier
projects[] = devel
Pantheon.io / Prometsource.com 16
Autoloading in PHP
"autoload": {
"psr-4": {
"GuzzleHttp": "src/"
}
},
composer.json from guzzlehttp/guzzle
autoload_psr4.php generated by Composer via composer install
$vendorDir = dirname(dirname(__FILE__));
return array(
'GuzzleHttp' => array($vendorDir .
'/guzzlehttp/guzzle/src'),
);
Saves one line of code per class - but it’s a very important line!
RUN TIME INSTALL TIME
<?php
include "vendor/autoload.php";
$client = new GuzzleHTTPClient();
php source file that calls GuzzleHTTP
$map = require __DIR__ . '/autoload_psr4.php';
foreach ($map as $namespace => $path) {
$loader->setPsr4($namespace, $path);
}
Composer autoloader registration called from vendor/autoload.php
include $vendorDir . '/guzzlehttp/guzzle/src/Client.php';
Pantheon.io / Prometsource.com 17
Custom Installers for Composer + D7
generalredneck/drupal-libraries-installer-plugin
promet/drupal-tangler
derhasi/composer-preserve-paths
davidbarratt/custom-installer
OR
OPTIONAL
netresearch/composer-patches-plugin
Allows composer.json files to specify where
components get installed.
Allows nested installation of composer libraries (e.
g. Drupal modules inside of
Drupal core).
Installs modules and themes to their standard
location in the vendor directory, and symlinks
to them from sites/all/modules/contrib or
copies them to sites/all/modules/contrib.
Allows composer.json files to specify where
components get installed.
Allows patch files to be applied to Drupal core
or contrib modules after Composer installs
them.
Pantheon.io / Prometsource.com 18
Adding Composer Support
To make this work, we just need to include vendor/autoload.php
+ =
Pantheon.io / Prometsource.com
INSTALLING DRUPAL 7 WITH
COMPOSER
PART
TWO
Pantheon.io / Prometsource.com
Searches for
composer.json files
in every module
and dynamically
merges them.
20
Composer Options for Drupal 7
composer_autoload composer_manager
Fragile Complex
Searches for
autoload.php files
in every module
directory and loads
them individually.
Pantheon.io / Prometsource.com
Writes a settings.php
file that loads the correct
autoload.php file.
Loads the
sites/all/vendor/au
toload.php
file.
21
Better Options for Drupal 7
composer_vendor promet/drupal-tangler
Wins! Wins!
Pantheon.io / Prometsource.com 22
Directory Structure
mydrupalsite.org
composer.json
composer.lock
htdocs
sites
default
settings.php
files
all
modules
We create a new top-level directory for our project,
because composer cannot manage dependencies in
the same directory as composer.json.
We will put our Drupal root directory in htdocs.
Tangler defaults to www but allows the option to
specify a different name.
With drupal-tangler
Pantheon.io / Prometsource.com 23
Directory Structure
mydrupalsite.org
vendor
drupal
views
composer
htdocs
sites
default
vendor -> ../../../vendor
all
modules
contrib
views -> ../../../../../vendor/drupal/views
We put the vendor directory in root because that
is the default location for the Composer installer.
The directory is organized by vendor name.
Each contributed module directory is symlinked
to the corresponding directory in vendor.
With drupal-tangler
Pantheon.io / Prometsource.com 24
Directory Structure
mydrupalsite.org
modules
custom
feature_modules
htdocs
sites
all
modules
custom -> ../../../../modules/custom
feature_modules ->
../../../../modules/feature_modules
We put custom modules in the custom directory
in the modules directory in root.
The feature_modules directory is symlinked to
the feature_modules directory in the modules
directory in root.
With drupal-tangler
We will put our Drupal root directory in htdocs.
Tangler defaults to www but allows the option to
specify a different name.
The custom directory is symlinked to the custom
directory in the modules directory in root.
Pantheon.io / Prometsource.com 25
Directory Structure
mydrupalsite.org
cnf
config.yml.dist
config.yml
htdocs
sites
default
settings.php
We put default configuration for settings in
config.yml.dist.
We put default configuration for settings in
config.yml.dist.
The settings.php file is generated by
settings_compile from config.yml. If config.
yml does not exist, it is generated from config.
yml.dist.
With drupal-tangler
Pantheon.io / Prometsource.com 26
Use Installation Profiles
mydrupalsite.org
vendor
drupal
panopoly
htdocs
profiles
panopoly -> ../../vendor/drupal/panopoly
Composer downloads the profile to the drupal
directory in the vendor directory.
The panopoly directory is symlinked to the
panopoly directory in the vendor directory.
With drupal-tangler
Pantheon.io / Prometsource.com 27
Directory Structure
mydrupalsite.org
composer.json
composer.lock
htdocs
sites
default
settings.php
files
all
modules
vendor
We create a new top-level directory for our project,
because composer cannot manage dependencies in
the same directory as composer.json.
We will put our Drupal root directory in htdocs.
We put the vendor directory in
sites/all/vendor because that is where the
composer_vendor project expects to find it.
With composer_vendor
Pantheon.io / Prometsource.com 28
Place the Vendor Directory
composer.json
{
"require": {
…
},
"config": {
"vendor-dir": "htdocs/sites/all/vendor"
},
…
}
For composer_vendor with a custom-installer
Pantheon.io / Prometsource.com 29
Place Modules and Themes
{
"require": {
"davidbarratt/custom-installer": "dev-master",
…
},
"extra": {
"custom-installer": {
"drupal-module": "htdocs/sites/all/modules/contrib/{$name}/",
"drupal-theme": "htdocs/sites/all/themes/contrib/{$name}/"
},
},
…
}
composer.json
For composer_vendor with a custom-installer
Pantheon.io / Prometsource.com 30
Use Installation Profiles
{
"require": {
"davidbarratt/custom-installer": "dev-master",
"drupal/panopoly": "7.1.*",
…
},
"extra": {
"custom-installer": {
"drupal-profile": "htdocs/profiles/{$name}/"
},
},
…
}
composer_vendor
composer.json
For composer_vendor with a custom-installer
Pantheon.io / Prometsource.com 31
Downloading Modules
$ drush dl devel
Project devel (7.x-1.5) downloaded to
sites/all/modules/contrib/devel.
Project devel contains 3 modules:
devel_generate, devel, devel_node_access.
$ composer require drupal/devel '7.*'
./composer.json has been updated
Loading composer repositories with package
information
Updating dependencies (including require-dev)
Drush Composer
Drush will select the right module major version, but composer require
must be told which version to use.
Composer require will update the composer.json file before
installing the module.
Pantheon.io / Prometsource.com 32
Install a Module from a Private Repository
{
"repositories": [
{
"type": "vcs",
"url": "https://github.com/your-org/your-module"
}
],
"require": {
"your-org/your-module": "dev-master"
},
…
} https://knpuniversity.com/screencast/question-answer-day/create-composer-package
composer.json
For composer_vendor and drupal-tangler
Pantheon.io / Prometsource.com 33
Add a Patch to a Module
{
"require": {
"netresearch/composer-patches-plugin": "~1.0"
},
"extra": {
"patches": {
"drupal/features": {
"7.2.2":[
{
"title": "Remove mtime from .info export (added by Drupal 7.33)",
"url": "https://www.drupal.org/files/issues/2381739-features-mtime.patch"
}
]
}
}
},
…
} http://cambrico.net/drupal/using-composer-to-build-your-drupal-7-projects
composer.json
For composer_vendor and drupal-tangler
Pantheon.io / Prometsource.com 34
Use a Composer Library from a Module
1.Add a composer.json and require the library
2.There is no step two!
VERY IMPORTANT - Never try to include an autoload.php file from a
plug-in; always leave autoloader management to the application.
Pantheon.io / Prometsource.com 35
Use Composer from a Drush Command
1.Add a composer.json and require the library
2.Call drush_autoload(__FILE__) from your
hook_drush_init().
3.Require your Drush command in the composer.json of the Drupal
site it is used in.
Pantheon.io / Prometsource.com
Tangler works
the same
36
Updating a Site
$ drush pm-update $ composer update
$ drush updatedb
Composer
Remember - regardless of how you update your site, always
do it on a copy first. Never update directly on the
production site!
Drush
Pantheon.io / Prometsource.com
MANAGING YOUR PROJECT
PART
THREE
Pantheon.io / Prometsource.com 38
Manage Project Code
mydrupalsite.org
.git
composer.json
composer.lock
.gitignore
cnf
config.yml.dist
config.yml
modules
htdocs
sites
all
modules
contrib
vendor
Commit composer.json. and composer.lock to the
repository. composer.lock only changes when
you run composer update.
If you have custom modules, you can commit
them in the modules directory.
Avoid committing the htdocs directory, which is
managed by drupal-tangler
With drupal-tangler
Commit config.yml.dist.
Avoid committing config.yml.
Pantheon.io / Prometsource.com 39
Manage Project Code
mydrupalsite.org
.git
composer.json
composer.lock
.gitignore
htdocs
sites
all
modules
custom
contrib
vendor
Commit composer.json. and composer.lock to
the repository. composer.lock only changes
when you run composer update.
If you have custom modules, you can commit
them in the custom directory..
Avoid committing composer-managed
directories, such as
sites/all/modules/contrib and
sites/all/vendor.
With composer_vendor
Pantheon.io / Prometsource.com 40
Deploy Code Using Composer
Local and Remote Dev Environments
install
clone
clone
1
2
3 4
install
Pantheon.io / Prometsource.com 41
Deploy Code Using Rsync
Copy code from dev to stage or live
rsyncinstallclone
1 2 3
Pantheon.io / Prometsource.com 42
Deploy Code Using Two Repositories
Isolate the Provider’s Repository
clone
installclone
commi
t
rsync
pull
Deploy with git while
maintaining a lean working
repository by writing a
short deploy script.
2 3
4
1
5
6
Pantheon.io / Prometsource.com 43
Converting an Existing Site
$ drush dl composer_generate
$ drush @site composer-generate > composer.json
$ composer install
# Set up settings.php, copy files…
$ drush site-install
Pantheon.io / Prometsource.com 44
Creating a New Site
drupal-composer/drupal-project
$ composer create-project drupal-
composer/drupal-project:7.x-dev dir
--stability dev --no-interaction
# Set up settings.php, copy files…
$ drush site-install
Pantheon.io / Prometsource.com 45
Creating a New Site
promet/drupal7-framework
$ composer create-project promet/drupal7-
framework project_name
$ vagrant up --provision
Pantheon.io / Prometsource.com 46
Where Do We Go From Here?
https://groups.drupal.org/composer
http://drupal-composer.org/
https://github.com/drupal-composer
https://getcomposer.org/
@greg_1_anderson
@dsdobrzynski
@general_redneck

Mais conteúdo relacionado

Mais procurados

OpenNTF Webinar, May 19, 2020
OpenNTF Webinar, May 19, 2020OpenNTF Webinar, May 19, 2020
OpenNTF Webinar, May 19, 2020
Howard Greenberg
 
A FUTURE-FOCUSED DIGITAL PLATFORM WITH DRUPAL 8
A FUTURE-FOCUSED DIGITAL PLATFORM WITH DRUPAL 8A FUTURE-FOCUSED DIGITAL PLATFORM WITH DRUPAL 8
A FUTURE-FOCUSED DIGITAL PLATFORM WITH DRUPAL 8
Phase2
 
Cisco webex zend con2010 presentation
Cisco webex zend con2010 presentationCisco webex zend con2010 presentation
Cisco webex zend con2010 presentation
Enterprise PHP Center
 

Mais procurados (20)

Arif_Shaik_CV
Arif_Shaik_CVArif_Shaik_CV
Arif_Shaik_CV
 
OpenNTF Webinar, May 19, 2020
OpenNTF Webinar, May 19, 2020OpenNTF Webinar, May 19, 2020
OpenNTF Webinar, May 19, 2020
 
VijayresumeIBM
VijayresumeIBMVijayresumeIBM
VijayresumeIBM
 
IBM Connect2014 JMP106
IBM Connect2014 JMP106IBM Connect2014 JMP106
IBM Connect2014 JMP106
 
OpenNTF Webinar, March, 2021
OpenNTF Webinar, March, 2021OpenNTF Webinar, March, 2021
OpenNTF Webinar, March, 2021
 
Managing Translation Workflows in Drupal 7
Managing Translation Workflows in Drupal 7Managing Translation Workflows in Drupal 7
Managing Translation Workflows in Drupal 7
 
CollabSphere 2021 - DEV114 - The Nuts and Bolts of CI/CD With a Large XPages ...
CollabSphere 2021 - DEV114 - The Nuts and Bolts of CI/CD With a Large XPages ...CollabSphere 2021 - DEV114 - The Nuts and Bolts of CI/CD With a Large XPages ...
CollabSphere 2021 - DEV114 - The Nuts and Bolts of CI/CD With a Large XPages ...
 
SAPUI5/OpenUI5 - Continuous Integration
SAPUI5/OpenUI5 - Continuous IntegrationSAPUI5/OpenUI5 - Continuous Integration
SAPUI5/OpenUI5 - Continuous Integration
 
A FUTURE-FOCUSED DIGITAL PLATFORM WITH DRUPAL 8
A FUTURE-FOCUSED DIGITAL PLATFORM WITH DRUPAL 8A FUTURE-FOCUSED DIGITAL PLATFORM WITH DRUPAL 8
A FUTURE-FOCUSED DIGITAL PLATFORM WITH DRUPAL 8
 
OpenNTF Webinar Series: DQL with John Curtis September 2020
OpenNTF Webinar Series: DQL with John Curtis September 2020OpenNTF Webinar Series: DQL with John Curtis September 2020
OpenNTF Webinar Series: DQL with John Curtis September 2020
 
Cisco webex zend con2010 presentation
Cisco webex zend con2010 presentationCisco webex zend con2010 presentation
Cisco webex zend con2010 presentation
 
AD201 - IBM Domino Application Development Today And Tomorrow
AD201 - IBM Domino Application Development Today And TomorrowAD201 - IBM Domino Application Development Today And Tomorrow
AD201 - IBM Domino Application Development Today And Tomorrow
 
Developer Experience Overview
Developer Experience OverviewDeveloper Experience Overview
Developer Experience Overview
 
Bad camp2016 Release Management On Live Websites
Bad camp2016 Release Management On Live WebsitesBad camp2016 Release Management On Live Websites
Bad camp2016 Release Management On Live Websites
 
Dr. Strangelove, or how I learned to love plugin development
Dr. Strangelove, or how I learned to love plugin developmentDr. Strangelove, or how I learned to love plugin development
Dr. Strangelove, or how I learned to love plugin development
 
Alfresco DevCon 2018 - Embedding Pentaho dashboards into an Alfresco ADF appl...
Alfresco DevCon 2018 - Embedding Pentaho dashboards into an Alfresco ADF appl...Alfresco DevCon 2018 - Embedding Pentaho dashboards into an Alfresco ADF appl...
Alfresco DevCon 2018 - Embedding Pentaho dashboards into an Alfresco ADF appl...
 
eZ Publish Platform 5.2 and roadmap
eZ Publish Platform 5.2 and roadmapeZ Publish Platform 5.2 and roadmap
eZ Publish Platform 5.2 and roadmap
 
July 2020 OpenNTF Webinar - Hear the Latest from the User Groups!
July 2020 OpenNTF Webinar - Hear the Latest from the User Groups!July 2020 OpenNTF Webinar - Hear the Latest from the User Groups!
July 2020 OpenNTF Webinar - Hear the Latest from the User Groups!
 
Mulesoft KL Meetup 2
Mulesoft KL Meetup 2Mulesoft KL Meetup 2
Mulesoft KL Meetup 2
 
不只自動化而且更敏捷的Android開發工具 gradle
不只自動化而且更敏捷的Android開發工具 gradle不只自動化而且更敏捷的Android開發工具 gradle
不只自動化而且更敏捷的Android開發工具 gradle
 

Destaque

Automated testing DrupalCamp in Asheville
Automated testing DrupalCamp in AshevilleAutomated testing DrupalCamp in Asheville
Automated testing DrupalCamp in Asheville
Promet Source
 

Destaque (6)

Front End page speed performance improvements for Drupal
Front End page speed performance improvements for DrupalFront End page speed performance improvements for Drupal
Front End page speed performance improvements for Drupal
 
Automated testing DrupalCamp in Asheville
Automated testing DrupalCamp in AshevilleAutomated testing DrupalCamp in Asheville
Automated testing DrupalCamp in Asheville
 
Responsive Design Testing the Promet Way
Responsive Design Testing the Promet WayResponsive Design Testing the Promet Way
Responsive Design Testing the Promet Way
 
Using Commerce License for Premium Content on Drupal Sites
Using Commerce License for Premium Content on Drupal SitesUsing Commerce License for Premium Content on Drupal Sites
Using Commerce License for Premium Content on Drupal Sites
 
Drupal 8 Involvement with Promet Source
Drupal 8 Involvement with Promet SourceDrupal 8 Involvement with Promet Source
Drupal 8 Involvement with Promet Source
 
Drupal Continuous Integration and devops - Beyond Jenkins
Drupal Continuous Integration and devops - Beyond JenkinsDrupal Continuous Integration and devops - Beyond Jenkins
Drupal Continuous Integration and devops - Beyond Jenkins
 

Semelhante a Composer tools and frameworks for Drupal

5 Important Tools for Drupal Development
5 Important Tools for Drupal Development5 Important Tools for Drupal Development
5 Important Tools for Drupal Development
jcarrig
 
LuisRodriguezLocalDevEnvironmentsDrupalOpenDays
LuisRodriguezLocalDevEnvironmentsDrupalOpenDaysLuisRodriguezLocalDevEnvironmentsDrupalOpenDays
LuisRodriguezLocalDevEnvironmentsDrupalOpenDays
Luis Rodríguez Castromil
 

Semelhante a Composer tools and frameworks for Drupal (20)

Composer Tools & Frameworks for Drupal
Composer Tools & Frameworks for DrupalComposer Tools & Frameworks for Drupal
Composer Tools & Frameworks for Drupal
 
Exploring composer in drupal 8 with drupal project - salva molina
Exploring composer in drupal 8 with drupal project - salva molinaExploring composer in drupal 8 with drupal project - salva molina
Exploring composer in drupal 8 with drupal project - salva molina
 
Using Composer with Drupal and Drush
Using Composer with Drupal and DrushUsing Composer with Drupal and Drush
Using Composer with Drupal and Drush
 
Introduction to Composer for Drupal
Introduction to Composer for DrupalIntroduction to Composer for Drupal
Introduction to Composer for Drupal
 
Managing your Drupal project with Composer
Managing your Drupal project with ComposerManaging your Drupal project with Composer
Managing your Drupal project with Composer
 
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
 
Composer & Drupal
Composer & DrupalComposer & Drupal
Composer & Drupal
 
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
 
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...
 
Introduction to Drupal - Installation, Anatomy, Terminologies
Introduction to Drupal - Installation, Anatomy, TerminologiesIntroduction to Drupal - Installation, Anatomy, Terminologies
Introduction to Drupal - Installation, Anatomy, Terminologies
 
Composer JSON kills make files
Composer JSON kills make filesComposer JSON kills make files
Composer JSON kills make files
 
Drush in the Composer Era
Drush in the Composer EraDrush in the Composer Era
Drush in the Composer Era
 
5 Important Tools for Drupal Development
5 Important Tools for Drupal Development5 Important Tools for Drupal Development
5 Important Tools for Drupal Development
 
Efficient development workflows with composer
Efficient development workflows with composerEfficient development workflows with composer
Efficient development workflows with composer
 
Drupal + composer = new love !?
Drupal + composer = new love !?Drupal + composer = new love !?
Drupal + composer = new love !?
 
LuisRodriguezLocalDevEnvironmentsDrupalOpenDays
LuisRodriguezLocalDevEnvironmentsDrupalOpenDaysLuisRodriguezLocalDevEnvironmentsDrupalOpenDays
LuisRodriguezLocalDevEnvironmentsDrupalOpenDays
 
Efficient development workflows with composer
Efficient development workflows with composerEfficient development workflows with composer
Efficient development workflows with composer
 
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
 
Aleksandr Kutsan "Managing Dependencies in C++"
Aleksandr Kutsan "Managing Dependencies in C++"Aleksandr Kutsan "Managing Dependencies in C++"
Aleksandr Kutsan "Managing Dependencies in C++"
 
Welcome aboard the team
Welcome aboard the teamWelcome aboard the team
Welcome aboard the team
 

Mais de Promet Source

Higher Ed Web 2013 presentation - Field of Dreams, build it and they will come
Higher Ed Web 2013 presentation - Field of Dreams, build it and they will comeHigher Ed Web 2013 presentation - Field of Dreams, build it and they will come
Higher Ed Web 2013 presentation - Field of Dreams, build it and they will come
Promet Source
 
Open Source Software: An Edge For Your Growing Business
Open Source Software: An Edge For Your Growing BusinessOpen Source Software: An Edge For Your Growing Business
Open Source Software: An Edge For Your Growing Business
Promet Source
 

Mais de Promet Source (20)

How To Start Building Your Own Website With Drupal by Mary Chris Casis
How To Start Building Your Own Website With Drupal by Mary Chris CasisHow To Start Building Your Own Website With Drupal by Mary Chris Casis
How To Start Building Your Own Website With Drupal by Mary Chris Casis
 
DrupalCamp Cebu 2018 R&F by Andrew Kucharski
DrupalCamp Cebu 2018 R&F by Andrew KucharskiDrupalCamp Cebu 2018 R&F by Andrew Kucharski
DrupalCamp Cebu 2018 R&F by Andrew Kucharski
 
Unit test in drupal 8 by Pratomo Ardianto Drupalcamp Cebu 2018
Unit test in drupal 8 by Pratomo Ardianto Drupalcamp Cebu 2018Unit test in drupal 8 by Pratomo Ardianto Drupalcamp Cebu 2018
Unit test in drupal 8 by Pratomo Ardianto Drupalcamp Cebu 2018
 
Migrating to-Drupal-8 by Bryan Manalo
Migrating to-Drupal-8 by Bryan ManaloMigrating to-Drupal-8 by Bryan Manalo
Migrating to-Drupal-8 by Bryan Manalo
 
Why and When to use Drupal by Luc Bezier - Drupalcamp Cebu 2018
Why and When to use Drupal by Luc Bezier - Drupalcamp Cebu 2018Why and When to use Drupal by Luc Bezier - Drupalcamp Cebu 2018
Why and When to use Drupal by Luc Bezier - Drupalcamp Cebu 2018
 
Drupal Development with Docker
Drupal Development with DockerDrupal Development with Docker
Drupal Development with Docker
 
Migrating Drupal 7 to Drupal 8
Migrating Drupal 7 to Drupal 8Migrating Drupal 7 to Drupal 8
Migrating Drupal 7 to Drupal 8
 
Web Accessibility in Drupal
Web Accessibility in DrupalWeb Accessibility in Drupal
Web Accessibility in Drupal
 
Optimize and succeed your next Fixed Budget Project planning process
Optimize and succeed your next Fixed Budget Project planning process Optimize and succeed your next Fixed Budget Project planning process
Optimize and succeed your next Fixed Budget Project planning process
 
Diy continuous integration
Diy continuous integrationDiy continuous integration
Diy continuous integration
 
Higher Ed Web 2013 presentation - Field of Dreams, build it and they will come
Higher Ed Web 2013 presentation - Field of Dreams, build it and they will comeHigher Ed Web 2013 presentation - Field of Dreams, build it and they will come
Higher Ed Web 2013 presentation - Field of Dreams, build it and they will come
 
Getting agile with drupal
Getting agile with drupalGetting agile with drupal
Getting agile with drupal
 
Project Estimation Presentation - Donte's 8th level of estimating level of ef...
Project Estimation Presentation - Donte's 8th level of estimating level of ef...Project Estimation Presentation - Donte's 8th level of estimating level of ef...
Project Estimation Presentation - Donte's 8th level of estimating level of ef...
 
DrupalCon 2013 Making Support Fun & Profitable
DrupalCon 2013 Making Support Fun & ProfitableDrupalCon 2013 Making Support Fun & Profitable
DrupalCon 2013 Making Support Fun & Profitable
 
DevOps for Drupal: Why We Cook With Chef
DevOps for Drupal: Why We Cook With ChefDevOps for Drupal: Why We Cook With Chef
DevOps for Drupal: Why We Cook With Chef
 
DIY Support? 5 Key Benefits of Managed Drupal Support
DIY Support? 5 Key Benefits of Managed Drupal SupportDIY Support? 5 Key Benefits of Managed Drupal Support
DIY Support? 5 Key Benefits of Managed Drupal Support
 
Open Source Software: An Edge For Your Growing Business
Open Source Software: An Edge For Your Growing BusinessOpen Source Software: An Edge For Your Growing Business
Open Source Software: An Edge For Your Growing Business
 
Augmented Reality March Webinar
Augmented Reality March WebinarAugmented Reality March Webinar
Augmented Reality March Webinar
 
Automated testing with Drupal
Automated testing with DrupalAutomated testing with Drupal
Automated testing with Drupal
 
AutoScaling and Drupal
AutoScaling and DrupalAutoScaling and Drupal
AutoScaling and Drupal
 

Último

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
Safe Software
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Último (20)

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
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
 
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
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
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...
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
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...
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
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
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 

Composer tools and frameworks for Drupal

  • 1. Pantheon.io / Prometsource.com JULY 22-24, 2015 NATIONAL INSTITUTES OF HEALTH CAMPUS BETHESDA, MD Composer Tools and Frameworks for Drupal
  • 2. Pantheon.io / Prometsource.com Why you should care about composer Today ➢ Dependency Management Hell ➢ Manually Include Classes at runtime ➢ Large unmanagable repository ➢ Composer manages dependencies ➢ Autoloader lazy-includes class files ➢ Repository remains clean and lean With Composer
  • 3. Pantheon.io / Prometsource.com Composer Tools and Frameworks for Drupal + =+ COMPOSER DRUPAL DRUSH WIN
  • 4. Pantheon.io / Prometsource.com 4 Who Are We? Greg Anderson Doug Dobrzynski
  • 5. Pantheon.io / Prometsource.com 5 Who Are We? Allan Chappell Senior Solutions Architect
  • 6. Pantheon.io / Prometsource.com 6 Agenda ‣What is Composer? ‣Installing Drupal 7 with Composer •composer_vendor + custom-installer •drupal-tangler ‣Managing Your Project
  • 7. Pantheon.io / Prometsource.com WHAT IS COMPOSER? PART ONE
  • 8. Pantheon.io / Prometsource.com 8 What Is Composer? An Installer A Dependency Manager An Autoloader { "require": { "php": ">=5.4.0", "symfony/browser-kit": "~2.1", "symfony/css-selector": "~2.1", "symfony/dom-crawler": "~2.1", "guzzlehttp/guzzle": ">=4,<6" }, … } Evaluate and select <?php $client = new GuzzleHttpClient(); >=4,<6 guzzlehttp/guzzle 5.* guzzlehttp/guzzle v5.2.0 guzzlehttp/guzzle "autoload": { "psr-4": { "GuzzleHttp": "src/" } }, composer.json
  • 9. Pantheon.io / Prometsource.com 9 Why Use Composer? ‣Standard ‣Easiest for developers •Dependency resolution •Code updates •Autoloading of classes ‣Composer is being adopted everywhere
  • 10. Pantheon.io / Prometsource.com 1 What Projects Are Using Composer? Not Using Composer … and many others! http/guzzle fabpot/goutteDrupal Modules Drush Extensions PHP APIs symfony/yaml twig/twig Not Using ComposerUsing Composer
  • 11. Pantheon.io / Prometsource.com 11 Drupal 7 and Composer Can we do this? ?+ =
  • 12. Pantheon.io / Prometsource.com 12 Composer Parts of the Whole Composer PHP dependency management software. Packagist A software repository manager. Custom Installer An executable Composer component. Optional. autoload.php A generated file that must be included by your app. composer.json A structured file that defines a project.
  • 13. Pantheon.io / Prometsource.com 13 Repository Data for Drupal Projects packagist.drupal-composer.org A third-party repository containing data on projects from drupal.org.
  • 14. Pantheon.io / Prometsource.com 14 Semantic Versioning Drupal Module Version 7.x-1.5 DRUPAL-x.MODULE.MINOR Versions are converted to semantic versioning before being published on packagist.drupal-composer.org. 7.1.5 MAJOR.MINOR.PATCH Composer Version
  • 15. Pantheon.io / Prometsource.com 15 Comparison with Drush Make composer.json Repository and custom installers (previously explained) Drupal module that provides an autoload strategy (next). Drush Make { "name": "organization/project", "description": "Drupal composer.json file", "repositories": [ { "type": "composer", "url": "http://packagist.drupal-composer.org/" } ], "require": { "davidbarratt/custom-installer": "dev-master", "derhasi/composer-preserve-paths": "0.1.*", "drupal/drupal": "7.*", "drupal/composer_vendor": "7.1.*", "http/guzzle": "~5", "drupal/devel": "7.1.*", }, … } ; Drush make file that uses guzzle ; API api = 2 ; Core core = 7.x ; Drupal project. projects[drupal][type] = core projects[drupal][version] = 7.x projects[drupal][download][type] = git projects[drupal][download][branch] = 7.x ; Modules projects[] = composer_manager projects[] = aws_glacier projects[] = devel
  • 16. Pantheon.io / Prometsource.com 16 Autoloading in PHP "autoload": { "psr-4": { "GuzzleHttp": "src/" } }, composer.json from guzzlehttp/guzzle autoload_psr4.php generated by Composer via composer install $vendorDir = dirname(dirname(__FILE__)); return array( 'GuzzleHttp' => array($vendorDir . '/guzzlehttp/guzzle/src'), ); Saves one line of code per class - but it’s a very important line! RUN TIME INSTALL TIME <?php include "vendor/autoload.php"; $client = new GuzzleHTTPClient(); php source file that calls GuzzleHTTP $map = require __DIR__ . '/autoload_psr4.php'; foreach ($map as $namespace => $path) { $loader->setPsr4($namespace, $path); } Composer autoloader registration called from vendor/autoload.php include $vendorDir . '/guzzlehttp/guzzle/src/Client.php';
  • 17. Pantheon.io / Prometsource.com 17 Custom Installers for Composer + D7 generalredneck/drupal-libraries-installer-plugin promet/drupal-tangler derhasi/composer-preserve-paths davidbarratt/custom-installer OR OPTIONAL netresearch/composer-patches-plugin Allows composer.json files to specify where components get installed. Allows nested installation of composer libraries (e. g. Drupal modules inside of Drupal core). Installs modules and themes to their standard location in the vendor directory, and symlinks to them from sites/all/modules/contrib or copies them to sites/all/modules/contrib. Allows composer.json files to specify where components get installed. Allows patch files to be applied to Drupal core or contrib modules after Composer installs them.
  • 18. Pantheon.io / Prometsource.com 18 Adding Composer Support To make this work, we just need to include vendor/autoload.php + =
  • 19. Pantheon.io / Prometsource.com INSTALLING DRUPAL 7 WITH COMPOSER PART TWO
  • 20. Pantheon.io / Prometsource.com Searches for composer.json files in every module and dynamically merges them. 20 Composer Options for Drupal 7 composer_autoload composer_manager Fragile Complex Searches for autoload.php files in every module directory and loads them individually.
  • 21. Pantheon.io / Prometsource.com Writes a settings.php file that loads the correct autoload.php file. Loads the sites/all/vendor/au toload.php file. 21 Better Options for Drupal 7 composer_vendor promet/drupal-tangler Wins! Wins!
  • 22. Pantheon.io / Prometsource.com 22 Directory Structure mydrupalsite.org composer.json composer.lock htdocs sites default settings.php files all modules We create a new top-level directory for our project, because composer cannot manage dependencies in the same directory as composer.json. We will put our Drupal root directory in htdocs. Tangler defaults to www but allows the option to specify a different name. With drupal-tangler
  • 23. Pantheon.io / Prometsource.com 23 Directory Structure mydrupalsite.org vendor drupal views composer htdocs sites default vendor -> ../../../vendor all modules contrib views -> ../../../../../vendor/drupal/views We put the vendor directory in root because that is the default location for the Composer installer. The directory is organized by vendor name. Each contributed module directory is symlinked to the corresponding directory in vendor. With drupal-tangler
  • 24. Pantheon.io / Prometsource.com 24 Directory Structure mydrupalsite.org modules custom feature_modules htdocs sites all modules custom -> ../../../../modules/custom feature_modules -> ../../../../modules/feature_modules We put custom modules in the custom directory in the modules directory in root. The feature_modules directory is symlinked to the feature_modules directory in the modules directory in root. With drupal-tangler We will put our Drupal root directory in htdocs. Tangler defaults to www but allows the option to specify a different name. The custom directory is symlinked to the custom directory in the modules directory in root.
  • 25. Pantheon.io / Prometsource.com 25 Directory Structure mydrupalsite.org cnf config.yml.dist config.yml htdocs sites default settings.php We put default configuration for settings in config.yml.dist. We put default configuration for settings in config.yml.dist. The settings.php file is generated by settings_compile from config.yml. If config. yml does not exist, it is generated from config. yml.dist. With drupal-tangler
  • 26. Pantheon.io / Prometsource.com 26 Use Installation Profiles mydrupalsite.org vendor drupal panopoly htdocs profiles panopoly -> ../../vendor/drupal/panopoly Composer downloads the profile to the drupal directory in the vendor directory. The panopoly directory is symlinked to the panopoly directory in the vendor directory. With drupal-tangler
  • 27. Pantheon.io / Prometsource.com 27 Directory Structure mydrupalsite.org composer.json composer.lock htdocs sites default settings.php files all modules vendor We create a new top-level directory for our project, because composer cannot manage dependencies in the same directory as composer.json. We will put our Drupal root directory in htdocs. We put the vendor directory in sites/all/vendor because that is where the composer_vendor project expects to find it. With composer_vendor
  • 28. Pantheon.io / Prometsource.com 28 Place the Vendor Directory composer.json { "require": { … }, "config": { "vendor-dir": "htdocs/sites/all/vendor" }, … } For composer_vendor with a custom-installer
  • 29. Pantheon.io / Prometsource.com 29 Place Modules and Themes { "require": { "davidbarratt/custom-installer": "dev-master", … }, "extra": { "custom-installer": { "drupal-module": "htdocs/sites/all/modules/contrib/{$name}/", "drupal-theme": "htdocs/sites/all/themes/contrib/{$name}/" }, }, … } composer.json For composer_vendor with a custom-installer
  • 30. Pantheon.io / Prometsource.com 30 Use Installation Profiles { "require": { "davidbarratt/custom-installer": "dev-master", "drupal/panopoly": "7.1.*", … }, "extra": { "custom-installer": { "drupal-profile": "htdocs/profiles/{$name}/" }, }, … } composer_vendor composer.json For composer_vendor with a custom-installer
  • 31. Pantheon.io / Prometsource.com 31 Downloading Modules $ drush dl devel Project devel (7.x-1.5) downloaded to sites/all/modules/contrib/devel. Project devel contains 3 modules: devel_generate, devel, devel_node_access. $ composer require drupal/devel '7.*' ./composer.json has been updated Loading composer repositories with package information Updating dependencies (including require-dev) Drush Composer Drush will select the right module major version, but composer require must be told which version to use. Composer require will update the composer.json file before installing the module.
  • 32. Pantheon.io / Prometsource.com 32 Install a Module from a Private Repository { "repositories": [ { "type": "vcs", "url": "https://github.com/your-org/your-module" } ], "require": { "your-org/your-module": "dev-master" }, … } https://knpuniversity.com/screencast/question-answer-day/create-composer-package composer.json For composer_vendor and drupal-tangler
  • 33. Pantheon.io / Prometsource.com 33 Add a Patch to a Module { "require": { "netresearch/composer-patches-plugin": "~1.0" }, "extra": { "patches": { "drupal/features": { "7.2.2":[ { "title": "Remove mtime from .info export (added by Drupal 7.33)", "url": "https://www.drupal.org/files/issues/2381739-features-mtime.patch" } ] } } }, … } http://cambrico.net/drupal/using-composer-to-build-your-drupal-7-projects composer.json For composer_vendor and drupal-tangler
  • 34. Pantheon.io / Prometsource.com 34 Use a Composer Library from a Module 1.Add a composer.json and require the library 2.There is no step two! VERY IMPORTANT - Never try to include an autoload.php file from a plug-in; always leave autoloader management to the application.
  • 35. Pantheon.io / Prometsource.com 35 Use Composer from a Drush Command 1.Add a composer.json and require the library 2.Call drush_autoload(__FILE__) from your hook_drush_init(). 3.Require your Drush command in the composer.json of the Drupal site it is used in.
  • 36. Pantheon.io / Prometsource.com Tangler works the same 36 Updating a Site $ drush pm-update $ composer update $ drush updatedb Composer Remember - regardless of how you update your site, always do it on a copy first. Never update directly on the production site! Drush
  • 37. Pantheon.io / Prometsource.com MANAGING YOUR PROJECT PART THREE
  • 38. Pantheon.io / Prometsource.com 38 Manage Project Code mydrupalsite.org .git composer.json composer.lock .gitignore cnf config.yml.dist config.yml modules htdocs sites all modules contrib vendor Commit composer.json. and composer.lock to the repository. composer.lock only changes when you run composer update. If you have custom modules, you can commit them in the modules directory. Avoid committing the htdocs directory, which is managed by drupal-tangler With drupal-tangler Commit config.yml.dist. Avoid committing config.yml.
  • 39. Pantheon.io / Prometsource.com 39 Manage Project Code mydrupalsite.org .git composer.json composer.lock .gitignore htdocs sites all modules custom contrib vendor Commit composer.json. and composer.lock to the repository. composer.lock only changes when you run composer update. If you have custom modules, you can commit them in the custom directory.. Avoid committing composer-managed directories, such as sites/all/modules/contrib and sites/all/vendor. With composer_vendor
  • 40. Pantheon.io / Prometsource.com 40 Deploy Code Using Composer Local and Remote Dev Environments install clone clone 1 2 3 4 install
  • 41. Pantheon.io / Prometsource.com 41 Deploy Code Using Rsync Copy code from dev to stage or live rsyncinstallclone 1 2 3
  • 42. Pantheon.io / Prometsource.com 42 Deploy Code Using Two Repositories Isolate the Provider’s Repository clone installclone commi t rsync pull Deploy with git while maintaining a lean working repository by writing a short deploy script. 2 3 4 1 5 6
  • 43. Pantheon.io / Prometsource.com 43 Converting an Existing Site $ drush dl composer_generate $ drush @site composer-generate > composer.json $ composer install # Set up settings.php, copy files… $ drush site-install
  • 44. Pantheon.io / Prometsource.com 44 Creating a New Site drupal-composer/drupal-project $ composer create-project drupal- composer/drupal-project:7.x-dev dir --stability dev --no-interaction # Set up settings.php, copy files… $ drush site-install
  • 45. Pantheon.io / Prometsource.com 45 Creating a New Site promet/drupal7-framework $ composer create-project promet/drupal7- framework project_name $ vagrant up --provision
  • 46. Pantheon.io / Prometsource.com 46 Where Do We Go From Here? https://groups.drupal.org/composer http://drupal-composer.org/ https://github.com/drupal-composer https://getcomposer.org/ @greg_1_anderson @dsdobrzynski @general_redneck