Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Code Dependencies and Composer

Code Dependencies and Composer

Tom J Nowell

April 26, 2014

More Decks by Tom J Nowell

Other Decks in Technology


  1. Code Dependencies & Composer Tom J Nowell, WC Sheffield @tarendai

  2. I’m Tom I work for Code For The People

  3. This talk is about managing code frameworks, shared code, dependencies,

    things don’t have to be painful
  4. Theme/Plugin Frameworks are born fully formed

  5. Things have to be wedged into frameworks

  6. We want themes and plugins to be fast and light

  7. Consolidate and Grab Only What You Need

  8. Modularise Things

  9. These are our dependencies

  10. Frameworks include everything from the get go

  11. We need something like ordering off a menu

  12. Enter Composer

  13. Composer describes a package, and what it needs to run

  14. { “name”: “icit/wp-less”, “require”: { "php": ">=5.2.4", "leafo/lessphp": "0.4.0" }

  15. Installing Composer https://getcomposer.org/download/ ( Already installed with vvv )

  16. To install dependencies > composer install

  17. None
  18. To update dependencies > composer update

  19. Dependencies get put in a vendor/ folder An autoloader is

    provided so there are no require/includes
  20. Packagist The PHP world has a headstart on us

  21. For packages not on Packagist { "repositories": [ { "type":

    "git", "url": "https://github.com/leafo/lessphp.git" } ], ...etc... }
  22. Questions? Tom J Nowell tomjn.com @tarendai