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

Composer & WordPress

Composer & WordPress

Slides from a MWUG talk given on Wednesday the 16th

Eba4cc68bfbc2b59c3c3a3cf789075f0?s=128

Tom J Nowell

October 16, 2013
Tweet

Transcript

  1. Composer & WordPress Deploy All The Things - Tom J

    Nowell
  2. 1. What is Composer 2. Installing WordPress 3. Installing a

    Theme 4. Installing a Plugin
  3. What is Composer?

  4. composer.json { "name" : "tomjn/myproject", "description": "A handy description.", "require"

    : { "php": ">=5.3" } }
  5. Is it Valid? ~/www/test › composer validate ./composer.json is valid,

    but with a few warnings See http://getcomposer.org/doc/04-schema.md for details on the schema No license specified, it is recommended to do so. For closed-source software you may use "proprietary" as license.
  6. composer.json { "name" : "tomjn/myproject", "description": "A handy description.", "license":

    "GPL-2.0+", "require" : { "johnpbloch/wordpress": "3.6.1", "php": ">=5.3" } }
  7. ~/www/test › composer install Loading composer repositories with package information

    Installing dependencies (including require-dev) - Installing johnpbloch/wordpress-core- installer (0.2.0) Downloading: 100% - Installing johnpbloch/wordpress (3.6.1) Downloading: 100% Writing lock file Generating autoload files
  8. None
  9. { "name" : "tomjn/myproject", "description": "A handy description.", "license": "GPL-2.0+",

    "repositories": [ { "type": "package", "package": { "name": "wordpress/twentythirteen", "version": "1.0", "type": "wordpress-theme", "source": { "url": "http://themes.svn.wordpress.org/", "type": "svn", "reference": "twentythirteen/1.0/" }, "require": { "composer/installers": "~1.0" } } } ], "require" : { "johnpbloch/wordpress": "3.6.1", "wordpress/twentythirteen": "1.0", "php": ">=5.3" } }
  10. ~/www/test › composer update Loading composer repositories with package information

    Updating dependencies (including require-dev) - Installing wordpress/twentythirteen (1.0) Checking out twentythirteen/1.0/ Writing lock file Generating autoload files
  11. { "name" : "tomjn/myproject", "description" : "A handy description.", "license"

    : "GPL-2.0+", "repositories": [ { "type": "composer", "url": "http://wpackagist.org" }, { "type": "package", "package": { "name": "wordpress/twentythirteen", …………………………………………….. "require" : { "johnpbloch/wordpress": "3.6.1", "wordpress/twentythirteen": "1.0", "wpackagist/akismet": "*", "php": ">=5.3" } }
  12. ~/www/test › composer update Loading composer repositories with package information

    Updating dependencies (including require-dev) - Installing wpackagist/akismet (trunk) Downloading: 100% Writing lock file Generating autoload files
  13. None
  14. Final Steps

  15. Questions?