SlideShare a Scribd company logo
Magento 2 Composer for Extensions Distribution
The Dependency Management Problem
• App consists of many components
• Dependencies between components
• Optional components
• Compatibility of components
• Unique components per project
• Components management:
– Install
– Uninstall
– Update
No Dependency Manager / PEAR
First Magento CE Release!
2008
What’s Up with PEAR?
• PEAR – PHP Extension and Application Repository
• System-wide installation
• Strict package structure
• Bureaucracy
• PEAR channel hosting
• Dependency issues
• Usability issues
Magento 1.x Package Management
• Monolith release package
•
• Magento Connect Manager:
– Homegrown packaging format
– GUI for management
• PEAR for CLI management
• Vague module versioning
• Not versioned dependencies
Magento 1.x
release package
Feature Modules
Magento libraries
3rd party libraries
Design themes/skins
Localizations
Still No Dependency Manager
Module Manager “modman”
2010
Modman for Magento 1.x
• Modman – command line tool
• Keeps extensions separately from Magento
• Alternative packaging format
• CLI for management
• Use cases:
– Development
– Deployment
Magento 1.x
module package
Community module
modman
First Composer Release!
First Composer Use for Magento 1.x
Magento 2 Development in Progress
2012
Composer Overview
• Composer – dependency manager for PHP
• Composer – CLI tool
• Dependencies per project
• Versioned dependencies
• Package management:
– Install
– Uninstall
– Update
• Classes autoloading
Composer Basic Usage
1. Declaring project dependencies
composer.json
1. Installing dependencies
php composer.phar install
1. Autoloading dependencies
require 'vendor/autoload.php';
vendor/
autoload.php
Zend/…
…
my_project/
composer.json
Installation via Composer
1. Read composer.json
1. Read required packages
2. Read repositories
3. Append packagist.org to repositories
2. For each package:
1. Download from repository
2. Install dependencies recursively
3. Register plugin, if API implemented
Composer Adoption for Magento 1.x
• Composer plugin for Magento 1.x
magento-hackathon/magento-composer-installer
• Deployment strategies:
– Copy
– Move
– Symlink
• Modman packages support
• Composer packages repository
packages.firegento.com
Magento 1.x Composer Package Example
{
"name": "aoepeople/Aoe_Scheduler",
"type": "magento-module",
"description": "Magento Cron Scheduler",
"require": {
"magento-hackathon/magento-composer-installer": "*"
}
}
composer.json
Magento 1.x Composer Project Example
{
"require": {
"magento/core": "1.9.0.1",
"aoepeople/Aoe_Scheduler": "*",
"magento-hackathon/magento-composer-installer": "*"
},
"repositories": [
{
"type": "composer",
"url": "http://packages.firegento.com"
}
]
}
composer.json
Composer Adoption Obstacles in 1.x
• Monolith CE Composer package
• No strict versioning
• No module API version
• No theme version
• No locale version
• Files not in one directory:
– Module files
– Theme & skin files
magento/core
1.9.0.1
Feature Modules
Magento libraries
3rd party libraries
Design themes/skins
Localizations
composer.json
Composer is De Facto Standard
Projects Drop PEAR Support
Magento 2 Dev Beta Release
Composer Adoption for Magento 2
2014
Composer Adoption in Magento 2
• Prerequisites:
– Self-contained modules
– Self-contained themes
• Monolith Granular core packages
• Fork of the Composer plugin for 1.x
magento/magento-composer-installer
• Composer packages repository
packages.magento.com
Composer Package Types in Magento 2
• Package type defines files destination
• Implemented by the Composer plugin
• Custom package types:
magento2-module
magento2-theme
magento2-language
magento2-library
magento2-component
app/code/
app/design/
app/i18n/
lib/internal/
/
Composer Packages in Magento 2
magento/module-catalog
composer.json
Module
magento/theme-frontend-luma
composer.json
Theme
monolog/monolog
composer.json
3rd party library
magento/language-it_it
composer.json
Localization
Composer Packages in Magento 2
magento/zendframework1
composer.json
3rd party library fork
magento/magento2-base
composer.json
Application skeleton
magento/framework
composer.json
Framework
Magento 2 Module Package Example
{
"name": "magento/module-catalog",
"require": {
"php": "~5.5.0|~5.6.0",
"magento/module-store": "0.42.0-beta9",
"magento/framework": "0.42.0-beta9",
"magento/magento-composer-installer": "*"
},
"type": "magento2-module",
"version": "0.42.0-beta9",
"extra": {
"map": [
["*", "Magento/Catalog"]
]
}
}
composer.json
app/code/
Magento/Catalog/
Core Changes
for Composer Adoption
Module Versioning in Magento 2
• Composer requires semantic versioning
semver.org
• Adoption of Semantic Version 2.0.0
<major>.<minor>.<patch>[-<suffix>]
<major> – Incompatible API changes
<minor> – Add functionality in BC manner
<patch> – BC bug fixes
<suffix> – Stability
Module Version Declaration
Magento 1.x module
config.xml
etc/
Version, not semantic
DB schema version
API version, semantic
Magento 2 module package
module.xml
etc/
composer.json
Module Dependencies Declaration
Magento 1.x module
config.xml
etc/
Magento 2 module package
module.xml
etc/
composer.json
Dependencies
ordered, not versioned
Dependencies
not ordered, versioned
Modules order
Magento 2 Repositories
github.com
magento/magento2 – CE mainline
magento/magento2-community-edition – CE Composer project
magento/magento-composer-installer – Composer plugin
magento/zf1 – Fork of Zend Framework 1.x
Results of Composer Adoption
• Granular core packages
• Semantic versioning
• Versioned dependencies
• Theme dependencies
• Locale dependencies
• Validation of environment
– PHP version
– PHP libraries
Resources
• Magento 2
– devdocs.magento.com – Developer documentation
– github.com/magento/magento2 – CE mainline repository
– github.com/magento/magento2-community-edition – CE Composer
project
– github.com/magento/magento-composer-installer – Composer plugin
– packages.magento.com – Composer packages repository
• Magento 1.x
– github.com/magento-hackathon/magento-composer-installer – Composer
plugin
– packages.firegento.com – Composer packages repository
• Composer
– getcomposer.org – Composer tool
– packagist.org – Composer packages repository
– semver.org – Semantic versioning
Q: When is Magento 2 Release?
A: Magento 2 release schedule:
1. Q4 2014 – Dev Beta  Released Dec 17, 2014
2. Q1 2015 – Dev RC
3. Q3 2015 – Merchant Beta
4. Q4 2015 – Merchant GA
Thank You!
Q & A
Sergii Shymko
sergey@shymko.net

More Related Content

PPTX
Magento 2 overview. Alan Kent
PDF
The journey of mastering Magento 2 for Magento 1 developers
PPTX
Magento 2: A technical overview
PPTX
Max Yekaterynenko: Magento 2 overview
PPTX
Magento 2 Composer for Extensions Distribution
PPTX
Mage Titans USA 2016 M2 deployment
PDF
Magento 2 - An Intro to a Modern PHP-Based System - ZendCon 2015
PDF
MuleSoft Online MeetUp 03_11_2020
Magento 2 overview. Alan Kent
The journey of mastering Magento 2 for Magento 1 developers
Magento 2: A technical overview
Max Yekaterynenko: Magento 2 overview
Magento 2 Composer for Extensions Distribution
Mage Titans USA 2016 M2 deployment
Magento 2 - An Intro to a Modern PHP-Based System - ZendCon 2015
MuleSoft Online MeetUp 03_11_2020

What's hot (20)

PDF
Stockholm MuleSoft Meetup - Albin Kjellin, 15 Feb 2018
PPTX
Indore MuleSoft Meetup #4 : Demystifying Error Handling & Snowflake Integration
PDF
Introducing eZ Publish Platform 5.1 - webinar
PPTX
What's New in Mulesoft Anypoint 7.4
PPTX
Selenium_WebDriver_Training__@2012_-phil_coulson_
PDF
Custom policies in mule 4 and a circuit breaker example
PPT
469-Porting the build system of a commercial RCP Application from Europa to G...
PPTX
Building APIs with Mule and Spring Boot
PPTX
Mule soft meetup_noida_jan_2022
PPTX
Custom MuleSoft connector using Java SDK
ODP
Mule esb domain
PPTX
Announcing asp.net core updates in .net 5 preview 8
PPTX
Mulesoft KL Meetup 2
ODP
Porting smart m3 to the MeeGo
ODP
Mule esb munit
PDF
Ahmedabad MuleSoft Meetup #4
PPTX
Warsaw MuleSoft Meetup #6 - CI/CD
PPTX
MuleSoft CloudHub API Versioning
PDF
NukeViet 5 introduction
PPT
Error Handling in Mulesoft
Stockholm MuleSoft Meetup - Albin Kjellin, 15 Feb 2018
Indore MuleSoft Meetup #4 : Demystifying Error Handling & Snowflake Integration
Introducing eZ Publish Platform 5.1 - webinar
What's New in Mulesoft Anypoint 7.4
Selenium_WebDriver_Training__@2012_-phil_coulson_
Custom policies in mule 4 and a circuit breaker example
469-Porting the build system of a commercial RCP Application from Europa to G...
Building APIs with Mule and Spring Boot
Mule soft meetup_noida_jan_2022
Custom MuleSoft connector using Java SDK
Mule esb domain
Announcing asp.net core updates in .net 5 preview 8
Mulesoft KL Meetup 2
Porting smart m3 to the MeeGo
Mule esb munit
Ahmedabad MuleSoft Meetup #4
Warsaw MuleSoft Meetup #6 - CI/CD
MuleSoft CloudHub API Versioning
NukeViet 5 introduction
Error Handling in Mulesoft
Ad

Viewers also liked (18)

PPT
Urbana hidroinfo
PPT
Hydraulic study of the neretva river
PPT
Zaključci bd razvitak zgk 2008
PPTX
Magento 2 Changes Overview
PPTX
Composer in Magento
TXT
1.php
TXT
H.php
TXT
1 copie
PPTX
Swati Chilwantkar(Rudrapur) Project PPT
PPTX
Magento Performance Toolkit
PPTX
Composer for Magento 1.x and Magento 2
PPTX
Magento 2 Code Migration Tool
PPTX
Black Magic of Code Generation in Magento 2
PPTX
Magento 2 Theme Localization
PPTX
Neretva v07de
PPT
Dobra 2006
PPTX
Magento 1.x to Magento 2 Code Migration Tools
PPT
Stmoritz
Urbana hidroinfo
Hydraulic study of the neretva river
Zaključci bd razvitak zgk 2008
Magento 2 Changes Overview
Composer in Magento
1.php
H.php
1 copie
Swati Chilwantkar(Rudrapur) Project PPT
Magento Performance Toolkit
Composer for Magento 1.x and Magento 2
Magento 2 Code Migration Tool
Black Magic of Code Generation in Magento 2
Magento 2 Theme Localization
Neretva v07de
Dobra 2006
Magento 1.x to Magento 2 Code Migration Tools
Stmoritz
Ad

Similar to Magento 2 Composer for Extensions Distribution (20)

PPTX
Madison PHP - Getting Started with Magento 2
PDF
Convert Magento 1 Extensions to Magento 2
PDF
Manuele Menozzi - Gestione delle dipendenze con Composer in Magento 2
PDF
Magento 2 Modules are Easy!
PPTX
php[world] Magento101
PPTX
MidwestPHP - Getting Started with Magento 2
PPTX
Make implementation of third party elements in magento 2 in 5-times easier
PDF
Oleksii Korshenko - Magento 2 Backwards Compatible Policy
PPTX
Magento 2 - Getting started.
PPTX
Expert guidance on migrating from magento 1 to magento 2
PDF
Intro to Web Components, Polymer & Vaadin Elements
PDF
Magento Community Hangouts 10 Feb, 2021 Composer 2 Support
PDF
Dependency management in Magento with Composer
PPTX
Zendcon magento101
PDF
DevHub 3 - Composer plus Magento
PPTX
Magento 2 Deploy Strategies
PDF
Magento 2 + composer
PDF
Magento Fireside Chat: "Wiring Mageno Projects"
PDF
Optimizing Magento Performance with Zend Server
PPTX
Symfony Under Control by Maxim Romanovsky
Madison PHP - Getting Started with Magento 2
Convert Magento 1 Extensions to Magento 2
Manuele Menozzi - Gestione delle dipendenze con Composer in Magento 2
Magento 2 Modules are Easy!
php[world] Magento101
MidwestPHP - Getting Started with Magento 2
Make implementation of third party elements in magento 2 in 5-times easier
Oleksii Korshenko - Magento 2 Backwards Compatible Policy
Magento 2 - Getting started.
Expert guidance on migrating from magento 1 to magento 2
Intro to Web Components, Polymer & Vaadin Elements
Magento Community Hangouts 10 Feb, 2021 Composer 2 Support
Dependency management in Magento with Composer
Zendcon magento101
DevHub 3 - Composer plus Magento
Magento 2 Deploy Strategies
Magento 2 + composer
Magento Fireside Chat: "Wiring Mageno Projects"
Optimizing Magento Performance with Zend Server
Symfony Under Control by Maxim Romanovsky

More from Sergii Shymko (6)

PPTX
Developing Loosely Coupled Modules with Magento
PPT
Magento 2 Enhanced Theme/Skin Localization
PPTX
Developing Loosely Coupled Modules with Magento
PPTX
Magento 2 View Layer Evolution
PPTX
Running Magento 1.x Extension on Magento 2
PPTX
Code Generation in Magento 2
Developing Loosely Coupled Modules with Magento
Magento 2 Enhanced Theme/Skin Localization
Developing Loosely Coupled Modules with Magento
Magento 2 View Layer Evolution
Running Magento 1.x Extension on Magento 2
Code Generation in Magento 2

Recently uploaded (20)

PDF
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
PPTX
OOP with Java - Java Introduction (Basics)
PPTX
Recipes for Real Time Voice AI WebRTC, SLMs and Open Source Software.pptx
PPTX
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
PDF
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
PPTX
CH1 Production IntroductoryConcepts.pptx
PDF
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
PPTX
bas. eng. economics group 4 presentation 1.pptx
PDF
R24 SURVEYING LAB MANUAL for civil enggi
PPT
CRASH COURSE IN ALTERNATIVE PLUMBING CLASS
PPTX
Foundation to blockchain - A guide to Blockchain Tech
PDF
Automation-in-Manufacturing-Chapter-Introduction.pdf
PPTX
web development for engineering and engineering
PPTX
Internet of Things (IOT) - A guide to understanding
PDF
TFEC-4-2020-Design-Guide-for-Timber-Roof-Trusses.pdf
PDF
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
PDF
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
PDF
Embodied AI: Ushering in the Next Era of Intelligent Systems
PPTX
IOT PPTs Week 10 Lecture Material.pptx of NPTEL Smart Cities contd
PPTX
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
OOP with Java - Java Introduction (Basics)
Recipes for Real Time Voice AI WebRTC, SLMs and Open Source Software.pptx
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
CH1 Production IntroductoryConcepts.pptx
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
bas. eng. economics group 4 presentation 1.pptx
R24 SURVEYING LAB MANUAL for civil enggi
CRASH COURSE IN ALTERNATIVE PLUMBING CLASS
Foundation to blockchain - A guide to Blockchain Tech
Automation-in-Manufacturing-Chapter-Introduction.pdf
web development for engineering and engineering
Internet of Things (IOT) - A guide to understanding
TFEC-4-2020-Design-Guide-for-Timber-Roof-Trusses.pdf
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
Embodied AI: Ushering in the Next Era of Intelligent Systems
IOT PPTs Week 10 Lecture Material.pptx of NPTEL Smart Cities contd
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx

Magento 2 Composer for Extensions Distribution

  • 2. The Dependency Management Problem • App consists of many components • Dependencies between components • Optional components • Compatibility of components • Unique components per project • Components management: – Install – Uninstall – Update
  • 3. No Dependency Manager / PEAR First Magento CE Release! 2008
  • 4. What’s Up with PEAR? • PEAR – PHP Extension and Application Repository • System-wide installation • Strict package structure • Bureaucracy • PEAR channel hosting • Dependency issues • Usability issues
  • 5. Magento 1.x Package Management • Monolith release package • • Magento Connect Manager: – Homegrown packaging format – GUI for management • PEAR for CLI management • Vague module versioning • Not versioned dependencies Magento 1.x release package Feature Modules Magento libraries 3rd party libraries Design themes/skins Localizations
  • 6. Still No Dependency Manager Module Manager “modman” 2010
  • 7. Modman for Magento 1.x • Modman – command line tool • Keeps extensions separately from Magento • Alternative packaging format • CLI for management • Use cases: – Development – Deployment Magento 1.x module package Community module modman
  • 8. First Composer Release! First Composer Use for Magento 1.x Magento 2 Development in Progress 2012
  • 9. Composer Overview • Composer – dependency manager for PHP • Composer – CLI tool • Dependencies per project • Versioned dependencies • Package management: – Install – Uninstall – Update • Classes autoloading
  • 10. Composer Basic Usage 1. Declaring project dependencies composer.json 1. Installing dependencies php composer.phar install 1. Autoloading dependencies require 'vendor/autoload.php'; vendor/ autoload.php Zend/… … my_project/ composer.json
  • 11. Installation via Composer 1. Read composer.json 1. Read required packages 2. Read repositories 3. Append packagist.org to repositories 2. For each package: 1. Download from repository 2. Install dependencies recursively 3. Register plugin, if API implemented
  • 12. Composer Adoption for Magento 1.x • Composer plugin for Magento 1.x magento-hackathon/magento-composer-installer • Deployment strategies: – Copy – Move – Symlink • Modman packages support • Composer packages repository packages.firegento.com
  • 13. Magento 1.x Composer Package Example { "name": "aoepeople/Aoe_Scheduler", "type": "magento-module", "description": "Magento Cron Scheduler", "require": { "magento-hackathon/magento-composer-installer": "*" } } composer.json
  • 14. Magento 1.x Composer Project Example { "require": { "magento/core": "1.9.0.1", "aoepeople/Aoe_Scheduler": "*", "magento-hackathon/magento-composer-installer": "*" }, "repositories": [ { "type": "composer", "url": "http://packages.firegento.com" } ] } composer.json
  • 15. Composer Adoption Obstacles in 1.x • Monolith CE Composer package • No strict versioning • No module API version • No theme version • No locale version • Files not in one directory: – Module files – Theme & skin files magento/core 1.9.0.1 Feature Modules Magento libraries 3rd party libraries Design themes/skins Localizations composer.json
  • 16. Composer is De Facto Standard Projects Drop PEAR Support Magento 2 Dev Beta Release Composer Adoption for Magento 2 2014
  • 17. Composer Adoption in Magento 2 • Prerequisites: – Self-contained modules – Self-contained themes • Monolith Granular core packages • Fork of the Composer plugin for 1.x magento/magento-composer-installer • Composer packages repository packages.magento.com
  • 18. Composer Package Types in Magento 2 • Package type defines files destination • Implemented by the Composer plugin • Custom package types: magento2-module magento2-theme magento2-language magento2-library magento2-component app/code/ app/design/ app/i18n/ lib/internal/ /
  • 19. Composer Packages in Magento 2 magento/module-catalog composer.json Module magento/theme-frontend-luma composer.json Theme monolog/monolog composer.json 3rd party library magento/language-it_it composer.json Localization
  • 20. Composer Packages in Magento 2 magento/zendframework1 composer.json 3rd party library fork magento/magento2-base composer.json Application skeleton magento/framework composer.json Framework
  • 21. Magento 2 Module Package Example { "name": "magento/module-catalog", "require": { "php": "~5.5.0|~5.6.0", "magento/module-store": "0.42.0-beta9", "magento/framework": "0.42.0-beta9", "magento/magento-composer-installer": "*" }, "type": "magento2-module", "version": "0.42.0-beta9", "extra": { "map": [ ["*", "Magento/Catalog"] ] } } composer.json app/code/ Magento/Catalog/
  • 23. Module Versioning in Magento 2 • Composer requires semantic versioning semver.org • Adoption of Semantic Version 2.0.0 <major>.<minor>.<patch>[-<suffix>] <major> – Incompatible API changes <minor> – Add functionality in BC manner <patch> – BC bug fixes <suffix> – Stability
  • 24. Module Version Declaration Magento 1.x module config.xml etc/ Version, not semantic DB schema version API version, semantic Magento 2 module package module.xml etc/ composer.json
  • 25. Module Dependencies Declaration Magento 1.x module config.xml etc/ Magento 2 module package module.xml etc/ composer.json Dependencies ordered, not versioned Dependencies not ordered, versioned Modules order
  • 26. Magento 2 Repositories github.com magento/magento2 – CE mainline magento/magento2-community-edition – CE Composer project magento/magento-composer-installer – Composer plugin magento/zf1 – Fork of Zend Framework 1.x
  • 27. Results of Composer Adoption • Granular core packages • Semantic versioning • Versioned dependencies • Theme dependencies • Locale dependencies • Validation of environment – PHP version – PHP libraries
  • 28. Resources • Magento 2 – devdocs.magento.com – Developer documentation – github.com/magento/magento2 – CE mainline repository – github.com/magento/magento2-community-edition – CE Composer project – github.com/magento/magento-composer-installer – Composer plugin – packages.magento.com – Composer packages repository • Magento 1.x – github.com/magento-hackathon/magento-composer-installer – Composer plugin – packages.firegento.com – Composer packages repository • Composer – getcomposer.org – Composer tool – packagist.org – Composer packages repository – semver.org – Semantic versioning
  • 29. Q: When is Magento 2 Release? A: Magento 2 release schedule: 1. Q4 2014 – Dev Beta  Released Dec 17, 2014 2. Q1 2015 – Dev RC 3. Q3 2015 – Merchant Beta 4. Q4 2015 – Merchant GA
  • 30. Thank You! Q & A Sergii Shymko sergey@shymko.net

Editor's Notes

  • #4: Magento Community Edition 1.? Release
  • #5: PEAR – framework & distribution system PEAR – reusable general-purpose libraries System-wide installation by default
  • #10: Semantic package versioning
  • #11: Directory ‘vendor’
  • #12: Call Composer plugin API, if implemented by a package
  • #13: Plugin developed by community at Magento bugathon Plugin is published at Packagist
  • #16: Not semantic module versioning DB schema version, but no module API version Single Composer package for CE release
  • #17: Doctrine, Symfony2, PHPUnit drop PEAR support
  • #18: Self-contained modules/themes – all files in one directory Forked the hackathon Composer plugin for Magento 1.x to adopt for Magento 2
  • #20: Forked the hackathon Composer plugin for Magento 1.x to adopt for Magento 2
  • #21: Forked the hackathon Composer plugin for Magento 1.x to adopt for Magento 2
  • #24: BC – backward-compatibility <suffix> – dev, patch/p, alpha/a, beta/b, RC
  • #28: PHP library dependencies, such as Imagemagic, Mcrypt, etc. Theme dependencies on 3rd party libs, such as Angular.js, jQuery carousel, etc.
  • #30: RC – Release Candidate GA – General Availability