SlideShare a Scribd company logo
1 of 16
Download to read offline
Gestione delle
dipendenze con
  composer
  Massimiliano Arione
  PUG Roma, 26 novembre 2012
problema


come gestire le dipendenze?
soluzione 1


a mano!
soluzione 2


PEAR
soluzione 3


nel versionamento
              svn:externals
              git submodule
          mercurial subrepo
                        ...
soluzione 4


script di gestione



                        2.0
LA soluzione
installazione


$ curl -s https://getcomposer.org/installer | php
$ sudo mv composer.phar /usr/local/bin/composer
uso


$ composer install
composer.json
{
    "name": "symfony/framework-standard-edition",
    "require": {
        "php": ">=5.3.3",
        "symfony/symfony": "2.2.*",
        "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.2.*",
        "sensio/framework-extra-bundle": "2.2.*",
        "sensio/generator-bundle": "2.2.*",
        "jms/security-extra-bundle": "1.4.*",
        "jms/di-extra-bundle": "1.3.*"
    },
}
un esempio
un esempio
{
    "name": "pugx/autocompleter-bundle",
    "type": "symfony-bundle",
    "description": "Add an autocomplete type to forms",
    "license": "LGPL-3.0+",
    "minimum-stability": "dev",
    "require": {
        "symfony/framework-bundle": "2.1.*",
        "doctrine/orm": ">=2.2,<2.4-dev",
        "symfony/form": "2.1.*"
    },
    "autoload": {
        "psr-0": { "PUGXAutocompleterBundle": "" }
    },
    "target-dir": "PUGX/AutocompleterBundle"
}
un esempio
a signo', è fatta!




http://www.youtube.com/watch?v=DX_CcnN4i0k&t=5m25s
bonus: repo privati
{
     "require": {
          "pippo/mio-repo": "3.*",
          "pluto/altro-repo": "2.*"
     }
     "repositories": [
        {
            "type": "vcs",
            "url": "git@bitbucket.org:pippo/repo.git"
        },
        {
            "type": "vcs",
            "url": "http://svn.example.org/repo"
        }
    ]
}
grazie!
credits
http://upload.wikimedia.org/wikipedia/commons/4/4d/Dependency_network_for_financial_data.jpg
http://static.guide.supereva.it/guide/sogni/trasloco.jpg
http://pear.php.net/downloads/pear-folder.svg
http://getcomposer.org/img/logo-composer-transparent.png
http://verdonepedia.xoom.it/Bianco_rosso_e_verdone/Mario_Brega_Bianco_rosso_e_verdone.jpg




     http://www.slideshare.net/garak

More Related Content

Viewers also liked

Introduzione pratica a Symfony
Introduzione pratica a SymfonyIntroduzione pratica a Symfony
Introduzione pratica a SymfonyEugenio Minardi
 
PHP 7 Crash Course - php[world] 2015
PHP 7 Crash Course - php[world] 2015PHP 7 Crash Course - php[world] 2015
PHP 7 Crash Course - php[world] 2015Colin O'Dell
 
Loving Beautiful Code - Alla Scoperta di Laravel 5 - Francesco Malatesta - Co...
Loving Beautiful Code - Alla Scoperta di Laravel 5 - Francesco Malatesta - Co...Loving Beautiful Code - Alla Scoperta di Laravel 5 - Francesco Malatesta - Co...
Loving Beautiful Code - Alla Scoperta di Laravel 5 - Francesco Malatesta - Co...Codemotion
 
PHP, non lo stesso vecchio linguaggio
PHP, non lo stesso vecchio linguaggioPHP, non lo stesso vecchio linguaggio
PHP, non lo stesso vecchio linguaggioMassimiliano Arione
 
A Practical Introduction to Symfony2
A Practical Introduction to Symfony2A Practical Introduction to Symfony2
A Practical Introduction to Symfony2Kris Wallsmith
 
Service approach for development Rest API in Symfony2
Service approach for development Rest API in Symfony2Service approach for development Rest API in Symfony2
Service approach for development Rest API in Symfony2Sumy PHP User Grpoup
 
Introduzione al linguaggio PHP
Introduzione al linguaggio PHPIntroduzione al linguaggio PHP
Introduzione al linguaggio PHPextrategy
 
Last train to php 7
Last train to php 7Last train to php 7
Last train to php 7Damien Seguy
 
Symfony Best Practices
Symfony Best Practices Symfony Best Practices
Symfony Best Practices Tigran Azatyan
 
Introduction to PHP
Introduction to PHPIntroduction to PHP
Introduction to PHPBradley Holt
 

Viewers also liked (18)

Introduzione pratica a Symfony
Introduzione pratica a SymfonyIntroduzione pratica a Symfony
Introduzione pratica a Symfony
 
Lessons learned in PHP
Lessons learned in PHPLessons learned in PHP
Lessons learned in PHP
 
PHP 7 Crash Course - php[world] 2015
PHP 7 Crash Course - php[world] 2015PHP 7 Crash Course - php[world] 2015
PHP 7 Crash Course - php[world] 2015
 
Loving Beautiful Code - Alla Scoperta di Laravel 5 - Francesco Malatesta - Co...
Loving Beautiful Code - Alla Scoperta di Laravel 5 - Francesco Malatesta - Co...Loving Beautiful Code - Alla Scoperta di Laravel 5 - Francesco Malatesta - Co...
Loving Beautiful Code - Alla Scoperta di Laravel 5 - Francesco Malatesta - Co...
 
PHP, non lo stesso vecchio linguaggio
PHP, non lo stesso vecchio linguaggioPHP, non lo stesso vecchio linguaggio
PHP, non lo stesso vecchio linguaggio
 
The road to php7
The road to php7The road to php7
The road to php7
 
A Practical Introduction to Symfony2
A Practical Introduction to Symfony2A Practical Introduction to Symfony2
A Practical Introduction to Symfony2
 
PHP 7 - benvenuto al futuro
PHP 7 - benvenuto al futuroPHP 7 - benvenuto al futuro
PHP 7 - benvenuto al futuro
 
From * to Symfony2
From * to Symfony2From * to Symfony2
From * to Symfony2
 
Service approach for development Rest API in Symfony2
Service approach for development Rest API in Symfony2Service approach for development Rest API in Symfony2
Service approach for development Rest API in Symfony2
 
Doctrine for Dummies
Doctrine for DummiesDoctrine for Dummies
Doctrine for Dummies
 
Symfony2 and AngularJS
Symfony2 and AngularJSSymfony2 and AngularJS
Symfony2 and AngularJS
 
Introduzione al linguaggio PHP
Introduzione al linguaggio PHPIntroduzione al linguaggio PHP
Introduzione al linguaggio PHP
 
PHP 7
PHP 7PHP 7
PHP 7
 
Last train to php 7
Last train to php 7Last train to php 7
Last train to php 7
 
Symfony Best Practices
Symfony Best Practices Symfony Best Practices
Symfony Best Practices
 
Introduction to PHP
Introduction to PHPIntroduction to PHP
Introduction to PHP
 
Introduction to PHP
Introduction to PHPIntroduction to PHP
Introduction to PHP
 

Similar to Gestione delle dipendenze con Composer

Pacchi e pacchetti
Pacchi e pacchettiPacchi e pacchetti
Pacchi e pacchettigiallu
 
Livin' with Docker - dallo sviluppo alla produzione
Livin' with Docker - dallo sviluppo alla produzioneLivin' with Docker - dallo sviluppo alla produzione
Livin' with Docker - dallo sviluppo alla produzionegiacomos
 
Apache Maven - Gestione di progetti Java e build automation
Apache Maven - Gestione di progetti Java e build automationApache Maven - Gestione di progetti Java e build automation
Apache Maven - Gestione di progetti Java e build automationTiziano Serritella
 
Task automation with grunt
Task automation with gruntTask automation with grunt
Task automation with gruntlucatume
 
Let's give it a GO!
Let's give it a GO!Let's give it a GO!
Let's give it a GO!MarioTraetta
 
Tanti "piccoli rilasci" con Symfony2
Tanti "piccoli rilasci" con Symfony2Tanti "piccoli rilasci" con Symfony2
Tanti "piccoli rilasci" con Symfony2Fabio Mora
 
Sviluppare un plugin WordPress da zero - WordCamp Bologna 2018
Sviluppare un plugin WordPress da zero - WordCamp Bologna 2018Sviluppare un plugin WordPress da zero - WordCamp Bologna 2018
Sviluppare un plugin WordPress da zero - WordCamp Bologna 2018Marco Chiesi
 
Buffer Overflow - Shellcode - Shatter Attack
Buffer Overflow - Shellcode - Shatter AttackBuffer Overflow - Shellcode - Shatter Attack
Buffer Overflow - Shellcode - Shatter Attackluigi capuzzello
 
Chi ha paura della command-line? - WordCamp Roma 2018
Chi ha paura della command-line? - WordCamp Roma 2018Chi ha paura della command-line? - WordCamp Roma 2018
Chi ha paura della command-line? - WordCamp Roma 2018Marco Chiesi
 
Linux Embedded per l'automazione
Linux Embedded per l'automazioneLinux Embedded per l'automazione
Linux Embedded per l'automazioneDaniele Costarella
 
Grunt: automazione per sviluppatori “pigri” - WordCamp Bari 2019
Grunt: automazione per sviluppatori “pigri” - WordCamp Bari 2019Grunt: automazione per sviluppatori “pigri” - WordCamp Bari 2019
Grunt: automazione per sviluppatori “pigri” - WordCamp Bari 2019Marco Chiesi
 

Similar to Gestione delle dipendenze con Composer (20)

TuxIsAlive
TuxIsAliveTuxIsAlive
TuxIsAlive
 
Pacchi e pacchetti
Pacchi e pacchettiPacchi e pacchetti
Pacchi e pacchetti
 
Idp, passo dopo passo!
Idp, passo dopo passo!Idp, passo dopo passo!
Idp, passo dopo passo!
 
Battaglia Navale
Battaglia NavaleBattaglia Navale
Battaglia Navale
 
introduzione a symfony 2
introduzione a symfony 2 introduzione a symfony 2
introduzione a symfony 2
 
Livin' with Docker - dallo sviluppo alla produzione
Livin' with Docker - dallo sviluppo alla produzioneLivin' with Docker - dallo sviluppo alla produzione
Livin' with Docker - dallo sviluppo alla produzione
 
Openmoko
OpenmokoOpenmoko
Openmoko
 
unreal IRCd 3281
unreal IRCd 3281unreal IRCd 3281
unreal IRCd 3281
 
Apache Maven - Gestione di progetti Java e build automation
Apache Maven - Gestione di progetti Java e build automationApache Maven - Gestione di progetti Java e build automation
Apache Maven - Gestione di progetti Java e build automation
 
Task automation with grunt
Task automation with gruntTask automation with grunt
Task automation with grunt
 
Let's give it a GO!
Let's give it a GO!Let's give it a GO!
Let's give it a GO!
 
Tanti "piccoli rilasci" con Symfony2
Tanti "piccoli rilasci" con Symfony2Tanti "piccoli rilasci" con Symfony2
Tanti "piccoli rilasci" con Symfony2
 
Sviluppare un plugin WordPress da zero - WordCamp Bologna 2018
Sviluppare un plugin WordPress da zero - WordCamp Bologna 2018Sviluppare un plugin WordPress da zero - WordCamp Bologna 2018
Sviluppare un plugin WordPress da zero - WordCamp Bologna 2018
 
GNU Linux Programming introduction
GNU Linux Programming introductionGNU Linux Programming introduction
GNU Linux Programming introduction
 
Buffer Overflow - Shellcode - Shatter Attack
Buffer Overflow - Shellcode - Shatter AttackBuffer Overflow - Shellcode - Shatter Attack
Buffer Overflow - Shellcode - Shatter Attack
 
TYPO3 CMS 9.1 - Le novità
TYPO3 CMS 9.1 - Le novitàTYPO3 CMS 9.1 - Le novità
TYPO3 CMS 9.1 - Le novità
 
Chi ha paura della command-line? - WordCamp Roma 2018
Chi ha paura della command-line? - WordCamp Roma 2018Chi ha paura della command-line? - WordCamp Roma 2018
Chi ha paura della command-line? - WordCamp Roma 2018
 
Linux Embedded per l'automazione
Linux Embedded per l'automazioneLinux Embedded per l'automazione
Linux Embedded per l'automazione
 
Bash intro
Bash introBash intro
Bash intro
 
Grunt: automazione per sviluppatori “pigri” - WordCamp Bari 2019
Grunt: automazione per sviluppatori “pigri” - WordCamp Bari 2019Grunt: automazione per sviluppatori “pigri” - WordCamp Bari 2019
Grunt: automazione per sviluppatori “pigri” - WordCamp Bari 2019
 

More from Massimiliano Arione

Typed models pug roma febbraio 2020
Typed models   pug roma febbraio 2020Typed models   pug roma febbraio 2020
Typed models pug roma febbraio 2020Massimiliano Arione
 
Disinstallare fos user bundle e vivere felici
Disinstallare fos user bundle e vivere feliciDisinstallare fos user bundle e vivere felici
Disinstallare fos user bundle e vivere feliciMassimiliano Arione
 
Scrivere e leggere log con elastic
Scrivere e leggere log con elasticScrivere e leggere log con elastic
Scrivere e leggere log con elasticMassimiliano Arione
 
Managing frontend libs in your Symfony project
Managing frontend libs in your Symfony projectManaging frontend libs in your Symfony project
Managing frontend libs in your Symfony projectMassimiliano Arione
 
Managing frontend libs in your php project
Managing frontend libs in your php projectManaging frontend libs in your php project
Managing frontend libs in your php projectMassimiliano Arione
 
Gestire librerie di frontend in php
Gestire librerie di frontend in phpGestire librerie di frontend in php
Gestire librerie di frontend in phpMassimiliano Arione
 
Symfony: un framework per il web
Symfony: un framework per il webSymfony: un framework per il web
Symfony: un framework per il webMassimiliano Arione
 
Sviluppo rapido di applicazioni con PHP
Sviluppo rapido di applicazioni con PHPSviluppo rapido di applicazioni con PHP
Sviluppo rapido di applicazioni con PHPMassimiliano Arione
 

More from Massimiliano Arione (20)

Typed models pug roma febbraio 2020
Typed models   pug roma febbraio 2020Typed models   pug roma febbraio 2020
Typed models pug roma febbraio 2020
 
Pipelines!
Pipelines! Pipelines!
Pipelines!
 
Il nostro amico Stan
Il nostro amico Stan   Il nostro amico Stan
Il nostro amico Stan
 
PSR7 - interoperabilità HTTP
PSR7 - interoperabilità HTTPPSR7 - interoperabilità HTTP
PSR7 - interoperabilità HTTP
 
Disinstallare fos user bundle e vivere felici
Disinstallare fos user bundle e vivere feliciDisinstallare fos user bundle e vivere felici
Disinstallare fos user bundle e vivere felici
 
MAGA - PUG Roma giugno 2017
MAGA - PUG Roma giugno 2017MAGA - PUG Roma giugno 2017
MAGA - PUG Roma giugno 2017
 
PHP7 e Rich Domain Model
PHP7 e Rich Domain ModelPHP7 e Rich Domain Model
PHP7 e Rich Domain Model
 
PHP on the desktop
PHP on the desktopPHP on the desktop
PHP on the desktop
 
Scrivere e leggere log con elastic
Scrivere e leggere log con elasticScrivere e leggere log con elastic
Scrivere e leggere log con elastic
 
The metrics
The metricsThe metrics
The metrics
 
Managing frontend libs in your Symfony project
Managing frontend libs in your Symfony projectManaging frontend libs in your Symfony project
Managing frontend libs in your Symfony project
 
Translating symfony docs
Translating symfony docsTranslating symfony docs
Translating symfony docs
 
Managing frontend libs in your php project
Managing frontend libs in your php projectManaging frontend libs in your php project
Managing frontend libs in your php project
 
Gestire librerie di frontend in php
Gestire librerie di frontend in phpGestire librerie di frontend in php
Gestire librerie di frontend in php
 
Migrare da symfony 1 a Symfony2
 Migrare da symfony 1 a Symfony2  Migrare da symfony 1 a Symfony2
Migrare da symfony 1 a Symfony2
 
Case study OmniAuto.it
Case study OmniAuto.itCase study OmniAuto.it
Case study OmniAuto.it
 
Symfony: un framework per il web
Symfony: un framework per il webSymfony: un framework per il web
Symfony: un framework per il web
 
Paypal + symfony
Paypal + symfonyPaypal + symfony
Paypal + symfony
 
Sviluppo rapido di applicazioni con PHP
Sviluppo rapido di applicazioni con PHPSviluppo rapido di applicazioni con PHP
Sviluppo rapido di applicazioni con PHP
 
symfony & jQuery (phpDay)
symfony & jQuery (phpDay)symfony & jQuery (phpDay)
symfony & jQuery (phpDay)
 

Gestione delle dipendenze con Composer