SlideShare a Scribd company logo
1 of 26
Composer for Magento 1.x
and Magento 2
Sergii Shymko
Senior Software Engineer
Magento, an eBay Inc. company
Legal Disclaimer
Copyright © 2015 Magento, Inc. All Rights Reserved.
Magento®, eBay Enterprise™ and their respective logos are trademarks, service marks,
registered trademarks, or registered service marks of eBay, Inc. or its subsidiaries. Other
trademarks or service marks contained in this presentation are the property of the
respective companies with which they are associated.
This presentation is for informational and discussion purposes only and should not be
construed as a commitment of Magento, Inc. or eBay Enterprise (“eBay Enterprise”) or of
any of their subsidiaries or affiliates. While we attempt to ensure the accuracy,
completeness and adequacy of this presentation, neither Magento, Inc., eBay Enterprise nor
any of their subsidiaries or affiliates are responsible for any errors or will be liable for the
use of, or reliance upon, this presentation or any of the information contained in it.
Unauthorized use, disclosure or dissemination of this information is expressly prohibited.
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
Composer Overview
• Composer – dependency manager for PHP
– Resolves dependencies
– Downloads dependencies
– Assembles project’s codebase
• Dependencies per project
• Versioned dependencies
• Install, uninstall, update packages
• Packages repository
packagist.org
• Classes autoloading
Composer Basic Usage
1. Declare project dependencies
composer.json
1. Install dependencies
php composer.phar install
1. Autoload dependencies
require 'vendor/autoload.php';
vendor/
autoload.php
Zend/…
…
my_project/
composer.json
Why Custom Integration?
Magento is Not Aware of Composer Files
app/
magento_project/
composer.json
code/
etc/
design/
vendor/
index.php
autoload.php O_o
Composer Adoption for Magento 1.x
• Composer plugin for Magento 1.x
magento-hackathon/magento-composer-installer
• Put files in Magento directories
• Deployment strategies:
– Copy
– Move
– Symlink
• Modman packages support
• Composer packages repository
packages.firegento.com
Magento 1.x
module package
Community module
modman
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
• Files not in one directory:
– Module files
– Theme & skin files
• Versioning:
– Not strict release version
– No module API version
– No theme version
– No locale version
magento/core
1.9.0.1
Feature Modules
Magento libraries
3rd party libraries
Design themes/skins
Localizations
composer.json
Composer Adoption in Magento 2
• Prerequisites:
– Self-contained modules
– Self-contained themes
• Forked Composer plugin for 1.x
magento/magento-composer-installer
• Monolith Granular core packages
packages.magento.com
app/code/<Vendor>/<Module>/
app/design/<area>/<Vendor>/<theme>/
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
magento/language-en_us
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.74.0-beta1",
"magento/framework": "0.74.0-beta1",
"magento/magento-composer-installer": "*"
},
"type": "magento2-module",
"version": "0.74.0-beta1",
"extra": {
"map": [
["*", "Magento/Catalog"]
]
}
}
composer.json
app/code/
Magento/Catalog/
Core Changes
for Composer Adoption
Module Versioning in Magento 2
• Composer promotes 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
config.xml
app/code/<pool>/<Namespace>/<Module>/
etc/
Magento 2
module.xml
app/code/<Vendor>/<Module>/
etc/
composer.json
Version, not semantic
DB schema version
API version, semantic
Module Dependencies Declaration
Magento 1.x
<Namespace>_<Module>.xml
app/etc/
modules/
Magento 2
module.xml
app/code/<Vendor>/<Module>/
etc/
composer.json
Dependencies
ordered, not versioned
Modules sort order
Dependencies
not ordered, versioned
Magento 2 Repositories
• Source code of Community Edition
github.com/magento/magento2
• Composer project for Community Edition
github.com/magento/magento2-community-edition
Summary of Composer Adoption
• Granular core packages
• Semantic versioning
• Versioned dependencies
• Theme dependencies
• Locale dependencies
• Validation of environment
– PHP version
– PHP libraries
Thank You!
Q & A
Sergii Shymko
sshymko@ebay.com
Magento 2 Release Schedule
Q4 2014 – Dev Beta  Released Dec 17, 2014
Q1 2015 – Dev RC  Released Mar 23, 2015
Q3 2015 – Merchant Beta
Q4 2015 – Merchant GA
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

More Related Content

What's hot

Web components Introduction
Web components IntroductionWeb components Introduction
Web components IntroductionEugenio Romano
 
WordPress and Zend Framework Integration with Vulnero
WordPress and Zend Framework Integration with VulneroWordPress and Zend Framework Integration with Vulnero
WordPress and Zend Framework Integration with VulneroAndrew Kandels
 
Magento and Continuous Integration - Damian Luszczymak
Magento and Continuous Integration - Damian LuszczymakMagento and Continuous Integration - Damian Luszczymak
Magento and Continuous Integration - Damian LuszczymakMeet Magento Spain
 
Aleksandr Kutsan "Managing Dependencies in C++"
Aleksandr Kutsan "Managing Dependencies in C++"Aleksandr Kutsan "Managing Dependencies in C++"
Aleksandr Kutsan "Managing Dependencies in C++"LogeekNightUkraine
 
Create your own composer package
Create your own composer packageCreate your own composer package
Create your own composer packageLattapon Yodsuwan
 
symfony: An Open-Source Framework for Professionals (Dutch Php Conference 2008)
symfony: An Open-Source Framework for Professionals (Dutch Php Conference 2008)symfony: An Open-Source Framework for Professionals (Dutch Php Conference 2008)
symfony: An Open-Source Framework for Professionals (Dutch Php Conference 2008)Fabien Potencier
 
Vagrant move over, here is Docker
Vagrant move over, here is DockerVagrant move over, here is Docker
Vagrant move over, here is DockerNick Belhomme
 
Instrumentación de entrega continua con Gitlab
Instrumentación de entrega continua con GitlabInstrumentación de entrega continua con Gitlab
Instrumentación de entrega continua con GitlabSoftware Guru
 
Zend Framework 1.8 workshop
Zend Framework 1.8 workshopZend Framework 1.8 workshop
Zend Framework 1.8 workshopNick Belhomme
 
Using Zend Framework 2 Book Presentation
Using Zend Framework 2 Book PresentationUsing Zend Framework 2 Book Presentation
Using Zend Framework 2 Book Presentationolegkrivtsov
 
Plugins 2.0: The Overview
Plugins 2.0: The OverviewPlugins 2.0: The Overview
Plugins 2.0: The OverviewAtlassian
 
PHP Quality Assurance Workshop PHPBenelux
PHP Quality Assurance Workshop PHPBeneluxPHP Quality Assurance Workshop PHPBenelux
PHP Quality Assurance Workshop PHPBeneluxNick Belhomme
 
Intro to JavaScript Tooling in Visual Studio Code
Intro to JavaScript Tooling in Visual Studio CodeIntro to JavaScript Tooling in Visual Studio Code
Intro to JavaScript Tooling in Visual Studio CodeColdFusionConference
 
Composer The Right Way - 010PHP
Composer The Right Way - 010PHPComposer The Right Way - 010PHP
Composer The Right Way - 010PHPRafael Dohms
 
Do's and Do not's about p2
Do's and Do not's about p2Do's and Do not's about p2
Do's and Do not's about p2Pascal Rapicault
 

What's hot (19)

Web components Introduction
Web components IntroductionWeb components Introduction
Web components Introduction
 
Maven 3.0 at Øredev
Maven 3.0 at ØredevMaven 3.0 at Øredev
Maven 3.0 at Øredev
 
WordPress and Zend Framework Integration with Vulnero
WordPress and Zend Framework Integration with VulneroWordPress and Zend Framework Integration with Vulnero
WordPress and Zend Framework Integration with Vulnero
 
ADF in action 1.2
ADF in action 1.2ADF in action 1.2
ADF in action 1.2
 
Magento and Continuous Integration - Damian Luszczymak
Magento and Continuous Integration - Damian LuszczymakMagento and Continuous Integration - Damian Luszczymak
Magento and Continuous Integration - Damian Luszczymak
 
Maven 2 Introduction
Maven 2 IntroductionMaven 2 Introduction
Maven 2 Introduction
 
Aleksandr Kutsan "Managing Dependencies in C++"
Aleksandr Kutsan "Managing Dependencies in C++"Aleksandr Kutsan "Managing Dependencies in C++"
Aleksandr Kutsan "Managing Dependencies in C++"
 
Create your own composer package
Create your own composer packageCreate your own composer package
Create your own composer package
 
symfony: An Open-Source Framework for Professionals (Dutch Php Conference 2008)
symfony: An Open-Source Framework for Professionals (Dutch Php Conference 2008)symfony: An Open-Source Framework for Professionals (Dutch Php Conference 2008)
symfony: An Open-Source Framework for Professionals (Dutch Php Conference 2008)
 
Vagrant move over, here is Docker
Vagrant move over, here is DockerVagrant move over, here is Docker
Vagrant move over, here is Docker
 
Instrumentación de entrega continua con Gitlab
Instrumentación de entrega continua con GitlabInstrumentación de entrega continua con Gitlab
Instrumentación de entrega continua con Gitlab
 
Zend Framework 1.8 workshop
Zend Framework 1.8 workshopZend Framework 1.8 workshop
Zend Framework 1.8 workshop
 
Using Zend Framework 2 Book Presentation
Using Zend Framework 2 Book PresentationUsing Zend Framework 2 Book Presentation
Using Zend Framework 2 Book Presentation
 
Plugins 2.0: The Overview
Plugins 2.0: The OverviewPlugins 2.0: The Overview
Plugins 2.0: The Overview
 
PHP Quality Assurance Workshop PHPBenelux
PHP Quality Assurance Workshop PHPBeneluxPHP Quality Assurance Workshop PHPBenelux
PHP Quality Assurance Workshop PHPBenelux
 
Intro to JavaScript Tooling in Visual Studio Code
Intro to JavaScript Tooling in Visual Studio CodeIntro to JavaScript Tooling in Visual Studio Code
Intro to JavaScript Tooling in Visual Studio Code
 
Maven Introduction
Maven IntroductionMaven Introduction
Maven Introduction
 
Composer The Right Way - 010PHP
Composer The Right Way - 010PHPComposer The Right Way - 010PHP
Composer The Right Way - 010PHP
 
Do's and Do not's about p2
Do's and Do not's about p2Do's and Do not's about p2
Do's and Do not's about p2
 

Similar to Composer for Magento 1.x and Magento 2

Magento 2 Composer for Extensions Distribution
Magento 2 Composer for Extensions DistributionMagento 2 Composer for Extensions Distribution
Magento 2 Composer for Extensions DistributionSergii Shymko
 
Sergii Shymko: Magento 2: Composer for Extensions Distribution
Sergii Shymko: Magento 2: Composer for Extensions DistributionSergii Shymko: Magento 2: Composer for Extensions Distribution
Sergii Shymko: Magento 2: Composer for Extensions DistributionMeet Magento Italy
 
Zepplin_Pronko_Magento_Festival Hall 1_Final
Zepplin_Pronko_Magento_Festival Hall 1_FinalZepplin_Pronko_Magento_Festival Hall 1_Final
Zepplin_Pronko_Magento_Festival Hall 1_FinalMax Pronko
 
php[world] Magento101
php[world] Magento101php[world] Magento101
php[world] Magento101Mathew Beane
 
MidwestPHP - Getting Started with Magento 2
MidwestPHP - Getting Started with Magento 2MidwestPHP - Getting Started with Magento 2
MidwestPHP - Getting Started with Magento 2Mathew Beane
 
Madison PHP - Getting Started with Magento 2
Madison PHP - Getting Started with Magento 2Madison PHP - Getting Started with Magento 2
Madison PHP - Getting Started with Magento 2Mathew Beane
 
Running Magento 1.x Extension on Magento 2
Running Magento 1.x Extension on Magento 2Running Magento 1.x Extension on Magento 2
Running Magento 1.x Extension on Magento 2Sergii Shymko
 
Mageguru - magento custom module development
Mageguru -  magento custom module development Mageguru -  magento custom module development
Mageguru - magento custom module development Mage Guru
 
Oleksii Korshenko - Magento 2 Backwards Compatible Policy
Oleksii Korshenko - Magento 2 Backwards Compatible PolicyOleksii Korshenko - Magento 2 Backwards Compatible Policy
Oleksii Korshenko - Magento 2 Backwards Compatible PolicyMeet Magento Italy
 
Magento 2 - Getting started.
Magento 2 - Getting started.Magento 2 - Getting started.
Magento 2 - Getting started.Aneesh Sreedharan
 
Zendcon magento101
Zendcon magento101Zendcon magento101
Zendcon magento101Mathew Beane
 
Architecture and Analytical Study of Magento
Architecture and Analytical Study of MagentoArchitecture and Analytical Study of Magento
Architecture and Analytical Study of MagentoIRJET Journal
 
Magento 2 Composer for Extensions Distribution
Magento 2 Composer for Extensions DistributionMagento 2 Composer for Extensions Distribution
Magento 2 Composer for Extensions DistributionSergii Shymko
 
Magento E-Commerce Customized Package-5
Magento E-Commerce Customized Package-5Magento E-Commerce Customized Package-5
Magento E-Commerce Customized Package-5SoftProdigy
 
Magento Community Hangouts 10 Feb, 2021 Composer 2 Support
Magento Community Hangouts  10 Feb, 2021 Composer 2 SupportMagento Community Hangouts  10 Feb, 2021 Composer 2 Support
Magento Community Hangouts 10 Feb, 2021 Composer 2 SupportStanislavIdolov
 
Maven 3: New Features - OPITZ CONSULTING - Stefan Scheidt
Maven 3: New Features - OPITZ CONSULTING - Stefan ScheidtMaven 3: New Features - OPITZ CONSULTING - Stefan Scheidt
Maven 3: New Features - OPITZ CONSULTING - Stefan ScheidtOPITZ CONSULTING Deutschland
 

Similar to Composer for Magento 1.x and Magento 2 (20)

Magento 2 Composer for Extensions Distribution
Magento 2 Composer for Extensions DistributionMagento 2 Composer for Extensions Distribution
Magento 2 Composer for Extensions Distribution
 
Sergii Shymko: Magento 2: Composer for Extensions Distribution
Sergii Shymko: Magento 2: Composer for Extensions DistributionSergii Shymko: Magento 2: Composer for Extensions Distribution
Sergii Shymko: Magento 2: Composer for Extensions Distribution
 
Zepplin_Pronko_Magento_Festival Hall 1_Final
Zepplin_Pronko_Magento_Festival Hall 1_FinalZepplin_Pronko_Magento_Festival Hall 1_Final
Zepplin_Pronko_Magento_Festival Hall 1_Final
 
php[world] Magento101
php[world] Magento101php[world] Magento101
php[world] Magento101
 
Composer in Magento
Composer in MagentoComposer in Magento
Composer in Magento
 
MidwestPHP - Getting Started with Magento 2
MidwestPHP - Getting Started with Magento 2MidwestPHP - Getting Started with Magento 2
MidwestPHP - Getting Started with Magento 2
 
Madison PHP - Getting Started with Magento 2
Madison PHP - Getting Started with Magento 2Madison PHP - Getting Started with Magento 2
Madison PHP - Getting Started with Magento 2
 
Magento 2 development
Magento 2 developmentMagento 2 development
Magento 2 development
 
Running Magento 1.x Extension on Magento 2
Running Magento 1.x Extension on Magento 2Running Magento 1.x Extension on Magento 2
Running Magento 1.x Extension on Magento 2
 
OnTime Partner Webinar September 2011
OnTime Partner Webinar September 2011OnTime Partner Webinar September 2011
OnTime Partner Webinar September 2011
 
Mageguru - magento custom module development
Mageguru -  magento custom module development Mageguru -  magento custom module development
Mageguru - magento custom module development
 
Oleksii Korshenko - Magento 2 Backwards Compatible Policy
Oleksii Korshenko - Magento 2 Backwards Compatible PolicyOleksii Korshenko - Magento 2 Backwards Compatible Policy
Oleksii Korshenko - Magento 2 Backwards Compatible Policy
 
Magento 2 - Getting started.
Magento 2 - Getting started.Magento 2 - Getting started.
Magento 2 - Getting started.
 
Zendcon magento101
Zendcon magento101Zendcon magento101
Zendcon magento101
 
Architecture and Analytical Study of Magento
Architecture and Analytical Study of MagentoArchitecture and Analytical Study of Magento
Architecture and Analytical Study of Magento
 
Magento 2 Composer for Extensions Distribution
Magento 2 Composer for Extensions DistributionMagento 2 Composer for Extensions Distribution
Magento 2 Composer for Extensions Distribution
 
Magento 2 + composer
Magento 2 + composerMagento 2 + composer
Magento 2 + composer
 
Magento E-Commerce Customized Package-5
Magento E-Commerce Customized Package-5Magento E-Commerce Customized Package-5
Magento E-Commerce Customized Package-5
 
Magento Community Hangouts 10 Feb, 2021 Composer 2 Support
Magento Community Hangouts  10 Feb, 2021 Composer 2 SupportMagento Community Hangouts  10 Feb, 2021 Composer 2 Support
Magento Community Hangouts 10 Feb, 2021 Composer 2 Support
 
Maven 3: New Features - OPITZ CONSULTING - Stefan Scheidt
Maven 3: New Features - OPITZ CONSULTING - Stefan ScheidtMaven 3: New Features - OPITZ CONSULTING - Stefan Scheidt
Maven 3: New Features - OPITZ CONSULTING - Stefan Scheidt
 

More from Sergii Shymko

Magento 2 Changes Overview
Magento 2 Changes OverviewMagento 2 Changes Overview
Magento 2 Changes OverviewSergii Shymko
 
Developing Loosely Coupled Modules with Magento
Developing Loosely Coupled Modules with MagentoDeveloping Loosely Coupled Modules with Magento
Developing Loosely Coupled Modules with MagentoSergii Shymko
 
Black Magic of Code Generation in Magento 2
Black Magic of Code Generation in Magento 2Black Magic of Code Generation in Magento 2
Black Magic of Code Generation in Magento 2Sergii Shymko
 
Magento 2 Code Migration Tool
Magento 2 Code Migration ToolMagento 2 Code Migration Tool
Magento 2 Code Migration ToolSergii Shymko
 
Magento 2 Enhanced Theme/Skin Localization
Magento 2 Enhanced Theme/Skin LocalizationMagento 2 Enhanced Theme/Skin Localization
Magento 2 Enhanced Theme/Skin LocalizationSergii Shymko
 
Magento Performance Toolkit
Magento Performance ToolkitMagento Performance Toolkit
Magento Performance ToolkitSergii Shymko
 
Developing Loosely Coupled Modules with Magento
Developing Loosely Coupled Modules with MagentoDeveloping Loosely Coupled Modules with Magento
Developing Loosely Coupled Modules with MagentoSergii Shymko
 
Magento 2 View Layer Evolution
Magento 2 View Layer EvolutionMagento 2 View Layer Evolution
Magento 2 View Layer EvolutionSergii Shymko
 
Magento 2 Theme Localization
Magento 2 Theme LocalizationMagento 2 Theme Localization
Magento 2 Theme LocalizationSergii Shymko
 
Code Generation in Magento 2
Code Generation in Magento 2Code Generation in Magento 2
Code Generation in Magento 2Sergii Shymko
 
Magento 1.x to Magento 2 Code Migration Tools
Magento 1.x to Magento 2 Code Migration ToolsMagento 1.x to Magento 2 Code Migration Tools
Magento 1.x to Magento 2 Code Migration ToolsSergii Shymko
 

More from Sergii Shymko (11)

Magento 2 Changes Overview
Magento 2 Changes OverviewMagento 2 Changes Overview
Magento 2 Changes Overview
 
Developing Loosely Coupled Modules with Magento
Developing Loosely Coupled Modules with MagentoDeveloping Loosely Coupled Modules with Magento
Developing Loosely Coupled Modules with Magento
 
Black Magic of Code Generation in Magento 2
Black Magic of Code Generation in Magento 2Black Magic of Code Generation in Magento 2
Black Magic of Code Generation in Magento 2
 
Magento 2 Code Migration Tool
Magento 2 Code Migration ToolMagento 2 Code Migration Tool
Magento 2 Code Migration Tool
 
Magento 2 Enhanced Theme/Skin Localization
Magento 2 Enhanced Theme/Skin LocalizationMagento 2 Enhanced Theme/Skin Localization
Magento 2 Enhanced Theme/Skin Localization
 
Magento Performance Toolkit
Magento Performance ToolkitMagento Performance Toolkit
Magento Performance Toolkit
 
Developing Loosely Coupled Modules with Magento
Developing Loosely Coupled Modules with MagentoDeveloping Loosely Coupled Modules with Magento
Developing Loosely Coupled Modules with Magento
 
Magento 2 View Layer Evolution
Magento 2 View Layer EvolutionMagento 2 View Layer Evolution
Magento 2 View Layer Evolution
 
Magento 2 Theme Localization
Magento 2 Theme LocalizationMagento 2 Theme Localization
Magento 2 Theme Localization
 
Code Generation in Magento 2
Code Generation in Magento 2Code Generation in Magento 2
Code Generation in Magento 2
 
Magento 1.x to Magento 2 Code Migration Tools
Magento 1.x to Magento 2 Code Migration ToolsMagento 1.x to Magento 2 Code Migration Tools
Magento 1.x to Magento 2 Code Migration Tools
 

Recently uploaded

main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidNikhilNagaraju
 
Heart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxHeart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxPoojaBan
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoão Esperancinha
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSCAESB
 
Artificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxArtificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxbritheesh05
 
Concrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxConcrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxKartikeyaDwivedi3
 
Churning of Butter, Factors affecting .
Churning of Butter, Factors affecting  .Churning of Butter, Factors affecting  .
Churning of Butter, Factors affecting .Satyam Kumar
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxDeepakSakkari2
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024hassan khalil
 
Risk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfRisk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfROCENODodongVILLACER
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxwendy cai
 
EduAI - E learning Platform integrated with AI
EduAI - E learning Platform integrated with AIEduAI - E learning Platform integrated with AI
EduAI - E learning Platform integrated with AIkoyaldeepu123
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort servicejennyeacort
 
Work Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvWork Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvLewisJB
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.eptoze12
 

Recently uploaded (20)

main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfid
 
Heart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxHeart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptx
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentation
 
Design and analysis of solar grass cutter.pdf
Design and analysis of solar grass cutter.pdfDesign and analysis of solar grass cutter.pdf
Design and analysis of solar grass cutter.pdf
 
Artificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxArtificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptx
 
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Serviceyoung call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
 
Concrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxConcrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptx
 
Churning of Butter, Factors affecting .
Churning of Butter, Factors affecting  .Churning of Butter, Factors affecting  .
Churning of Butter, Factors affecting .
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptx
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024
 
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
 
Risk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfRisk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdf
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptx
 
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptxExploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
 
EduAI - E learning Platform integrated with AI
EduAI - E learning Platform integrated with AIEduAI - E learning Platform integrated with AI
EduAI - E learning Platform integrated with AI
 
young call girls in Green Park🔝 9953056974 🔝 escort Service
young call girls in Green Park🔝 9953056974 🔝 escort Serviceyoung call girls in Green Park🔝 9953056974 🔝 escort Service
young call girls in Green Park🔝 9953056974 🔝 escort Service
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
 
Work Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvWork Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvv
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.
 

Composer for Magento 1.x and Magento 2

  • 1.
  • 2. Composer for Magento 1.x and Magento 2 Sergii Shymko Senior Software Engineer Magento, an eBay Inc. company
  • 3. Legal Disclaimer Copyright © 2015 Magento, Inc. All Rights Reserved. Magento®, eBay Enterprise™ and their respective logos are trademarks, service marks, registered trademarks, or registered service marks of eBay, Inc. or its subsidiaries. Other trademarks or service marks contained in this presentation are the property of the respective companies with which they are associated. This presentation is for informational and discussion purposes only and should not be construed as a commitment of Magento, Inc. or eBay Enterprise (“eBay Enterprise”) or of any of their subsidiaries or affiliates. While we attempt to ensure the accuracy, completeness and adequacy of this presentation, neither Magento, Inc., eBay Enterprise nor any of their subsidiaries or affiliates are responsible for any errors or will be liable for the use of, or reliance upon, this presentation or any of the information contained in it. Unauthorized use, disclosure or dissemination of this information is expressly prohibited.
  • 4. 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
  • 5. Composer Overview • Composer – dependency manager for PHP – Resolves dependencies – Downloads dependencies – Assembles project’s codebase • Dependencies per project • Versioned dependencies • Install, uninstall, update packages • Packages repository packagist.org • Classes autoloading
  • 6. Composer Basic Usage 1. Declare project dependencies composer.json 1. Install dependencies php composer.phar install 1. Autoload dependencies require 'vendor/autoload.php'; vendor/ autoload.php Zend/… … my_project/ composer.json
  • 8. Magento is Not Aware of Composer Files app/ magento_project/ composer.json code/ etc/ design/ vendor/ index.php autoload.php O_o
  • 9. Composer Adoption for Magento 1.x • Composer plugin for Magento 1.x magento-hackathon/magento-composer-installer • Put files in Magento directories • Deployment strategies: – Copy – Move – Symlink • Modman packages support • Composer packages repository packages.firegento.com Magento 1.x module package Community module modman
  • 10. 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
  • 11. 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
  • 12. Composer Adoption Obstacles in 1.x • Monolith CE Composer package • Files not in one directory: – Module files – Theme & skin files • Versioning: – Not strict release version – No module API version – No theme version – No locale version magento/core 1.9.0.1 Feature Modules Magento libraries 3rd party libraries Design themes/skins Localizations composer.json
  • 13. Composer Adoption in Magento 2 • Prerequisites: – Self-contained modules – Self-contained themes • Forked Composer plugin for 1.x magento/magento-composer-installer • Monolith Granular core packages packages.magento.com app/code/<Vendor>/<Module>/ app/design/<area>/<Vendor>/<theme>/
  • 14. 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/ /
  • 15. Composer Packages in Magento 2 magento/module-catalog composer.json Module magento/theme-frontend-luma composer.json Theme magento/language-en_us composer.json Localization
  • 16. 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
  • 17. Magento 2 Module Package Example { "name": "magento/module-catalog", "require": { "php": "~5.5.0|~5.6.0", "magento/module-store": "0.74.0-beta1", "magento/framework": "0.74.0-beta1", "magento/magento-composer-installer": "*" }, "type": "magento2-module", "version": "0.74.0-beta1", "extra": { "map": [ ["*", "Magento/Catalog"] ] } } composer.json app/code/ Magento/Catalog/
  • 19. Module Versioning in Magento 2 • Composer promotes 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
  • 20. Module Version Declaration Magento 1.x config.xml app/code/<pool>/<Namespace>/<Module>/ etc/ Magento 2 module.xml app/code/<Vendor>/<Module>/ etc/ composer.json Version, not semantic DB schema version API version, semantic
  • 21. Module Dependencies Declaration Magento 1.x <Namespace>_<Module>.xml app/etc/ modules/ Magento 2 module.xml app/code/<Vendor>/<Module>/ etc/ composer.json Dependencies ordered, not versioned Modules sort order Dependencies not ordered, versioned
  • 22. Magento 2 Repositories • Source code of Community Edition github.com/magento/magento2 • Composer project for Community Edition github.com/magento/magento2-community-edition
  • 23. Summary of Composer Adoption • Granular core packages • Semantic versioning • Versioned dependencies • Theme dependencies • Locale dependencies • Validation of environment – PHP version – PHP libraries
  • 24. Thank You! Q & A Sergii Shymko sshymko@ebay.com
  • 25. Magento 2 Release Schedule Q4 2014 – Dev Beta  Released Dec 17, 2014 Q1 2015 – Dev RC  Released Mar 23, 2015 Q3 2015 – Merchant Beta Q4 2015 – Merchant GA
  • 26. 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

Editor's Notes

  1. Composer – CLI tool
  2. Directory ‘vendor’
  3. Because Magento won’t even notice packages downloaded by Composer into file system
  4. Application won’t notice files managed by Composer
  5. Plugin developed by community at Magento bugathon Plugin is published at Packagist
  6. Release version influenced by marketing Not semantic module versioning DB schema version, but no module API version Single Composer package for CE release
  7. Magento 2 Dev Beta (released Dec 17, 2014) comes with the Composer adoption Self-contained modules/themes – all files in one directory Forked the hackathon Composer plugin for Magento 1.x to adopt for Magento 2
  8. Forked the hackathon Composer plugin for Magento 1.x to adopt for Magento 2
  9. Forked the hackathon Composer plugin for Magento 1.x to adopt for Magento 2
  10. BC – backward-compatibility <suffix> – dev, patch/p, alpha/a, beta/b, RC
  11. PHP library dependencies, such as Imagemagic, Mcrypt, etc. Theme dependencies on 3rd party libs, such as Angular.js, jQuery carousel, etc.
  12. RC – Release Candidate GA – General Availability