$30 off During Our Annual Pro Sale. View Details »

Composer & WordPress

Composer & WordPress

Slides from a MWUG talk given on Wednesday the 16th

Tom J Nowell

October 16, 2013
Tweet

More Decks by Tom J Nowell

Other Decks in Programming

Transcript

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

    View Slide

  2. 1. What is Composer
    2. Installing WordPress
    3. Installing a Theme
    4. Installing a Plugin

    View Slide

  3. What is Composer?

    View Slide

  4. composer.json
    {
    "name" : "tomjn/myproject",
    "description": "A handy description.",
    "require" : {
    "php": ">=5.3"
    }
    }

    View Slide

  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.

    View Slide

  6. composer.json
    {
    "name" : "tomjn/myproject",
    "description": "A handy description.",
    "license": "GPL-2.0+",
    "require" : {
    "johnpbloch/wordpress": "3.6.1",
    "php": ">=5.3"
    }
    }

    View Slide

  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

    View Slide

  8. View Slide

  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"
    }
    }

    View Slide

  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

    View Slide

  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"
    }
    }

    View Slide

  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

    View Slide

  13. View Slide

  14. Final Steps

    View Slide

  15. Questions?

    View Slide