SlideShare a Scribd company logo
1 of 69
Tom Corrigan      Melbourne PHP Users Group
rostercloud.com         October 2012

 @t_corrigan
What is Composer?


“Composer is a tool for dependency management. It allows you to
declare the dependent libraries your project needs and it will install
them in your project for you.”




[http://getcomposer.org/doc/00-intro.md]
What does that mean?
What does that mean?


•   Scope is per project, not global
What does that mean?


•   Scope is per project, not global

•   Resolves dependencies
What does that mean?


•   Scope is per project, not global

•   Resolves dependencies

•   Runs installation tasks
Who’s using Composer?
Packagist
Packagist
Packagist

     • Composer’s default repository
Packagist

     • Composer’s default repository
     • Put your open source libraries
       here
Packagist

     • Composer’s default repository
     • Put your open source libraries
       here

     • Great resource for well
       maintained PHP libraries
Statistics




[https://packagist.org/statistics]
Statistics



•   Over 4000 packages listed on packagist.org




    [https://packagist.org/statistics]
Statistics



•   Over 4000 packages listed on packagist.org

•   More than 4,500,000 package installations over the last 6 months


    [https://packagist.org/statistics]
Installing Composer
Installing Composer
Locally:
Installing Composer
Locally:
       $ cd /project/path
       $ curl -s https://getcomposer.org/installer | php
Installing Composer
Locally:
       $ cd /project/path
       $ curl -s https://getcomposer.org/installer | php

Globally:
Installing Composer
Locally:
       $ cd /project/path
       $ curl -s https://getcomposer.org/installer | php

Globally:
       $ sudo mv composer.phar /usr/local/bin/composer
Staying current
Staying current
Locally:
Staying current
Locally:
       $ cd /project/path
       $ php composer.phar self-update
Staying current
Locally:
       $ cd /project/path
       $ php composer.phar self-update

Globally:
Staying current
Locally:
       $ cd /project/path
       $ php composer.phar self-update

Globally:
       $ composer self-update
Using Composer
Using Composer


•   Define project dependencies
Using Composer


•   Define project dependencies

•   Install them
Using Composer


•   Define project dependencies

•   Install them

•   Bootstrap the autoloader
Define your dependencies
Define your dependencies
composer.json
Define your dependencies
composer.json

{
    "require": {
        "phpmelb/project1":   "1.0.2"
        "phpmelb/project2":   "1.0.*"
        "phpmelb/project3":   ">=1.0,<2.0"
        "phpmelb/project4":   "4d3fe5feaf"
        "phpmelb/project5":   "dev-master"
    }
}
Install
Install
$ composer install
Install
$ composer install

vendor/
    .composer/
    phpmelb/
        project1/
        project2/
        project3/
        project4/
    autoload.php
Using the autoloader
<?php

require 'vendor/autoload.php';

$foo = new PHPMelbProject1Foo();

$bar = new PHPMelb_Project2_Bar();

...
{
    "name": "symfony/framework-standard-edition",
    "description": "The "Symfony Standard Edition" distribution",
{
    "name": "symfony/framework-standard-edition",
    "description": "The "Symfony Standard Edition" distribution",
    "autoload": {
        "psr-0": { "": "src/" }
    },
{
    "name": "symfony/framework-standard-edition",
    "description": "The "Symfony Standard Edition" distribution",
    "autoload": {
        "psr-0": { "": "src/" }
    },
{
    "name": "symfony/framework-standard-edition",
    "description": "The "Symfony Standard Edition" distribution",
    "autoload": {
        "psr-0": { "": "src/" }
    },
    "require": {
        "php": ">=5.3.3",
        "symfony/symfony": "2.1.*",
        "doctrine/orm": ">=2.2.3,<2.4-dev",
        "doctrine/doctrine-bundle": "1.0.*",
        "twig/extensions": "1.0.*",
        "symfony/assetic-bundle": "2.1.*",
        "symfony/swiftmailer-bundle": "2.1.*",
        "symfony/monolog-bundle": "2.1.*",
        "sensio/distribution-bundle": "2.1.*",
        "sensio/framework-extra-bundle": "2.1.*",
        "sensio/generator-bundle": "2.1.*",
        "jms/security-extra-bundle": "1.2.*",
        "jms/di-extra-bundle": "1.1.*"
    },
{
    "name": "symfony/framework-standard-edition",
    "description": "The "Symfony Standard Edition" distribution",
    "autoload": {
        "psr-0": { "": "src/" }
    },
    "require": {
        "php": ">=5.3.3",
        "symfony/symfony": "2.1.*",
        "doctrine/orm": ">=2.2.3,<2.4-dev",
        "doctrine/doctrine-bundle": "1.0.*",
        "twig/extensions": "1.0.*",
        "symfony/assetic-bundle": "2.1.*",
        "symfony/swiftmailer-bundle": "2.1.*",
        "symfony/monolog-bundle": "2.1.*",
        "sensio/distribution-bundle": "2.1.*",
        "sensio/framework-extra-bundle": "2.1.*",
        "sensio/generator-bundle": "2.1.*",
        "jms/security-extra-bundle": "1.2.*",
        "jms/di-extra-bundle": "1.1.*"
    },
    "scripts": {
        "post-install-cmd": [
            "SensioBundleDistributionBundleComposerScriptHandler::buildBootstrap",
            "SensioBundleDistributionBundleComposerScriptHandler::clearCache",
            "SensioBundleDistributionBundleComposerScriptHandler::installAssets",
            "SensioBundleDistributionBundleComposerScriptHandler::installRequirementsFile"
        ],
        "post-update-cmd": [
            "SensioBundleDistributionBundleComposerScriptHandler::buildBootstrap",
            "SensioBundleDistributionBundleComposerScriptHandler::clearCache",
            "SensioBundleDistributionBundleComposerScriptHandler::installAssets",
            "SensioBundleDistributionBundleComposerScriptHandler::installRequirementsFile"
        ]
    },
{
    "name": "symfony/framework-standard-edition",
    "description": "The "Symfony Standard Edition" distribution",
    "autoload": {
        "psr-0": { "": "src/" }
    },
    "require": {
        "php": ">=5.3.3",
        "symfony/symfony": "2.1.*",
        "doctrine/orm": ">=2.2.3,<2.4-dev",
        "doctrine/doctrine-bundle": "1.0.*",
        "twig/extensions": "1.0.*",
        "symfony/assetic-bundle": "2.1.*",
        "symfony/swiftmailer-bundle": "2.1.*",
        "symfony/monolog-bundle": "2.1.*",
        "sensio/distribution-bundle": "2.1.*",
        "sensio/framework-extra-bundle": "2.1.*",
        "sensio/generator-bundle": "2.1.*",
        "jms/security-extra-bundle": "1.2.*",
        "jms/di-extra-bundle": "1.1.*"
    },
    "scripts": {
        "post-install-cmd": [
            "SensioBundleDistributionBundleComposerScriptHandler::buildBootstrap",
            "SensioBundleDistributionBundleComposerScriptHandler::clearCache",
            "SensioBundleDistributionBundleComposerScriptHandler::installAssets",
            "SensioBundleDistributionBundleComposerScriptHandler::installRequirementsFile"
        ],
        "post-update-cmd": [
            "SensioBundleDistributionBundleComposerScriptHandler::buildBootstrap",
            "SensioBundleDistributionBundleComposerScriptHandler::clearCache",
            "SensioBundleDistributionBundleComposerScriptHandler::installAssets",
            "SensioBundleDistributionBundleComposerScriptHandler::installRequirementsFile"
        ]
    },
    "config": {
        "bin-dir": "bin"
    },
{
    "name": "symfony/framework-standard-edition",
    "description": "The "Symfony Standard Edition" distribution",
    "autoload": {
        "psr-0": { "": "src/" }
    },
    "require": {
        "php": ">=5.3.3",
        "symfony/symfony": "2.1.*",
        "doctrine/orm": ">=2.2.3,<2.4-dev",
        "doctrine/doctrine-bundle": "1.0.*",
        "twig/extensions": "1.0.*",
        "symfony/assetic-bundle": "2.1.*",
        "symfony/swiftmailer-bundle": "2.1.*",
        "symfony/monolog-bundle": "2.1.*",
        "sensio/distribution-bundle": "2.1.*",
        "sensio/framework-extra-bundle": "2.1.*",
        "sensio/generator-bundle": "2.1.*",
        "jms/security-extra-bundle": "1.2.*",
        "jms/di-extra-bundle": "1.1.*"
    },
    "scripts": {
        "post-install-cmd": [
            "SensioBundleDistributionBundleComposerScriptHandler::buildBootstrap",
            "SensioBundleDistributionBundleComposerScriptHandler::clearCache",
            "SensioBundleDistributionBundleComposerScriptHandler::installAssets",
            "SensioBundleDistributionBundleComposerScriptHandler::installRequirementsFile"
        ],
        "post-update-cmd": [
            "SensioBundleDistributionBundleComposerScriptHandler::buildBootstrap",
            "SensioBundleDistributionBundleComposerScriptHandler::clearCache",
            "SensioBundleDistributionBundleComposerScriptHandler::installAssets",
            "SensioBundleDistributionBundleComposerScriptHandler::installRequirementsFile"
        ]
    },
    "config": {
        "bin-dir": "bin"
    },
    "minimum-stability": "dev",
{
    "name": "symfony/framework-standard-edition",
    "description": "The "Symfony Standard Edition" distribution",
    "autoload": {
        "psr-0": { "": "src/" }
    },
    "require": {
        "php": ">=5.3.3",
        "symfony/symfony": "2.1.*",
        "doctrine/orm": ">=2.2.3,<2.4-dev",
        "doctrine/doctrine-bundle": "1.0.*",
        "twig/extensions": "1.0.*",
        "symfony/assetic-bundle": "2.1.*",
        "symfony/swiftmailer-bundle": "2.1.*",
        "symfony/monolog-bundle": "2.1.*",
        "sensio/distribution-bundle": "2.1.*",
        "sensio/framework-extra-bundle": "2.1.*",
        "sensio/generator-bundle": "2.1.*",
        "jms/security-extra-bundle": "1.2.*",
        "jms/di-extra-bundle": "1.1.*"
    },
    "scripts": {
        "post-install-cmd": [
            "SensioBundleDistributionBundleComposerScriptHandler::buildBootstrap",
            "SensioBundleDistributionBundleComposerScriptHandler::clearCache",
            "SensioBundleDistributionBundleComposerScriptHandler::installAssets",
            "SensioBundleDistributionBundleComposerScriptHandler::installRequirementsFile"
        ],
        "post-update-cmd": [
            "SensioBundleDistributionBundleComposerScriptHandler::buildBootstrap",
            "SensioBundleDistributionBundleComposerScriptHandler::clearCache",
            "SensioBundleDistributionBundleComposerScriptHandler::installAssets",
            "SensioBundleDistributionBundleComposerScriptHandler::installRequirementsFile"
        ]
    },
    "config": {
        "bin-dir": "bin"
    },
    "minimum-stability": "dev",
{
    "name": "symfony/framework-standard-edition",
    "description": "The "Symfony Standard Edition" distribution",
    "autoload": {
        "psr-0": { "": "src/" }
    },
    "require": {
        "php": ">=5.3.3",
        "symfony/symfony": "2.1.*",
        "doctrine/orm": ">=2.2.3,<2.4-dev",
        "doctrine/doctrine-bundle": "1.0.*",
        "twig/extensions": "1.0.*",
        "symfony/assetic-bundle": "2.1.*",
        "symfony/swiftmailer-bundle": "2.1.*",
        "symfony/monolog-bundle": "2.1.*",
        "sensio/distribution-bundle": "2.1.*",
        "sensio/framework-extra-bundle": "2.1.*",
        "sensio/generator-bundle": "2.1.*",
        "jms/security-extra-bundle": "1.2.*",
        "jms/di-extra-bundle": "1.1.*"
    },
    "scripts": {
        "post-install-cmd": [
            "SensioBundleDistributionBundleComposerScriptHandler::buildBootstrap",
            "SensioBundleDistributionBundleComposerScriptHandler::clearCache",
            "SensioBundleDistributionBundleComposerScriptHandler::installAssets",
            "SensioBundleDistributionBundleComposerScriptHandler::installRequirementsFile"
        ],
        "post-update-cmd": [
            "SensioBundleDistributionBundleComposerScriptHandler::buildBootstrap",
            "SensioBundleDistributionBundleComposerScriptHandler::clearCache",
            "SensioBundleDistributionBundleComposerScriptHandler::installAssets",
            "SensioBundleDistributionBundleComposerScriptHandler::installRequirementsFile"
        ]
    },
    "config": {
        "bin-dir": "bin"
    },
    "minimum-stability": "dev",
    "extra": {
        "symfony-app-dir": "app",
        "symfony-web-dir": "web"
    }
Composer: Killer Features
Composer: Killer Features

•   composer.lock
Composer: Killer Features

•   composer.lock

•   Satis - Your private repository
Composer: Killer Features

•   composer.lock

•   Satis - Your private repository

•   composer installers
Composer: Killer Features

•   composer.lock

•   Satis - Your private repository

•   composer installers

•   Get started with a new framework project directly from composer
composer.lock
composer.lock


•   Used when you call composer install
composer.lock


•   Used when you call composer install

•   Updated by composer update
composer.lock


•   Used when you call composer install

•   Updated by composer update

•   Everybody runs the exact same version of dependencies
Satis
Satis
•   Your very own packagist for your proprietary code
Satis
•   Your very own packagist for your proprietary code

•   Eases deployment
Satis
•   Your very own packagist for your proprietary code

•   Eases deployment

•   Composer will connect to it securely
Satis
•   Your very own packagist for your proprietary code

•   Eases deployment

•   Composer will connect to it securely

    •   HTTPS -Public key
Satis
•   Your very own packagist for your proprietary code

•   Eases deployment

•   Composer will connect to it securely

    •   HTTPS -Public key

    •   SSH
Satis
•   Your very own packagist for your proprietary code

•   Eases deployment

•   Composer will connect to it securely

    •   HTTPS -Public key

    •   SSH

•   See https://github.com/composer/satis
Composer Installers
          •CakePHP                        •lithium-source
             •cakephp-plugin            •Magento
          •CodeIgniter                     •magento-library
             •codeigniter-library          •magento-skin
             •codeigniter-third-party      •magento-theme
             •codeigniter-module        •Mako
          •Drupal                          •mako-package
             •drupal-module             •MediaWiki
             •drupal-theme                 •mediawiki-extension
             •drupal-profile             •phpBB
             •drupal-drush                 •phpbb-extension
          •FuelPHP                      •PPI
             •fuelphp-module               •ppi-module
          •Joomla                       •SilverStripe
             •joomla-component             •silverstripe-module
             •joomla-module                •silverstripe-theme
             •joomla-template           •symfony1
             •joomla-plugin                •symfony1-plugin
             •joomla-library            •WordPress
          •Kohana                          •wordpress-plugin
             •kohana-module                •wordpress-theme
          •Laravel                      •Zend
             •laravel-library              •zend-library
          •Lithium                         •zend-extra
             •lithium-library
Composer Installers
                               •CakePHP                        •lithium-source
                                  •cakephp-plugin            •Magento
•   Bring the power and ease   •CodeIgniter
                                  •codeigniter-library
                                  •codeigniter-third-party
                                                                •magento-library
                                                                •magento-skin
                                                                •magento-theme
    of Composer to your           •codeigniter-module        •Mako
                               •Drupal                          •mako-package
    framework/CMS                 •drupal-module             •MediaWiki
                                  •drupal-theme                 •mediawiki-extension
                                  •drupal-profile             •phpBB
                                  •drupal-drush                 •phpbb-extension
                               •FuelPHP                      •PPI
                                  •fuelphp-module               •ppi-module
                               •Joomla                       •SilverStripe
                                  •joomla-component             •silverstripe-module
                                  •joomla-module                •silverstripe-theme
                                  •joomla-template           •symfony1
                                  •joomla-plugin                •symfony1-plugin
                                  •joomla-library            •WordPress
                               •Kohana                          •wordpress-plugin
                                  •kohana-module                •wordpress-theme
                               •Laravel                      •Zend
                                  •laravel-library              •zend-library
                               •Lithium                         •zend-extra
                                  •lithium-library
Composer Installers
                                   •CakePHP                        •lithium-source
                                      •cakephp-plugin            •Magento
•   Bring the power and ease       •CodeIgniter
                                      •codeigniter-library
                                      •codeigniter-third-party
                                                                    •magento-library
                                                                    •magento-skin
                                                                    •magento-theme
    of Composer to your               •codeigniter-module        •Mako
                                   •Drupal                          •mako-package
    framework/CMS                     •drupal-module             •MediaWiki
                                      •drupal-theme                 •mediawiki-extension
                                      •drupal-profile             •phpBB

•   Magically installs packages/      •drupal-drush
                                   •FuelPHP
                                      •fuelphp-module
                                                                    •phpbb-extension
                                                                 •PPI
                                                                    •ppi-module
    plugins to the correct         •Joomla                       •SilverStripe
                                      •joomla-component             •silverstripe-module
    location for framework            •joomla-module                •silverstripe-theme
                                      •joomla-template           •symfony1
                                      •joomla-plugin                •symfony1-plugin
                                      •joomla-library            •WordPress
                                   •Kohana                          •wordpress-plugin
                                      •kohana-module                •wordpress-theme
                                   •Laravel                      •Zend
                                      •laravel-library              •zend-library
                                   •Lithium                         •zend-extra
                                      •lithium-library
Composer Installers
                                   •CakePHP                        •lithium-source
                                      •cakephp-plugin            •Magento
•   Bring the power and ease       •CodeIgniter
                                      •codeigniter-library
                                      •codeigniter-third-party
                                                                    •magento-library
                                                                    •magento-skin
                                                                    •magento-theme
    of Composer to your               •codeigniter-module        •Mako
                                   •Drupal                          •mako-package
    framework/CMS                     •drupal-module             •MediaWiki
                                      •drupal-theme                 •mediawiki-extension
                                      •drupal-profile             •phpBB

•   Magically installs packages/      •drupal-drush
                                   •FuelPHP
                                      •fuelphp-module
                                                                    •phpbb-extension
                                                                 •PPI
                                                                    •ppi-module
    plugins to the correct         •Joomla                       •SilverStripe
                                      •joomla-component             •silverstripe-module
    location for framework            •joomla-module                •silverstripe-theme
                                      •joomla-template           •symfony1
                                      •joomla-plugin                •symfony1-plugin

•   See https://github.com/           •joomla-library
                                   •Kohana
                                      •kohana-module
                                                                 •WordPress
                                                                    •wordpress-plugin
                                                                    •wordpress-theme
    composer/installers            •Laravel                      •Zend
                                      •laravel-library              •zend-library
                                   •Lithium                         •zend-extra
                                      •lithium-library
Setup a new project

•   Symfony2
    composer create-project symfony/framework-standard-edition path/to/install


•   Zend Framework 2
    composer create-project --repository-url="http://
    packages.zendframework.com" zendframework/skeleton-application path/to/
    install
?
Thankyou
Further Reading:

http://getcomposer.org

http://packagist.org

http://symfony.com/video/26/in-depth-with-composer/English



Slides available at https://speakerdeck.com/u/tommygnr

More Related Content

What's hot

Fabric workshop(1) - (MOSG)
Fabric workshop(1) - (MOSG)Fabric workshop(1) - (MOSG)
Fabric workshop(1) - (MOSG)Soshi Nemoto
 
Vagrant for real (codemotion rome 2016)
Vagrant for real (codemotion rome 2016)Vagrant for real (codemotion rome 2016)
Vagrant for real (codemotion rome 2016)Michele Orselli
 
Distributed Developer Workflows using Git
Distributed Developer Workflows using GitDistributed Developer Workflows using Git
Distributed Developer Workflows using GitSusan Potter
 
Puppet at Opera Sofware - PuppetCamp Oslo 2013
Puppet at Opera Sofware - PuppetCamp Oslo 2013Puppet at Opera Sofware - PuppetCamp Oslo 2013
Puppet at Opera Sofware - PuppetCamp Oslo 2013Cosimo Streppone
 
Web development automatisation for fun and profit (Artem Daniliants)
Web development automatisation for fun and profit (Artem Daniliants)Web development automatisation for fun and profit (Artem Daniliants)
Web development automatisation for fun and profit (Artem Daniliants)LumoSpark
 
Composer, putting dependencies on the score
Composer, putting dependencies on the scoreComposer, putting dependencies on the score
Composer, putting dependencies on the scoreRafael Dohms
 
PECL Picks - Extensions to make your life better
PECL Picks - Extensions to make your life betterPECL Picks - Extensions to make your life better
PECL Picks - Extensions to make your life betterZendCon
 
Die .htaccess richtig nutzen
Die .htaccess richtig nutzenDie .htaccess richtig nutzen
Die .htaccess richtig nutzenWalter Ebert
 
Making environment for_infrastructure_as_code
Making environment for_infrastructure_as_codeMaking environment for_infrastructure_as_code
Making environment for_infrastructure_as_codeSoshi Nemoto
 
HTTPS + Let's Encrypt
HTTPS + Let's EncryptHTTPS + Let's Encrypt
HTTPS + Let's EncryptWalter Ebert
 
Automation with ansible
Automation with ansibleAutomation with ansible
Automation with ansibleKhizer Naeem
 
How we use and deploy Varnish at Opera
How we use and deploy Varnish at OperaHow we use and deploy Varnish at Opera
How we use and deploy Varnish at OperaCosimo Streppone
 
Create Development and Production Environments with Vagrant
Create Development and Production Environments with VagrantCreate Development and Production Environments with Vagrant
Create Development and Production Environments with VagrantBrian Hogan
 
Ansible - Swiss Army Knife Orchestration
Ansible - Swiss Army Knife OrchestrationAnsible - Swiss Army Knife Orchestration
Ansible - Swiss Army Knife Orchestrationbcoca
 
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQueryRemedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQueryTatsuhiko Miyagawa
 

What's hot (20)

kubernetes practice
kubernetes practicekubernetes practice
kubernetes practice
 
Fabric workshop(1) - (MOSG)
Fabric workshop(1) - (MOSG)Fabric workshop(1) - (MOSG)
Fabric workshop(1) - (MOSG)
 
Vagrant for real (codemotion rome 2016)
Vagrant for real (codemotion rome 2016)Vagrant for real (codemotion rome 2016)
Vagrant for real (codemotion rome 2016)
 
Distributed Developer Workflows using Git
Distributed Developer Workflows using GitDistributed Developer Workflows using Git
Distributed Developer Workflows using Git
 
Puppet at Opera Sofware - PuppetCamp Oslo 2013
Puppet at Opera Sofware - PuppetCamp Oslo 2013Puppet at Opera Sofware - PuppetCamp Oslo 2013
Puppet at Opera Sofware - PuppetCamp Oslo 2013
 
Php on Windows
Php on WindowsPhp on Windows
Php on Windows
 
Web development automatisation for fun and profit (Artem Daniliants)
Web development automatisation for fun and profit (Artem Daniliants)Web development automatisation for fun and profit (Artem Daniliants)
Web development automatisation for fun and profit (Artem Daniliants)
 
Composer, putting dependencies on the score
Composer, putting dependencies on the scoreComposer, putting dependencies on the score
Composer, putting dependencies on the score
 
PECL Picks - Extensions to make your life better
PECL Picks - Extensions to make your life betterPECL Picks - Extensions to make your life better
PECL Picks - Extensions to make your life better
 
Die .htaccess richtig nutzen
Die .htaccess richtig nutzenDie .htaccess richtig nutzen
Die .htaccess richtig nutzen
 
Making environment for_infrastructure_as_code
Making environment for_infrastructure_as_codeMaking environment for_infrastructure_as_code
Making environment for_infrastructure_as_code
 
HTTPS + Let's Encrypt
HTTPS + Let's EncryptHTTPS + Let's Encrypt
HTTPS + Let's Encrypt
 
Tatsumaki
TatsumakiTatsumaki
Tatsumaki
 
Automation with ansible
Automation with ansibleAutomation with ansible
Automation with ansible
 
How we use and deploy Varnish at Opera
How we use and deploy Varnish at OperaHow we use and deploy Varnish at Opera
How we use and deploy Varnish at Opera
 
Sprockets
SprocketsSprockets
Sprockets
 
Create Development and Production Environments with Vagrant
Create Development and Production Environments with VagrantCreate Development and Production Environments with Vagrant
Create Development and Production Environments with Vagrant
 
Ansible - Swiss Army Knife Orchestration
Ansible - Swiss Army Knife OrchestrationAnsible - Swiss Army Knife Orchestration
Ansible - Swiss Army Knife Orchestration
 
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQueryRemedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
 
About Data::ObjectDriver
About Data::ObjectDriverAbout Data::ObjectDriver
About Data::ObjectDriver
 

Viewers also liked

Презентація команди Васильківської ЗОШ І-ІІІ ступенів №2
Презентація команди Васильківської ЗОШ І-ІІІ ступенів №2Презентація команди Васильківської ЗОШ І-ІІІ ступенів №2
Презентація команди Васильківської ЗОШ І-ІІІ ступенів №208600 Vasilkov
 
Follow-Up Hearing Test in Long Island NY Recommended After National Hearing Test
Follow-Up Hearing Test in Long Island NY Recommended After National Hearing TestFollow-Up Hearing Test in Long Island NY Recommended After National Hearing Test
Follow-Up Hearing Test in Long Island NY Recommended After National Hearing TestEast End Hearing
 
Planificaciones sonia 3 de enero
Planificaciones sonia 3 de eneroPlanificaciones sonia 3 de enero
Planificaciones sonia 3 de eneroRoberto Sànchez
 
How to evaluate professional learning policies: Match policy to practice for ...
How to evaluate professional learning policies: Match policy to practice for ...How to evaluate professional learning policies: Match policy to practice for ...
How to evaluate professional learning policies: Match policy to practice for ...Learning Forward
 
Advanced Production Accounting of a Flotation Plant
Advanced Production Accounting of a Flotation PlantAdvanced Production Accounting of a Flotation Plant
Advanced Production Accounting of a Flotation PlantAlkis Vazacopoulos
 
Newsletter read for the record, october 6, 2011(nlformat)2
Newsletter read for the record, october 6, 2011(nlformat)2Newsletter read for the record, october 6, 2011(nlformat)2
Newsletter read for the record, october 6, 2011(nlformat)2Felix Brown
 
Violéncia de génere
Violéncia de génereVioléncia de génere
Violéncia de génereyatusaeh
 
25725suggans ipcc nov11_1
25725suggans ipcc nov11_125725suggans ipcc nov11_1
25725suggans ipcc nov11_1rajatkhullar
 
Developing the next generation of Real Time Optimization Technologies (Blend ...
Developing the next generation of Real Time Optimization Technologies (Blend ...Developing the next generation of Real Time Optimization Technologies (Blend ...
Developing the next generation of Real Time Optimization Technologies (Blend ...Alkis Vazacopoulos
 
Coltanul
ColtanulColtanul
Coltanulplex015
 
Presentación verbatin clinico elkaliz
Presentación verbatin clinico elkalizPresentación verbatin clinico elkaliz
Presentación verbatin clinico elkalizAndrea Hernandez
 
ใบงานสำรวจตนเอง M
ใบงานสำรวจตนเอง Mใบงานสำรวจตนเอง M
ใบงานสำรวจตนเอง MFiction Lee'jslism
 
Endocrine system chapter 11
Endocrine system chapter 11Endocrine system chapter 11
Endocrine system chapter 11Kaylal88
 

Viewers also liked (20)

Talent 21
Talent 21 Talent 21
Talent 21
 
Readmex
ReadmexReadmex
Readmex
 
Презентація команди Васильківської ЗОШ І-ІІІ ступенів №2
Презентація команди Васильківської ЗОШ І-ІІІ ступенів №2Презентація команди Васильківської ЗОШ І-ІІІ ступенів №2
Презентація команди Васильківської ЗОШ І-ІІІ ступенів №2
 
Powerpoint
PowerpointPowerpoint
Powerpoint
 
Follow-Up Hearing Test in Long Island NY Recommended After National Hearing Test
Follow-Up Hearing Test in Long Island NY Recommended After National Hearing TestFollow-Up Hearing Test in Long Island NY Recommended After National Hearing Test
Follow-Up Hearing Test in Long Island NY Recommended After National Hearing Test
 
Planificaciones sonia 3 de enero
Planificaciones sonia 3 de eneroPlanificaciones sonia 3 de enero
Planificaciones sonia 3 de enero
 
How to evaluate professional learning policies: Match policy to practice for ...
How to evaluate professional learning policies: Match policy to practice for ...How to evaluate professional learning policies: Match policy to practice for ...
How to evaluate professional learning policies: Match policy to practice for ...
 
Advanced Production Accounting of a Flotation Plant
Advanced Production Accounting of a Flotation PlantAdvanced Production Accounting of a Flotation Plant
Advanced Production Accounting of a Flotation Plant
 
cec2013
cec2013cec2013
cec2013
 
Newsletter read for the record, october 6, 2011(nlformat)2
Newsletter read for the record, october 6, 2011(nlformat)2Newsletter read for the record, october 6, 2011(nlformat)2
Newsletter read for the record, october 6, 2011(nlformat)2
 
Violéncia de génere
Violéncia de génereVioléncia de génere
Violéncia de génere
 
25725suggans ipcc nov11_1
25725suggans ipcc nov11_125725suggans ipcc nov11_1
25725suggans ipcc nov11_1
 
Goal setting - dr. s. swapna kumar
Goal  setting - dr. s. swapna kumarGoal  setting - dr. s. swapna kumar
Goal setting - dr. s. swapna kumar
 
Developing the next generation of Real Time Optimization Technologies (Blend ...
Developing the next generation of Real Time Optimization Technologies (Blend ...Developing the next generation of Real Time Optimization Technologies (Blend ...
Developing the next generation of Real Time Optimization Technologies (Blend ...
 
Coltanul
ColtanulColtanul
Coltanul
 
Ares
AresAres
Ares
 
Presentación verbatin clinico elkaliz
Presentación verbatin clinico elkalizPresentación verbatin clinico elkaliz
Presentación verbatin clinico elkaliz
 
ใบงานสำรวจตนเอง M
ใบงานสำรวจตนเอง Mใบงานสำรวจตนเอง M
ใบงานสำรวจตนเอง M
 
Endocrine system chapter 11
Endocrine system chapter 11Endocrine system chapter 11
Endocrine system chapter 11
 
Team 5
Team 5Team 5
Team 5
 

Similar to Composer

Capifony. Minsk PHP MeetUp #11
Capifony. Minsk PHP MeetUp #11Capifony. Minsk PHP MeetUp #11
Capifony. Minsk PHP MeetUp #11Yury Pliashkou
 
Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014biicode
 
Composer for busy developers - DPC13
Composer for busy developers - DPC13Composer for busy developers - DPC13
Composer for busy developers - DPC13Rafael Dohms
 
Dependency management with Composer
Dependency management with ComposerDependency management with Composer
Dependency management with ComposerJason Grimes
 
Composer for Busy Developers - php|tek13
Composer for Busy Developers - php|tek13Composer for Busy Developers - php|tek13
Composer for Busy Developers - php|tek13Rafael Dohms
 
Node.js basics
Node.js basicsNode.js basics
Node.js basicsBen Lin
 
PHP Dependency Management with Composer
PHP Dependency Management with ComposerPHP Dependency Management with Composer
PHP Dependency Management with ComposerAdam Englander
 
May The Nodejs Be With You
May The Nodejs Be With YouMay The Nodejs Be With You
May The Nodejs Be With YouDalibor Gogic
 
PHP on Heroku: Deploying and Scaling Apps in the Cloud
PHP on Heroku: Deploying and Scaling Apps in the CloudPHP on Heroku: Deploying and Scaling Apps in the Cloud
PHP on Heroku: Deploying and Scaling Apps in the CloudSalesforce Developers
 
Create your very own Development Environment with Vagrant and Packer
Create your very own Development Environment with Vagrant and PackerCreate your very own Development Environment with Vagrant and Packer
Create your very own Development Environment with Vagrant and Packerfrastel
 
Deploying Symfony | symfony.cat
Deploying Symfony | symfony.catDeploying Symfony | symfony.cat
Deploying Symfony | symfony.catPablo Godel
 
WordPress mit Composer und Git verwalten
WordPress mit Composer und Git verwaltenWordPress mit Composer und Git verwalten
WordPress mit Composer und Git verwaltenWalter Ebert
 
Composer - The missing package manager for PHP
Composer - The missing package manager for PHPComposer - The missing package manager for PHP
Composer - The missing package manager for PHPTareq Hasan
 
Burn down the silos! Helping dev and ops gel on high availability websites
Burn down the silos! Helping dev and ops gel on high availability websitesBurn down the silos! Helping dev and ops gel on high availability websites
Burn down the silos! Helping dev and ops gel on high availability websitesLindsay Holmwood
 
Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013
Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013
Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013Carlos Sanchez
 
symfony: An Open-Source Framework for Professionals (Dutch Php Conference 2008)
symfony: An Open-Source Framework for Professionals (Dutch Php Conference 2008)symfony: An Open-Source Framework for Professionals (Dutch Php Conference 2008)
symfony: An Open-Source Framework for Professionals (Dutch Php Conference 2008)Fabien Potencier
 
Getting Started With CFEngine - Updated Version
Getting Started With CFEngine - Updated VersionGetting Started With CFEngine - Updated Version
Getting Started With CFEngine - Updated VersionCFEngine
 

Similar to Composer (20)

Capifony. Minsk PHP MeetUp #11
Capifony. Minsk PHP MeetUp #11Capifony. Minsk PHP MeetUp #11
Capifony. Minsk PHP MeetUp #11
 
Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014
 
Composer for busy developers - DPC13
Composer for busy developers - DPC13Composer for busy developers - DPC13
Composer for busy developers - DPC13
 
Composer
ComposerComposer
Composer
 
Dependency management with Composer
Dependency management with ComposerDependency management with Composer
Dependency management with Composer
 
Composer for Busy Developers - php|tek13
Composer for Busy Developers - php|tek13Composer for Busy Developers - php|tek13
Composer for Busy Developers - php|tek13
 
Node.js basics
Node.js basicsNode.js basics
Node.js basics
 
Mastering composer
Mastering composerMastering composer
Mastering composer
 
PHP Dependency Management with Composer
PHP Dependency Management with ComposerPHP Dependency Management with Composer
PHP Dependency Management with Composer
 
May The Nodejs Be With You
May The Nodejs Be With YouMay The Nodejs Be With You
May The Nodejs Be With You
 
PHP on Heroku: Deploying and Scaling Apps in the Cloud
PHP on Heroku: Deploying and Scaling Apps in the CloudPHP on Heroku: Deploying and Scaling Apps in the Cloud
PHP on Heroku: Deploying and Scaling Apps in the Cloud
 
Create your very own Development Environment with Vagrant and Packer
Create your very own Development Environment with Vagrant and PackerCreate your very own Development Environment with Vagrant and Packer
Create your very own Development Environment with Vagrant and Packer
 
Deploying Symfony | symfony.cat
Deploying Symfony | symfony.catDeploying Symfony | symfony.cat
Deploying Symfony | symfony.cat
 
Running Symfony
Running SymfonyRunning Symfony
Running Symfony
 
WordPress mit Composer und Git verwalten
WordPress mit Composer und Git verwaltenWordPress mit Composer und Git verwalten
WordPress mit Composer und Git verwalten
 
Composer - The missing package manager for PHP
Composer - The missing package manager for PHPComposer - The missing package manager for PHP
Composer - The missing package manager for PHP
 
Burn down the silos! Helping dev and ops gel on high availability websites
Burn down the silos! Helping dev and ops gel on high availability websitesBurn down the silos! Helping dev and ops gel on high availability websites
Burn down the silos! Helping dev and ops gel on high availability websites
 
Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013
Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013
Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013
 
symfony: An Open-Source Framework for Professionals (Dutch Php Conference 2008)
symfony: An Open-Source Framework for Professionals (Dutch Php Conference 2008)symfony: An Open-Source Framework for Professionals (Dutch Php Conference 2008)
symfony: An Open-Source Framework for Professionals (Dutch Php Conference 2008)
 
Getting Started With CFEngine - Updated Version
Getting Started With CFEngine - Updated VersionGetting Started With CFEngine - Updated Version
Getting Started With CFEngine - Updated Version
 

Composer

  • 1. Tom Corrigan Melbourne PHP Users Group rostercloud.com October 2012 @t_corrigan
  • 2. What is Composer? “Composer is a tool for dependency management. It allows you to declare the dependent libraries your project needs and it will install them in your project for you.” [http://getcomposer.org/doc/00-intro.md]
  • 4. What does that mean? • Scope is per project, not global
  • 5. What does that mean? • Scope is per project, not global • Resolves dependencies
  • 6. What does that mean? • Scope is per project, not global • Resolves dependencies • Runs installation tasks
  • 10. Packagist • Composer’s default repository
  • 11. Packagist • Composer’s default repository • Put your open source libraries here
  • 12. Packagist • Composer’s default repository • Put your open source libraries here • Great resource for well maintained PHP libraries
  • 14. Statistics • Over 4000 packages listed on packagist.org [https://packagist.org/statistics]
  • 15. Statistics • Over 4000 packages listed on packagist.org • More than 4,500,000 package installations over the last 6 months [https://packagist.org/statistics]
  • 18. Installing Composer Locally: $ cd /project/path $ curl -s https://getcomposer.org/installer | php
  • 19. Installing Composer Locally: $ cd /project/path $ curl -s https://getcomposer.org/installer | php Globally:
  • 20. Installing Composer Locally: $ cd /project/path $ curl -s https://getcomposer.org/installer | php Globally: $ sudo mv composer.phar /usr/local/bin/composer
  • 23. Staying current Locally: $ cd /project/path $ php composer.phar self-update
  • 24. Staying current Locally: $ cd /project/path $ php composer.phar self-update Globally:
  • 25. Staying current Locally: $ cd /project/path $ php composer.phar self-update Globally: $ composer self-update
  • 27. Using Composer • Define project dependencies
  • 28. Using Composer • Define project dependencies • Install them
  • 29. Using Composer • Define project dependencies • Install them • Bootstrap the autoloader
  • 32. Define your dependencies composer.json { "require": { "phpmelb/project1": "1.0.2" "phpmelb/project2": "1.0.*" "phpmelb/project3": ">=1.0,<2.0" "phpmelb/project4": "4d3fe5feaf" "phpmelb/project5": "dev-master" } }
  • 35. Install $ composer install vendor/ .composer/ phpmelb/ project1/ project2/ project3/ project4/ autoload.php
  • 36. Using the autoloader <?php require 'vendor/autoload.php'; $foo = new PHPMelbProject1Foo(); $bar = new PHPMelb_Project2_Bar(); ...
  • 37.
  • 38. { "name": "symfony/framework-standard-edition", "description": "The "Symfony Standard Edition" distribution",
  • 39. { "name": "symfony/framework-standard-edition", "description": "The "Symfony Standard Edition" distribution", "autoload": { "psr-0": { "": "src/" } },
  • 40. { "name": "symfony/framework-standard-edition", "description": "The "Symfony Standard Edition" distribution", "autoload": { "psr-0": { "": "src/" } },
  • 41. { "name": "symfony/framework-standard-edition", "description": "The "Symfony Standard Edition" distribution", "autoload": { "psr-0": { "": "src/" } }, "require": { "php": ">=5.3.3", "symfony/symfony": "2.1.*", "doctrine/orm": ">=2.2.3,<2.4-dev", "doctrine/doctrine-bundle": "1.0.*", "twig/extensions": "1.0.*", "symfony/assetic-bundle": "2.1.*", "symfony/swiftmailer-bundle": "2.1.*", "symfony/monolog-bundle": "2.1.*", "sensio/distribution-bundle": "2.1.*", "sensio/framework-extra-bundle": "2.1.*", "sensio/generator-bundle": "2.1.*", "jms/security-extra-bundle": "1.2.*", "jms/di-extra-bundle": "1.1.*" },
  • 42. { "name": "symfony/framework-standard-edition", "description": "The "Symfony Standard Edition" distribution", "autoload": { "psr-0": { "": "src/" } }, "require": { "php": ">=5.3.3", "symfony/symfony": "2.1.*", "doctrine/orm": ">=2.2.3,<2.4-dev", "doctrine/doctrine-bundle": "1.0.*", "twig/extensions": "1.0.*", "symfony/assetic-bundle": "2.1.*", "symfony/swiftmailer-bundle": "2.1.*", "symfony/monolog-bundle": "2.1.*", "sensio/distribution-bundle": "2.1.*", "sensio/framework-extra-bundle": "2.1.*", "sensio/generator-bundle": "2.1.*", "jms/security-extra-bundle": "1.2.*", "jms/di-extra-bundle": "1.1.*" }, "scripts": { "post-install-cmd": [ "SensioBundleDistributionBundleComposerScriptHandler::buildBootstrap", "SensioBundleDistributionBundleComposerScriptHandler::clearCache", "SensioBundleDistributionBundleComposerScriptHandler::installAssets", "SensioBundleDistributionBundleComposerScriptHandler::installRequirementsFile" ], "post-update-cmd": [ "SensioBundleDistributionBundleComposerScriptHandler::buildBootstrap", "SensioBundleDistributionBundleComposerScriptHandler::clearCache", "SensioBundleDistributionBundleComposerScriptHandler::installAssets", "SensioBundleDistributionBundleComposerScriptHandler::installRequirementsFile" ] },
  • 43. { "name": "symfony/framework-standard-edition", "description": "The "Symfony Standard Edition" distribution", "autoload": { "psr-0": { "": "src/" } }, "require": { "php": ">=5.3.3", "symfony/symfony": "2.1.*", "doctrine/orm": ">=2.2.3,<2.4-dev", "doctrine/doctrine-bundle": "1.0.*", "twig/extensions": "1.0.*", "symfony/assetic-bundle": "2.1.*", "symfony/swiftmailer-bundle": "2.1.*", "symfony/monolog-bundle": "2.1.*", "sensio/distribution-bundle": "2.1.*", "sensio/framework-extra-bundle": "2.1.*", "sensio/generator-bundle": "2.1.*", "jms/security-extra-bundle": "1.2.*", "jms/di-extra-bundle": "1.1.*" }, "scripts": { "post-install-cmd": [ "SensioBundleDistributionBundleComposerScriptHandler::buildBootstrap", "SensioBundleDistributionBundleComposerScriptHandler::clearCache", "SensioBundleDistributionBundleComposerScriptHandler::installAssets", "SensioBundleDistributionBundleComposerScriptHandler::installRequirementsFile" ], "post-update-cmd": [ "SensioBundleDistributionBundleComposerScriptHandler::buildBootstrap", "SensioBundleDistributionBundleComposerScriptHandler::clearCache", "SensioBundleDistributionBundleComposerScriptHandler::installAssets", "SensioBundleDistributionBundleComposerScriptHandler::installRequirementsFile" ] }, "config": { "bin-dir": "bin" },
  • 44. { "name": "symfony/framework-standard-edition", "description": "The "Symfony Standard Edition" distribution", "autoload": { "psr-0": { "": "src/" } }, "require": { "php": ">=5.3.3", "symfony/symfony": "2.1.*", "doctrine/orm": ">=2.2.3,<2.4-dev", "doctrine/doctrine-bundle": "1.0.*", "twig/extensions": "1.0.*", "symfony/assetic-bundle": "2.1.*", "symfony/swiftmailer-bundle": "2.1.*", "symfony/monolog-bundle": "2.1.*", "sensio/distribution-bundle": "2.1.*", "sensio/framework-extra-bundle": "2.1.*", "sensio/generator-bundle": "2.1.*", "jms/security-extra-bundle": "1.2.*", "jms/di-extra-bundle": "1.1.*" }, "scripts": { "post-install-cmd": [ "SensioBundleDistributionBundleComposerScriptHandler::buildBootstrap", "SensioBundleDistributionBundleComposerScriptHandler::clearCache", "SensioBundleDistributionBundleComposerScriptHandler::installAssets", "SensioBundleDistributionBundleComposerScriptHandler::installRequirementsFile" ], "post-update-cmd": [ "SensioBundleDistributionBundleComposerScriptHandler::buildBootstrap", "SensioBundleDistributionBundleComposerScriptHandler::clearCache", "SensioBundleDistributionBundleComposerScriptHandler::installAssets", "SensioBundleDistributionBundleComposerScriptHandler::installRequirementsFile" ] }, "config": { "bin-dir": "bin" }, "minimum-stability": "dev",
  • 45. { "name": "symfony/framework-standard-edition", "description": "The "Symfony Standard Edition" distribution", "autoload": { "psr-0": { "": "src/" } }, "require": { "php": ">=5.3.3", "symfony/symfony": "2.1.*", "doctrine/orm": ">=2.2.3,<2.4-dev", "doctrine/doctrine-bundle": "1.0.*", "twig/extensions": "1.0.*", "symfony/assetic-bundle": "2.1.*", "symfony/swiftmailer-bundle": "2.1.*", "symfony/monolog-bundle": "2.1.*", "sensio/distribution-bundle": "2.1.*", "sensio/framework-extra-bundle": "2.1.*", "sensio/generator-bundle": "2.1.*", "jms/security-extra-bundle": "1.2.*", "jms/di-extra-bundle": "1.1.*" }, "scripts": { "post-install-cmd": [ "SensioBundleDistributionBundleComposerScriptHandler::buildBootstrap", "SensioBundleDistributionBundleComposerScriptHandler::clearCache", "SensioBundleDistributionBundleComposerScriptHandler::installAssets", "SensioBundleDistributionBundleComposerScriptHandler::installRequirementsFile" ], "post-update-cmd": [ "SensioBundleDistributionBundleComposerScriptHandler::buildBootstrap", "SensioBundleDistributionBundleComposerScriptHandler::clearCache", "SensioBundleDistributionBundleComposerScriptHandler::installAssets", "SensioBundleDistributionBundleComposerScriptHandler::installRequirementsFile" ] }, "config": { "bin-dir": "bin" }, "minimum-stability": "dev",
  • 46. { "name": "symfony/framework-standard-edition", "description": "The "Symfony Standard Edition" distribution", "autoload": { "psr-0": { "": "src/" } }, "require": { "php": ">=5.3.3", "symfony/symfony": "2.1.*", "doctrine/orm": ">=2.2.3,<2.4-dev", "doctrine/doctrine-bundle": "1.0.*", "twig/extensions": "1.0.*", "symfony/assetic-bundle": "2.1.*", "symfony/swiftmailer-bundle": "2.1.*", "symfony/monolog-bundle": "2.1.*", "sensio/distribution-bundle": "2.1.*", "sensio/framework-extra-bundle": "2.1.*", "sensio/generator-bundle": "2.1.*", "jms/security-extra-bundle": "1.2.*", "jms/di-extra-bundle": "1.1.*" }, "scripts": { "post-install-cmd": [ "SensioBundleDistributionBundleComposerScriptHandler::buildBootstrap", "SensioBundleDistributionBundleComposerScriptHandler::clearCache", "SensioBundleDistributionBundleComposerScriptHandler::installAssets", "SensioBundleDistributionBundleComposerScriptHandler::installRequirementsFile" ], "post-update-cmd": [ "SensioBundleDistributionBundleComposerScriptHandler::buildBootstrap", "SensioBundleDistributionBundleComposerScriptHandler::clearCache", "SensioBundleDistributionBundleComposerScriptHandler::installAssets", "SensioBundleDistributionBundleComposerScriptHandler::installRequirementsFile" ] }, "config": { "bin-dir": "bin" }, "minimum-stability": "dev", "extra": { "symfony-app-dir": "app", "symfony-web-dir": "web" }
  • 49. Composer: Killer Features • composer.lock • Satis - Your private repository
  • 50. Composer: Killer Features • composer.lock • Satis - Your private repository • composer installers
  • 51. Composer: Killer Features • composer.lock • Satis - Your private repository • composer installers • Get started with a new framework project directly from composer
  • 53. composer.lock • Used when you call composer install
  • 54. composer.lock • Used when you call composer install • Updated by composer update
  • 55. composer.lock • Used when you call composer install • Updated by composer update • Everybody runs the exact same version of dependencies
  • 56. Satis
  • 57. Satis • Your very own packagist for your proprietary code
  • 58. Satis • Your very own packagist for your proprietary code • Eases deployment
  • 59. Satis • Your very own packagist for your proprietary code • Eases deployment • Composer will connect to it securely
  • 60. Satis • Your very own packagist for your proprietary code • Eases deployment • Composer will connect to it securely • HTTPS -Public key
  • 61. Satis • Your very own packagist for your proprietary code • Eases deployment • Composer will connect to it securely • HTTPS -Public key • SSH
  • 62. Satis • Your very own packagist for your proprietary code • Eases deployment • Composer will connect to it securely • HTTPS -Public key • SSH • See https://github.com/composer/satis
  • 63. Composer Installers •CakePHP •lithium-source •cakephp-plugin •Magento •CodeIgniter •magento-library •codeigniter-library •magento-skin •codeigniter-third-party •magento-theme •codeigniter-module •Mako •Drupal •mako-package •drupal-module •MediaWiki •drupal-theme •mediawiki-extension •drupal-profile •phpBB •drupal-drush •phpbb-extension •FuelPHP •PPI •fuelphp-module •ppi-module •Joomla •SilverStripe •joomla-component •silverstripe-module •joomla-module •silverstripe-theme •joomla-template •symfony1 •joomla-plugin •symfony1-plugin •joomla-library •WordPress •Kohana •wordpress-plugin •kohana-module •wordpress-theme •Laravel •Zend •laravel-library •zend-library •Lithium •zend-extra •lithium-library
  • 64. Composer Installers •CakePHP •lithium-source •cakephp-plugin •Magento • Bring the power and ease •CodeIgniter •codeigniter-library •codeigniter-third-party •magento-library •magento-skin •magento-theme of Composer to your •codeigniter-module •Mako •Drupal •mako-package framework/CMS •drupal-module •MediaWiki •drupal-theme •mediawiki-extension •drupal-profile •phpBB •drupal-drush •phpbb-extension •FuelPHP •PPI •fuelphp-module •ppi-module •Joomla •SilverStripe •joomla-component •silverstripe-module •joomla-module •silverstripe-theme •joomla-template •symfony1 •joomla-plugin •symfony1-plugin •joomla-library •WordPress •Kohana •wordpress-plugin •kohana-module •wordpress-theme •Laravel •Zend •laravel-library •zend-library •Lithium •zend-extra •lithium-library
  • 65. Composer Installers •CakePHP •lithium-source •cakephp-plugin •Magento • Bring the power and ease •CodeIgniter •codeigniter-library •codeigniter-third-party •magento-library •magento-skin •magento-theme of Composer to your •codeigniter-module •Mako •Drupal •mako-package framework/CMS •drupal-module •MediaWiki •drupal-theme •mediawiki-extension •drupal-profile •phpBB • Magically installs packages/ •drupal-drush •FuelPHP •fuelphp-module •phpbb-extension •PPI •ppi-module plugins to the correct •Joomla •SilverStripe •joomla-component •silverstripe-module location for framework •joomla-module •silverstripe-theme •joomla-template •symfony1 •joomla-plugin •symfony1-plugin •joomla-library •WordPress •Kohana •wordpress-plugin •kohana-module •wordpress-theme •Laravel •Zend •laravel-library •zend-library •Lithium •zend-extra •lithium-library
  • 66. Composer Installers •CakePHP •lithium-source •cakephp-plugin •Magento • Bring the power and ease •CodeIgniter •codeigniter-library •codeigniter-third-party •magento-library •magento-skin •magento-theme of Composer to your •codeigniter-module •Mako •Drupal •mako-package framework/CMS •drupal-module •MediaWiki •drupal-theme •mediawiki-extension •drupal-profile •phpBB • Magically installs packages/ •drupal-drush •FuelPHP •fuelphp-module •phpbb-extension •PPI •ppi-module plugins to the correct •Joomla •SilverStripe •joomla-component •silverstripe-module location for framework •joomla-module •silverstripe-theme •joomla-template •symfony1 •joomla-plugin •symfony1-plugin • See https://github.com/ •joomla-library •Kohana •kohana-module •WordPress •wordpress-plugin •wordpress-theme composer/installers •Laravel •Zend •laravel-library •zend-library •Lithium •zend-extra •lithium-library
  • 67. Setup a new project • Symfony2 composer create-project symfony/framework-standard-edition path/to/install • Zend Framework 2 composer create-project --repository-url="http:// packages.zendframework.com" zendframework/skeleton-application path/to/ install
  • 68. ?

Editor's Notes

  1. Abstract: Composer is a tool for managing dependencies in PHP projects. This talk will introduce Composer and its associated package repository Packagist. The key features and benefits of using Composer will be explored and through practical demonstrations you will gain a working knowledge of using Composer for dependency management.\n
  2. \n
  3. Similar to Bundler for Ruby or npm for node. Per project\n
  4. Similar to Bundler for Ruby or npm for node. Per project\n
  5. Similar to Bundler for Ruby or npm for node. Per project\n
  6. plus many more\n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. Global is better, don&amp;#x2019;t have to run self-update in each project\n
  18. Global is better, don&amp;#x2019;t have to run self-update in each project\n
  19. Global is better, don&amp;#x2019;t have to run self-update in each project\n
  20. Global is better, don&amp;#x2019;t have to run self-update in each project\n
  21. Define, install, autoload(optional)\nexamine each step in detail\n
  22. Define, install, autoload(optional)\nexamine each step in detail\n
  23. Define, install, autoload(optional)\nexamine each step in detail\n
  24. 2 parts - package name &amp; package version\npackage name has two parts, vendor name &amp; project nameFirst example, Tag name in git\n
  25. 2 parts - package name &amp; package version\npackage name has two parts, vendor name &amp; project nameFirst example, Tag name in git\n
  26. \n
  27. \n
  28. DIR structure, composer.lock, \nAutoloader is designed for PSR-0 only, there are workarounds for other approaches. PHP-FIG\n
  29. \n
  30. \n
  31. \n
  32. \n
  33. \n
  34. \n
  35. \n
  36. \n
  37. \n
  38. \n
  39. \n
  40. \n
  41. \n
  42. \n
  43. \n
  44. \n
  45. \n
  46. \n
  47. \n
  48. \n
  49. \n
  50. \n
  51. \n
  52. \n
  53. \n
  54. \n
  55. \n
  56. \n
  57. \n
  58. \n
  59. \n
  60. \n
  61. \n
  62. \n
  63. \n
  64. \n
  65. \n
  66. \n
  67. \n
  68. \n
  69. \n
  70. \n
  71. \n
  72. \n
  73. \n
  74. \n
  75. \n
  76. \n
  77. \n
  78. \n
  79. \n
  80. \n
  81. Dev, prod, test, staging, Jim, Bob\n
  82. Dev, prod, test, staging, Jim, Bob\n
  83. Dev, prod, test, staging, Jim, Bob\n
  84. \n
  85. \n
  86. \n
  87. \n
  88. \n
  89. \n
  90. Official extension\n
  91. Official extension\n
  92. Official extension\n
  93. Official extension\n
  94. \n
  95. \n
  96. \n