Your SlideShare is downloading. ×
Magento with Composer
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Magento with Composer

654

Published on

San Francisco Magento Meetup 2014/04

San Francisco Magento Meetup 2014/04

Published in: Technology
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
654
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
12
Comments
0
Likes
2
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Composer Magento with Fabrizio Branca (@fbrnc) - San Francisco Magento Meetup – April 7, 2014
  • 2. the problem Intro
  • 3. htdocs <Name> <theme> layout template code design etc locale <area> core community local <area> <language> modules <package> <Namespace> <package> *.xml *.csv <theme> app skin lib Module2 default layout template code design etc locale frontend local frontend de_DE modules base My base My_Module2.xml My_Module2.csv default app skin etc, Block, … js, css, img, … my_module2 my_module2 Magento My_Module My_Module2 Module default layout template code design etc locale frontend local frontend de_DE modules base My base My_Module.xml My_Module.csv default app skin etc, Block, … js, css, img, … my_module my_module
  • 4. htdocs Module default layout template code design etc locale local frontend de_DE modules My base *.xml app My_Module2.xml My_Module2.csv my_module2 My_Module.xml My_Module.csv etc, Block, … my_module Module2 etc, Block, … my_module2 my_module
  • 5. Magento 2
  • 6. pub Module code My app Magento My_Module My_Module2 view Controller etc i18n Block … Module2 view Controller etc i18n Block … Magento 2
  • 7. the requirements Intro
  • 8. • 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
  • 9. a solution Intro
  • 10. modman by @colinmollenhour
  • 11. htdocs code core community local app app/code/…/My/Module .modman My_Module app/design/… skin/frontend/… app/etc/modules/My_Module.xml modman app/code/…/My/Module My_Module2 app/design/… skin/frontend/… app/etc/modules/My_Module.xml modman <theme> layout template design etc locale <area> <language> modules <package> *.xml modman
  • 12. “wiring” Intro modman “connects” existing modules to the Magento core, but how do we manage them?
  • 13. htdocs code core community local app app/code/…/My/Module .modman My_Module app/design/… skin/frontend/… app/etc/modules/My_Module.xml modman app/code/…/My/Module My_Module2 app/design/… skin/frontend/… app/etc/modules/My_Module.xml modman <theme> layout template design etc locale <area> <language> modules <package> *.xml Components tools n98-magerun.phar phpunit.phar modman EnvSettingsTool composer.phar htdocs .modman Configuration Installer (Metadata, Doc,…) My_Module My_Module2 app,… and usually there’s even more stuff… These should come from different origins
  • 14. svn:externals Git submodules Phing/Ant Custom scripts Composer Components Options works fine, but needs some getting used to it
  • 15. Composer Intro in a nutshell…
  • 16. 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
  • 17. Fabrizio’s lightweightapproach Approach @fbrnc
  • 18. Keeping it Simple!
  • 19. AOEpeople/composer-installers "replace": { "magento-hackathon/magento-composer-installer":"*" } “inspired” by composer/installers “magento-module” “magento-source” handles package types
  • 20. <?php namespace AoepeopleComposerInstallers; class MagentoInstaller extends BaseInstaller { protected $locations = array( 'module' => '.modman/{$name}/', 'source' => 'htdocs/' ); } AOEpeople/composer-installers
  • 21. • 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
  • 22. { "minimum-stability":"dev", "require":{ "aoepeople/composer-installers": "*", "fbrnc/aoe_scheduler": "*", "fbrnc/aoe_cachecleaner": "*", "aoemedia/magento_enterprise": "1.13.1.0", "aoemedia/envsettingstool": "*" }, "config": { "bin-dir": "bin" } } AOEpeople/composer-installers replaces Hackathon Installer some modules Vanilla Magento Source Tools,…
  • 23. htdocs code core community local app app/code/…/My/Module .modman My_Module app/design/… skin/frontend/… app/etc/modules/My_Module.xml modman app/code/…/My/Module My_Module2 app/design/… skin/frontend/… app/etc/modules/My_Module.xml modman <theme> layout template design etc locale <area> <language> modules <package> *.xml Components
  • 24. https://github.com/AOEpeople/Magento_SampleProject
  • 25. Thank you! Any questions?

×