Slides of the Magento Fireside Chat March 20th, 2014 with
Fabrizio Branca (@fbrnc)
Bastian Ike (@b_ike)
Daniel Fahlke (@flyingmana)
Rolando Granadino (@beeplogic)
Ben Marks (@benmarks)
10. • Reuse modules
• Share modules
• Easy and clean uninstall without leftovers
• Non-destructive (no deletion of files)
• Clean Magento vanilla code
• Work collaboratively on projects
• Restrict access to modules for team members
• Independent versioning scheme of modules
• Independent version control origin
the requirements
18. 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.”
phar file
json configuration
supports Git, SVN, tar,…
and mix’n’match
package
management
Dependency management
(including fine-grained
control over specific versions,…)
Autoloader
21. Overview
• Aims to provide an easy way to install Magento
modules via composer (instead of e.g. modman)
• Community driven, initial started by the Magento
Hackathon
• Main component: magento-hackathon/magento-
composer-installer
22. Components
• Magento Composer installer
• Package repository
• Compatible with package.xml, modman and
manual file mapping paths
• Possible to bootstrap the Magento core, but not
recommended
24. Using Magento+Composer
{
"minimum-stability": "dev",
"require": {
"fbrnc/aoe_templatehints": "*"
},
"repositories": [
{
"type": "composer",
"url": "http://packages.firegento.com"
}
],
"extra": {
"magento-root-dir": "htdocs/",
"auto-append-gitignore": true
}
}
Include dev-versions,
not just final releases
25. Using Magento+Composer
{
"minimum-stability": "dev",
"require": {
"fbrnc/aoe_templatehints": "*"
},
"repositories": [
{
"type": "composer",
"url": "http://packages.firegento.com"
}
],
"extra": {
"magento-root-dir": "htdocs/",
"auto-append-gitignore": true
}
}
List of required packages
with the required version
* = newest version
!
!
See composer manual for
version syntax
28. extra
• magento-root-dir: Where your Magento installation lives
• magento-deploystrategy:
• symlink: symlink into Magento
• link: hardlink into Magento
• copy: copy the files instead of linking
• none: no automatic deployment, if you want to use e.g. modman
• auto-append-gitignore: add deployed files to .gitignore in the Magento folder
• modman-root-dir: Use e.g. .modman/ instead of vendor/
37. Package.xml? modman?
JSON-mapping
• package.xml: Used by Magento Connect
• modman: Used by modman, imho best solution.
No support for shell scripts!
• json-mapping:
"map": [
["themes/default/skin", "public/skin/frontend/foo/default"],
["themes/default/design", "public/app/design/frontend/foo/default"],
["modules/My_Module/My_Module.xml", "public/app/etc/modules/My_Module.xml"],
["modules/My_Module/code", "public/app/code/local/My/Module"],
["modules/My_Module/frontend/layout/mymodule.xml", "public/app/design/frontend/base/default/
layout/mymodule.xml"]
]
44. • Fully compatible with magento-hackathon/magento-composer-installer
• Adds support for type “magento-source”
• Only puts packages into place
• Native modman script is used to deploy modules
• Wrapped in a simple installer script
AOEpeople/composer-installers
48. Deployment & Installation
Workflow
Update local
copy of the
“systemstorage”
Move files to
new release
folder
Download build
package from
Jenkins
Extract build
package
Run installer
Create symlinks
to var/ and
media/
Is
master
?
Import
systemstorage
(db and media/)
Run Composer Run modman
Apply settings Fix permissions
Update
symlinks
Delete old
releases
install.sh
deploy.sh