SlideShare uses cookies to improve functionality and performance, and to provide you with relevant advertising. If you continue browsing the site, you agree to the use of cookies on this website. See our User Agreement and Privacy Policy.
SlideShare uses cookies to improve functionality and performance, and to provide you with relevant advertising. If you continue browsing the site, you agree to the use of cookies on this website. See our Privacy Policy and User Agreement for details.
Successfully reported this slideshow.
Activate your 30 day free trial to unlock unlimited reading.
1.
Dependency
management in
Magento with
Composer
Manuele Menozzi
Senior PHP Developer @
Webgriffe®
Zend Certified PHP Engineer
Proud & member
Email: / Twitter:
GrUSP PUG MoRe
mmenozzi@webgriffe.com @mmenozzi
2.
About Composer
Composer is a tool for dependency management in PHP. It allows you to
declare the dependent libraries your project needs and it will install
them in your project for you.
4.
… and how
composer install
1. Available packages indexing
2. Dependency tree and packages list calculation
3. Packages list locking (composer.lock file)
4. Packages download (in vendor folder)
5. Custom installers
6. Autoload dump
5.
Benefits
Time save
Code reuse
Code sharing
Easy upgrades
Same code usage
7.
Composer & Magento
The solution
1. Available packages indexing
2. Dependency tree and packages list calculation
3. Packages list locking (composer.lock file)
4. Packages download (in vendor folder)
5. Custom installers
6. Autoload dump
8.
Magento Composer Installer
by Magento Hackathon
github.com/magento-hackathon/magento-composer-installer
10.
Magento Composer Installer
Files mapping
There are several ways how the mapping from files in the package into
the Magento source is accomplished:
1. A mapping in the composer.json
2. The MagentoConnect package.xml file
3. The modman file (see github.com/colinmollenhour/modman)
12.
Magento Composer Installer
Install the Magento-Core and initialize your project
Package magento/core on packages.firegento.com
./composer.json
{
"require": {
"magento/core": "1.9.0.1"
},
"repositories": [
{
"type": "composer",
"url": "http://packages.firegento.com"
}
],
"extra":{
"magento-root-dir": "htdocs/"
}
}
Only 1.9.0.1 avaliable... :(
13.
Magento Composer Installer
Make a module installable with Composer
./composer.json
(important: "type": "magento-module")
{
"name": "acme-company/module-name",
"type": "magento-module",
"license":"OSL-3.0",
"description":"A short one line description of your module",
"repositories": [
{
"type": "vcs",
"url": "your/github/or/git/or/svn/etc/repository/uri"
}
],
}
14.
Magento Composer Installer
Make a module installable with Composer
Files mapping (modman example)
./modman
src app/code/local/AcmeCompany/ModuleName
etc/AcmeCompany_ModuleName.xml app/etc/modules/
locale/it_IT/* app/locale/it_IT/
See github.com/colinmollenhour/modman for further info.
15.
Magento Composer Installer
Useful extras…
Deploy strategy (magento-deploystrategy)
Auto append to gitignore (auto-append-gitignore)
Mapping overwrite (magento-map-overwrite)
16.
Joind.in
joind.in/talk/view/12698
Any Question?
Webgriffe
Tailored Digital Works
webgriffe.com | @webgriffe
5+ Years of Experience with Magento
5 Certified Developers (Zend & Magento)
350+ Customers
20+ Magento Extensions
450+ Extensions Sold