0
Shifting gears withComposer                 Javier Lopez (@loalf)
Who am I?
Who am I?• I am from Spain
Who am I?• I am from Spain• I live in London
Who am I?• I am from Spain• I live in London• I work for IPC Media
Who am I?• I am from Spain• I live in London• I work for IPC Media• I tweet as @loalf
Who am I?• I am from Spain• I live in London• I work for IPC Media• I tweet as @loalf• I co-organize DeSymfony (www.desymf...
Who am I?• I am from Spain• I live in London• I work for IPC Media• I tweet as @loalf• I co-organize DeSymfony (www.desymf...
Shifting gearshttp://www.flickr.com/photos/jayshep5/5792259218/
My App
My App
My App
My App
My App
Composer is a tool for dependency management in PHP.It allows you to declare the dependent libraries your project needs an...
Is it a new concept?
Is it a new concept? Nope.
Is it a new concept? Nope.Node Package Manager
Is it a new concept? Nope.Node Package Manager                  Ruby Package Manager
But, what about PEAR?
But, what about PEAR?• You have to install it in all the system
But, what about PEAR?• You have to install it in all the system• You can´t see the source code
But, what about PEAR?• You have to install it in all the system• You can´t see the source code• Don´t allow different repo...
But, what about PEAR?• You have to install it in all the system• You can´t see the source code• Don´t allow different repo...
Installing Composer (locally)
Installing Composer (locally)mkdir myprojectname
Installing Composer (locally)mkdir myprojectnamecd myprojectname
Installing Composer (locally)mkdir myprojectnamecd myprojectnamecurl -s https://getcomposer.org/installer | php
Installing Composer (locally)mkdir myprojectnamecd myprojectnamecurl -s https://getcomposer.org/installer | php           ...
// composer.json{  "require" : {     "monolog/monolog" : "1.0.*",     "symfony/translation" : "2.1.0-RC1",     "behat/beha...
// composer.json{  "require" : {     "monolog/monolog" : "1.0.*",     "symfony/translation" : "2.1.0-RC1",     "behat/beha...
// composer.json{  "require" : {     "monolog/monolog" : "1.0.*",     "symfony/translation" : "2.1.0-RC1",     "behat/beha...
// composer.json{  "require" : {     "monolog/monolog" : "1.0.*",     "symfony/translation" : "2.1.0-RC1",     "behat/beha...
// composer.json{  "require" : {     "monolog/monolog" : "1.0.*",     "symfony/translation" : "2.1.0-RC1",     "behat/beha...
// composer.json{  "require" : {     "monolog/monolog" : "1.0.*",     "symfony/translation" : "2.1.0-RC1",     "behat/beha...
// composer.json{  "require" : {     "monolog/monolog" : "1.0.*",     "symfony/translation" : "2.1.0-RC1",     "behat/beha...
// composer.json{  "require" : {     "monolog/monolog" : "1.0.*",     "symfony/translation" : "2.1.0-RC1",     "behat/beha...
// composer.json{  "require" : {     "monolog/monolog" : "1.0.*",     "symfony/translation" : "2.1.0-RC1",     "behat/beha...
// composer.json{  "require" : {     "monolog/monolog" : "1.0.*",     "symfony/translation" : "2.1.0-RC1",     "behat/beha...
// composer.json{  "require" : {     "monolog/monolog" : "1.0.*",     "symfony/translation" : "2.1.0-RC1",     "behat/beha...
// composer.json{  "require" : {     "monolog/monolog" : "1.0.*",     "symfony/translation" : "2.1.0-RC1",     "behat/beha...
// composer.json{  "require" : {     "monolog/monolog" : "1.0.*",     "symfony/translation" : "2.1.0-RC1",     "behat/beha...
// composer.json{  "require" : {     "monolog/monolog" : "1.0.*",     "symfony/translation" : "2.1.0-RC1",     "behat/beha...
// composer.json{  "require" : {     "monolog/monolog" : "1.0.*",     "symfony/translation" : "2.1.0-RC1",     "behat/beha...
// composer.json{  "require" : {     "monolog/monolog" : "1.0.*",     "symfony/translation" : "2.1.0-RC1",     "behat/beha...
// composer.json{  "require" : {     "monolog/monolog" : "1.0.*",     "symfony/translation" : "2.1.0-RC1",     "behat/beha...
php composer.phar install
Installing dependencies  - Installing guzzle/parser (v2.8.4)    Downloading: 100%  - Installing symfony/event-dispatcher (...
!"" composer.json!"" composer.lock#"" vendor    !"" autoload.php    !"" behat    !"" bin    !"" composer    !"" fabpot    ...
!"" composer.json!"" composer.lock#"" vendor    !"" autoload.php    !"" behat    !"" bin    !"" composer    !"" fabpot    ...
!"" composer.json!"" composer.lock#"" vendor    !"" autoload.php    !"" behat    !"" bin    !"" composer    !"" fabpot    ...
!"" composer.json!"" composer.lock#"" vendor    !"" autoload.php    !"" behat    !"" bin    !"" composer    !"" fabpot    ...
!"" composer.json!"" composer.lock#"" vendor    !"" autoload.php    !"" behat    !"" bin    !"" composer    !"" fabpot    ...
!"" composer.json!"" composer.lock#"" vendor    !"" autoload.php    !"" behat    !"" bin    !"" composer    !"" fabpot    ...
!"" composer.json!"" composer.lock#"" vendor    !"" autoload.php    !"" behat    !"" bin    !"" composer    !"" fabpot    ...
!"" composer.json!"" composer.lock#"" vendor    !"" autoload.php    !"" behat    !"" bin    !"" composer    !"" fabpot    ...
!"" composer.json!"" composer.lock#"" vendor    !"" autoload.php    !"" behat    !"" bin    !"" composer    !"" fabpot    ...
!"" composer.json!"" composer.lock#"" vendor    !"" autoload.php    !"" behat    !"" bin    !"" composer    !"" fabpot    ...
!"" composer.json!"" composer.lock#"" vendor    !"" autoload.php    !"" behat    !"" bin    !"" composer    !"" fabpot    ...
!"" composer.json!"" composer.lock#"" vendor    !"" autoload.php    !"" behat    !"" bin    !"" composer    !"" fabpot    ...
!"" composer.json!"" composer.lock#"" vendor    !"" autoload.php    !"" behat    !"" bin    !"" composer    !"" fabpot    ...
http://www.packagist.org             http://www.flickr.com/photos/jayshep5/5792259218/
http://www.flickr.com/photos/jayshep5/5792259218/
http://www.flickr.com/photos/jayshep5/5792259218/
// composer.josn{    "name": "monolog/monolog",    "require": {        "php": ">=5.3.0"    },}
// composer.josn{    "name": "monolog/monolog",    "require": {        "php": ">=5.3.0"    },}
// composer.josn{    "name": "monolog/monolog",    "require": {        "php": ">=5.3.0"    },}
// composer.josn{    "name": "monolog/monolog",    "require": {        "php": ">=5.3.0"    },}
// composer.josn{    "name": "monolog/monolog",    "require": {        "php": ">=5.3.0"    },}
// composer.josn{    "name": "monolog/monolog",    "type": "library",    "description": "Logging for PHP 5.3",    "keyword...
// composer.josn{    "name": "monolog/monolog",    "type": "library",    "description": "Logging for PHP 5.3",    "keyword...
// composer.josn{    "name": "monolog/monolog",    "type": "library",    "description": "Logging for PHP 5.3",    "keyword...
// composer.josn{    "name": "monolog/monolog",    "type": "library",    "description": "Logging for PHP 5.3",    "keyword...
// composer.josn{    "name": "monolog/monolog",    "type": "library",    "description": "Logging for PHP 5.3",    "keyword...
// composer.josn{    "name": "monolog/monolog",    "type": "library",    "description": "Logging for PHP 5.3",    "keyword...
// composer.josn{    "name": "monolog/monolog",    "type": "library",    "description": "Logging for PHP 5.3",    "keyword...
// composer.josn{    "name": "monolog/monolog",    "type": "library",    "description": "Logging for PHP 5.3",    "keyword...
// composer.josn{    "name": "monolog/monolog",    "type": "library",    "description": "Logging for PHP 5.3",    "keyword...
// composer.josn{    "name": "monolog/monolog",    "type": "library",    "description": "Logging for PHP 5.3",    "keyword...
// composer.josn{    "name": "monolog/monolog",    "type": "library",    "description": "Logging for PHP 5.3",    "keyword...
// composer.josn{    "name": "monolog/monolog",    "type": "library",    "description": "Logging for PHP 5.3",    "keyword...
// composer.josn{    "name": "monolog/monolog",    "type": "library",    "description": "Logging for PHP 5.3",    "keyword...
// composer.josn{    "name": "monolog/monolog",    "type": "library",    "description": "Logging for PHP 5.3",    "keyword...
// composer.josn{    "name": "monolog/monolog",    "type": "library",    "description": "Logging for PHP 5.3",    "keyword...
// composer.josn{    "name": "monolog/monolog",    [ ... ]    "autoload": {        "psr-0": {            "Monolog": ["src"...
// composer.josn{    "name": "monolog/monolog",    [ ... ]    "autoload": {        "classmap": ["src", "lib"]    }}
// composer.josn{    "name": "monolog/monolog",    [ ... ]    "autoload": {        "files": "src/myfunctions.php"    }}
Excuse #1I need to use a patched version ofSymfony
// composer.json{  "repositories": [     {       "type" : "cvs",       "url" : "http://github.com/loalf/symfony"     }  ],...
// composer.json{  "repositories": [     {       "type" : "cvs",       "url" : "http://github.com/loalf/symfony"     }  ],...
// composer.json{  "repositories": [     {       "type" : "cvs",       "url" : "http://github.com/loalf/symfony"     }  ],...
// composer.json{  "repositories": [     {       "type" : "cvs",       "url" : "http://github.com/loalf/symfony"     }  ],...
// composer.json{  "repositories": [     {       "type" : "cvs",       "url" : "http://github.com/loalf/symfony"     }  ],...
// composer.json{  "repositories": [     {       "type" : "cvs",       "url" : "http://github.com/loalf/symfony"     }  ],...
// composer.json{  "repositories": [     {       "type" : "cvs",       "url" : "http://github.com/loalf/symfony"     }  ],...
// composer.json{  "repositories": [     {       "type" : "cvs",       "url" : "http://github.com/loalf/symfony"     }  ],...
// composer.json{  "repositories": [     {       "type" : "cvs",       "url" : "http://github.com/loalf/symfony"     }  ],...
Excuse #2Some dependecies are in my ownprivate SVN repo
// composer.json{  "repositories": [     {       "type" : "cvs",       "url" : "svn://company.com/lib"     }  ],  "require...
// composer.json{  "repositories": [     {       "type" : "cvs",       "url" : "svn://company.com/lib"     }  ],  "require...
// composer.json{  "repositories": [     {       "type" : "cvs",       "url" : "svn://company.com/lib"     }  ],  "require...
// composer.json{  "repositories": [     {       "type" : "cvs",       "url" : "svn://company.com/lib"     }  ],  "require...
// composer.json{  "repositories": [     {       "type" : "cvs",       "url" : "svn://company.com/lib"     }  ],  "require...
// composer.json{  "repositories": [     {       "type" : "cvs",       "url" : "svn://company.com/lib"     }  ],  "require...
// composer.json{  "repositories": [     {       "type" : "cvs",       "url" : "svn://company.com/lib"     }  ],  "require...
// composer.json{  "repositories": [     {       "type" : "cvs",       "url" : "svn://company.com/lib"     }  ],  "require...
// composer.json{  "repositories": [     {       "type" : "cvs",       "url" : "svn://company.com/lib"     }  ],  "require...
Excuse #3I am using PEAR, you said I coulduse PEAR
// composer.json{  "repositories": [     {       "type" : "pear",       "url" : "http://pear2.php.net"     }  ],  "require...
// composer.json{  "repositories": [     {       "type" : "pear",       "url" : "http://pear2.php.net"     }  ],  "require...
// composer.json{  "repositories": [     {       "type" : "pear",       "url" : "http://pear2.php.net"     }  ],  "require...
// composer.json{  "repositories": [     {       "type" : "pear",       "url" : "http://pear2.php.net"     }  ],  "require...
// composer.json{  "repositories": [     {       "type" : "pear",       "url" : "http://pear2.php.net"     }  ],  "require...
// composer.json{  "repositories": [     {       "type" : "pear",       "url" : "http://pear2.php.net"     }  ],  "require...
// composer.json{  "repositories": [     {       "type" : "pear",       "url" : "http://pear2.php.net"     }  ],  "require...
// composer.json{  "repositories": [     {       "type" : "pear",       "url" : "http://pear2.php.net"     }  ],  "require...
// composer.json{  "repositories": [     {       "type" : "pear",       "url" : "http://pear2.php.net"     }  ],  "require...
Excuse #4My origin doesn´t have acomposer.json file
// composer.json{  "repositories" : [     {       "type": "package",       "package": {         "name": "jquery/jquery",  ...
// composer.json{  "repositories" : [     {       "type": "package",       "package": {         "name": "jquery/jquery",  ...
// composer.json{  "repositories" : [     {       "type": "package",       "package": {         "name": "jquery/jquery",  ...
// composer.json{  "repositories" : [     {       "type": "package",       "package": {         "name": "jquery/jquery",  ...
// composer.json{  "repositories" : [     {       "type": "package",       "package": {         "name": "jquery/jquery",  ...
// composer.json{  "repositories" : [     {       "type": "package",       "package": {         "name": "jquery/jquery",  ...
// composer.json{  "repositories" : [     {       "type": "package",       "package": {         "name": "jquery/jquery",  ...
// composer.json{  "repositories" : [     {       "type": "package",       "package": {         "name": "jquery/jquery",  ...
// composer.json{  "repositories" : [     {       "type": "package",       "package": {         "name": "jquery/jquery",  ...
// composer.json{  "repositories" : [     {       "type": "package",       "package": {         "name": "jquery/jquery",  ...
// composer.json{  "repositories" : [     {       "type": "package",       "package": {         "name": "jquery/jquery",  ...
Excuse #5I need a private packagerepository, but Packagist is toodemanding
Satishttp://getcomposer.org/doc/articles/handling-private-              packages-with-satis.md
Reasons to   composer
1200     250watchs   forks
2703                                                                                  2418                         2703   ...
2703                                                                                  2418                         2703   ...
+2.5 mill packages installed                   since 2012-04-13
Resources
Resources• getcomposer.org
Resources• getcomposer.org• packagist.org
Resources• getcomposer.org• packagist.org• github.com/composer
Thanks! Questions?              Javier Lopez (@loalf)
Shifting gears with Composer
Shifting gears with Composer
Shifting gears with Composer
Shifting gears with Composer
Shifting gears with Composer
Shifting gears with Composer
Shifting gears with Composer
Upcoming SlideShare
Loading in...5
×

Shifting gears with Composer

1,358

Published on

Published in: Technology, Business
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
1,358
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
9
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

Transcript of "Shifting gears with Composer"

  1. 1. Shifting gears withComposer Javier Lopez (@loalf)
  2. 2. Who am I?
  3. 3. Who am I?• I am from Spain
  4. 4. Who am I?• I am from Spain• I live in London
  5. 5. Who am I?• I am from Spain• I live in London• I work for IPC Media
  6. 6. Who am I?• I am from Spain• I live in London• I work for IPC Media• I tweet as @loalf
  7. 7. Who am I?• I am from Spain• I live in London• I work for IPC Media• I tweet as @loalf• I co-organize DeSymfony (www.desymfony.com)
  8. 8. Who am I?• I am from Spain• I live in London• I work for IPC Media• I tweet as @loalf• I co-organize DeSymfony (www.desymfony.com) Still want to know more? http://www.linkedin.com/in/loalf
  9. 9. Shifting gearshttp://www.flickr.com/photos/jayshep5/5792259218/
  10. 10. My App
  11. 11. My App
  12. 12. My App
  13. 13. My App
  14. 14. My App
  15. 15. Composer is a tool for dependency management in PHP.It allows you to declare the dependent libraries your project needs and it will install them in your project for you.
  16. 16. Is it a new concept?
  17. 17. Is it a new concept? Nope.
  18. 18. Is it a new concept? Nope.Node Package Manager
  19. 19. Is it a new concept? Nope.Node Package Manager Ruby Package Manager
  20. 20. But, what about PEAR?
  21. 21. But, what about PEAR?• You have to install it in all the system
  22. 22. But, what about PEAR?• You have to install it in all the system• You can´t see the source code
  23. 23. But, what about PEAR?• You have to install it in all the system• You can´t see the source code• Don´t allow different repository sources
  24. 24. But, what about PEAR?• You have to install it in all the system• You can´t see the source code• Don´t allow different repository sources• Composer is compatible with PEAR, :)
  25. 25. Installing Composer (locally)
  26. 26. Installing Composer (locally)mkdir myprojectname
  27. 27. Installing Composer (locally)mkdir myprojectnamecd myprojectname
  28. 28. Installing Composer (locally)mkdir myprojectnamecd myprojectnamecurl -s https://getcomposer.org/installer | php
  29. 29. Installing Composer (locally)mkdir myprojectnamecd myprojectnamecurl -s https://getcomposer.org/installer | php Done!
  30. 30. // composer.json{ "require" : { "monolog/monolog" : "1.0.*", "symfony/translation" : "2.1.0-RC1", "behat/behat" : ">2.3.5,<2.4", "fabpot/goutte" : "dev-master" }, "minimum-stability": "dev"}
  31. 31. // composer.json{ "require" : { "monolog/monolog" : "1.0.*", "symfony/translation" : "2.1.0-RC1", "behat/behat" : ">2.3.5,<2.4", "fabpot/goutte" : "dev-master" }, "minimum-stability": "dev"}
  32. 32. // composer.json{ "require" : { "monolog/monolog" : "1.0.*", "symfony/translation" : "2.1.0-RC1", "behat/behat" : ">2.3.5,<2.4", "fabpot/goutte" : "dev-master" }, "minimum-stability": "dev"}
  33. 33. // composer.json{ "require" : { "monolog/monolog" : "1.0.*", "symfony/translation" : "2.1.0-RC1", "behat/behat" : ">2.3.5,<2.4", "fabpot/goutte" : "dev-master" }, "minimum-stability": "dev"}
  34. 34. // composer.json{ "require" : { "monolog/monolog" : "1.0.*", "symfony/translation" : "2.1.0-RC1", "behat/behat" : ">2.3.5,<2.4", "fabpot/goutte" : "dev-master" }, "minimum-stability": "dev"}
  35. 35. // composer.json{ "require" : { "monolog/monolog" : "1.0.*", "symfony/translation" : "2.1.0-RC1", "behat/behat" : ">2.3.5,<2.4", "fabpot/goutte" : "dev-master" }, "minimum-stability": "dev"}
  36. 36. // composer.json{ "require" : { "monolog/monolog" : "1.0.*", "symfony/translation" : "2.1.0-RC1", "behat/behat" : ">2.3.5,<2.4", "fabpot/goutte" : "dev-master" }, "minimum-stability": "dev"}
  37. 37. // composer.json{ "require" : { "monolog/monolog" : "1.0.*", "symfony/translation" : "2.1.0-RC1", "behat/behat" : ">2.3.5,<2.4", "fabpot/goutte" : "dev-master" }, "minimum-stability": "dev"}
  38. 38. // composer.json{ "require" : { "monolog/monolog" : "1.0.*", "symfony/translation" : "2.1.0-RC1", "behat/behat" : ">2.3.5,<2.4", "fabpot/goutte" : "dev-master" }, "minimum-stability": "dev"}
  39. 39. // composer.json{ "require" : { "monolog/monolog" : "1.0.*", "symfony/translation" : "2.1.0-RC1", "behat/behat" : ">2.3.5,<2.4", "fabpot/goutte" : "dev-master" }, "minimum-stability": "dev"}
  40. 40. // composer.json{ "require" : { "monolog/monolog" : "1.0.*", "symfony/translation" : "2.1.0-RC1", "behat/behat" : ">2.3.5,<2.4", "fabpot/goutte" : "dev-master" }, "minimum-stability": "dev"}
  41. 41. // composer.json{ "require" : { "monolog/monolog" : "1.0.*", "symfony/translation" : "2.1.0-RC1", "behat/behat" : ">2.3.5,<2.4", "fabpot/goutte" : "dev-master" }, "minimum-stability": "dev"}
  42. 42. // composer.json{ "require" : { "monolog/monolog" : "1.0.*", "symfony/translation" : "2.1.0-RC1", "behat/behat" : ">2.3.5,<2.4", "fabpot/goutte" : "dev-master" }, "minimum-stability": "dev"}
  43. 43. // composer.json{ "require" : { "monolog/monolog" : "1.0.*", "symfony/translation" : "2.1.0-RC1", "behat/behat" : ">2.3.5,<2.4", "fabpot/goutte" : "dev-master" }, "minimum-stability": "dev"}
  44. 44. // composer.json{ "require" : { "monolog/monolog" : "1.0.*", "symfony/translation" : "2.1.0-RC1", "behat/behat" : ">2.3.5,<2.4", "fabpot/goutte" : "dev-master" }, "minimum-stability": "dev"}
  45. 45. // composer.json{ "require" : { "monolog/monolog" : "1.0.*", "symfony/translation" : "2.1.0-RC1", "behat/behat" : ">2.3.5,<2.4", "fabpot/goutte" : "dev-master" }, "minimum-stability": "dev"}
  46. 46. // composer.json{ "require" : { "monolog/monolog" : "1.0.*", "symfony/translation" : "2.1.0-RC1", "behat/behat" : ">2.3.5,<2.4", "fabpot/goutte" : "dev-master" }, "minimum-stability": "dev"}
  47. 47. php composer.phar install
  48. 48. Installing dependencies - Installing guzzle/parser (v2.8.4) Downloading: 100% - Installing symfony/event-dispatcher (dev-master) Cloning v2.1.0-BETA4 - Installing guzzle/common (v2.8.4) Downloading: 100% - Installing guzzle/http (v2.8.4) Downloading: 100% - Installing symfony/process (dev-master) Cloning v2.1.0-RC1 - Installing symfony/finder (dev-master) Cloning 1af11ab3a686f9c45f2a8d9d721d5717cdd5f1d6
  49. 49. !"" composer.json!"" composer.lock#"" vendor !"" autoload.php !"" behat !"" bin !"" composer !"" fabpot !"" guzzle !"" monolog #"" symfony
  50. 50. !"" composer.json!"" composer.lock#"" vendor !"" autoload.php !"" behat !"" bin !"" composer !"" fabpot !"" guzzle !"" monolog #"" symfony
  51. 51. !"" composer.json!"" composer.lock#"" vendor !"" autoload.php !"" behat !"" bin !"" composer !"" fabpot !"" guzzle !"" monolog #"" symfony
  52. 52. !"" composer.json!"" composer.lock#"" vendor !"" autoload.php !"" behat !"" bin !"" composer !"" fabpot !"" guzzle !"" monolog #"" symfony
  53. 53. !"" composer.json!"" composer.lock#"" vendor !"" autoload.php !"" behat !"" bin !"" composer !"" fabpot !"" guzzle !"" monolog #"" symfony
  54. 54. !"" composer.json!"" composer.lock#"" vendor !"" autoload.php !"" behat !"" bin !"" composer !"" fabpot !"" guzzle !"" monolog #"" symfony
  55. 55. !"" composer.json!"" composer.lock#"" vendor !"" autoload.php !"" behat !"" bin !"" composer !"" fabpot !"" guzzle !"" monolog #"" symfony
  56. 56. !"" composer.json!"" composer.lock#"" vendor !"" autoload.php !"" behat !"" bin !"" composer !"" fabpot !"" guzzle !"" monolog #"" symfony
  57. 57. !"" composer.json!"" composer.lock#"" vendor !"" autoload.php !"" behat !"" bin !"" composer !"" fabpot !"" guzzle !"" monolog #"" symfony
  58. 58. !"" composer.json!"" composer.lock#"" vendor !"" autoload.php !"" behat !"" bin !"" composer !"" fabpot !"" guzzle !"" monolog #"" symfony
  59. 59. !"" composer.json!"" composer.lock#"" vendor !"" autoload.php !"" behat !"" bin !"" composer !"" fabpot !"" guzzle !"" monolog #"" symfony
  60. 60. !"" composer.json!"" composer.lock#"" vendor !"" autoload.php !"" behat !"" bin !"" composer !"" fabpot !"" guzzle !"" monolog #"" symfony
  61. 61. !"" composer.json!"" composer.lock#"" vendor !"" autoload.php !"" behat !"" bin !"" composer !"" fabpot !"" guzzle !"" monolog #"" symfony
  62. 62. http://www.packagist.org http://www.flickr.com/photos/jayshep5/5792259218/
  63. 63. http://www.flickr.com/photos/jayshep5/5792259218/
  64. 64. http://www.flickr.com/photos/jayshep5/5792259218/
  65. 65. // composer.josn{ "name": "monolog/monolog", "require": { "php": ">=5.3.0" },}
  66. 66. // composer.josn{ "name": "monolog/monolog", "require": { "php": ">=5.3.0" },}
  67. 67. // composer.josn{ "name": "monolog/monolog", "require": { "php": ">=5.3.0" },}
  68. 68. // composer.josn{ "name": "monolog/monolog", "require": { "php": ">=5.3.0" },}
  69. 69. // composer.josn{ "name": "monolog/monolog", "require": { "php": ">=5.3.0" },}
  70. 70. // composer.josn{ "name": "monolog/monolog", "type": "library", "description": "Logging for PHP 5.3", "keywords": ["log","logging"], "homepage": "http://github.com/Seldaek/monolog", "license": "MIT", "authors": [ { "name": "Jordi Boggiano", "email": "j.boggiano@seld.be", "homepage": "http://seld.be", "role": "Developer" } ], "require": { "php": ">=5.3.0" }, "autoload": { "psr-0": { "Monolog": "src" } }}
  71. 71. // composer.josn{ "name": "monolog/monolog", "type": "library", "description": "Logging for PHP 5.3", "keywords": ["log","logging"], "homepage": "http://github.com/Seldaek/monolog", "license": "MIT", "authors": [ { "name": "Jordi Boggiano", "email": "j.boggiano@seld.be", "homepage": "http://seld.be", "role": "Developer" } ], "require": { "php": ">=5.3.0" }, "autoload": { "psr-0": { "Monolog": "src" } }}
  72. 72. // composer.josn{ "name": "monolog/monolog", "type": "library", "description": "Logging for PHP 5.3", "keywords": ["log","logging"], "homepage": "http://github.com/Seldaek/monolog", "license": "MIT", "authors": [ { "name": "Jordi Boggiano", "email": "j.boggiano@seld.be", "homepage": "http://seld.be", "role": "Developer" } ], "require": { "php": ">=5.3.0" }, "autoload": { "psr-0": { "Monolog": "src" } }}
  73. 73. // composer.josn{ "name": "monolog/monolog", "type": "library", "description": "Logging for PHP 5.3", "keywords": ["log","logging"], "homepage": "http://github.com/Seldaek/monolog", "license": "MIT", "authors": [ { "name": "Jordi Boggiano", "email": "j.boggiano@seld.be", "homepage": "http://seld.be", "role": "Developer" } ], "require": { "php": ">=5.3.0" }, "autoload": { "psr-0": { "Monolog": "src" } }}
  74. 74. // composer.josn{ "name": "monolog/monolog", "type": "library", "description": "Logging for PHP 5.3", "keywords": ["log","logging"], "homepage": "http://github.com/Seldaek/monolog", "license": "MIT", "authors": [ { "name": "Jordi Boggiano", "email": "j.boggiano@seld.be", "homepage": "http://seld.be", "role": "Developer" } ], "require": { "php": ">=5.3.0" }, "autoload": { "psr-0": { "Monolog": "src" } }}
  75. 75. // composer.josn{ "name": "monolog/monolog", "type": "library", "description": "Logging for PHP 5.3", "keywords": ["log","logging"], "homepage": "http://github.com/Seldaek/monolog", "license": "MIT", "authors": [ { "name": "Jordi Boggiano", "email": "j.boggiano@seld.be", "homepage": "http://seld.be", "role": "Developer" } ], "require": { "php": ">=5.3.0" }, "autoload": { "psr-0": { "Monolog": "src" } }}
  76. 76. // composer.josn{ "name": "monolog/monolog", "type": "library", "description": "Logging for PHP 5.3", "keywords": ["log","logging"], "homepage": "http://github.com/Seldaek/monolog", "license": "MIT", "authors": [ { "name": "Jordi Boggiano", "email": "j.boggiano@seld.be", "homepage": "http://seld.be", "role": "Developer" } ], "require": { "php": ">=5.3.0" }, "autoload": { "psr-0": { "Monolog": "src" } }}
  77. 77. // composer.josn{ "name": "monolog/monolog", "type": "library", "description": "Logging for PHP 5.3", "keywords": ["log","logging"], "homepage": "http://github.com/Seldaek/monolog", "license": "MIT", "authors": [ { "name": "Jordi Boggiano", "email": "j.boggiano@seld.be", "homepage": "http://seld.be", "role": "Developer" } ], "require": { "php": ">=5.3.0" }, "autoload": { "psr-0": { "Monolog": "src" } }}
  78. 78. // composer.josn{ "name": "monolog/monolog", "type": "library", "description": "Logging for PHP 5.3", "keywords": ["log","logging"], "homepage": "http://github.com/Seldaek/monolog", "license": "MIT", "authors": [ { "name": "Jordi Boggiano", "email": "j.boggiano@seld.be", "homepage": "http://seld.be", "role": "Developer" } ], "require": { "php": ">=5.3.0" }, "autoload": { "psr-0": { "Monolog": "src" } }}
  79. 79. // composer.josn{ "name": "monolog/monolog", "type": "library", "description": "Logging for PHP 5.3", "keywords": ["log","logging"], "homepage": "http://github.com/Seldaek/monolog", "license": "MIT", "authors": [ { "name": "Jordi Boggiano", "email": "j.boggiano@seld.be", "homepage": "http://seld.be", "role": "Developer" } ], "require": { "php": ">=5.3.0" }, "autoload": { "psr-0": { "Monolog": "src" } }}
  80. 80. // composer.josn{ "name": "monolog/monolog", "type": "library", "description": "Logging for PHP 5.3", "keywords": ["log","logging"], "homepage": "http://github.com/Seldaek/monolog", "license": "MIT", "authors": [ { "name": "Jordi Boggiano", "email": "j.boggiano@seld.be", "homepage": "http://seld.be", "role": "Developer" } ], "require": { "php": ">=5.3.0" }, "autoload": { "psr-0": { "Monolog": "src" } }}
  81. 81. // composer.josn{ "name": "monolog/monolog", "type": "library", "description": "Logging for PHP 5.3", "keywords": ["log","logging"], "homepage": "http://github.com/Seldaek/monolog", "license": "MIT", "authors": [ { "name": "Jordi Boggiano", "email": "j.boggiano@seld.be", "homepage": "http://seld.be", "role": "Developer" } ], "require": { "php": ">=5.3.0" }, "autoload": { "psr-0": { "Monolog": "src" } }}
  82. 82. // composer.josn{ "name": "monolog/monolog", "type": "library", "description": "Logging for PHP 5.3", "keywords": ["log","logging"], "homepage": "http://github.com/Seldaek/monolog", "license": "MIT", "authors": [ { "name": "Jordi Boggiano", "email": "j.boggiano@seld.be", "homepage": "http://seld.be", "role": "Developer" } ], "require": { "php": ">=5.3.0" }, "autoload": { "psr-0": { "Monolog": "src" } }}
  83. 83. // composer.josn{ "name": "monolog/monolog", "type": "library", "description": "Logging for PHP 5.3", "keywords": ["log","logging"], "homepage": "http://github.com/Seldaek/monolog", "license": "MIT", "authors": [ { "name": "Jordi Boggiano", "email": "j.boggiano@seld.be", "homepage": "http://seld.be", "role": "Developer" } ], "require": { "php": ">=5.3.0" }, "autoload": { "psr-0": { "Monolog": "src" } }}
  84. 84. // composer.josn{ "name": "monolog/monolog", "type": "library", "description": "Logging for PHP 5.3", "keywords": ["log","logging"], "homepage": "http://github.com/Seldaek/monolog", "license": "MIT", "authors": [ { "name": "Jordi Boggiano", "email": "j.boggiano@seld.be", "homepage": "http://seld.be", "role": "Developer" } ], "require": { "php": ">=5.3.0" }, "autoload": { "psr-0": { "Monolog": "src" } }}
  85. 85. // composer.josn{ "name": "monolog/monolog", [ ... ] "autoload": { "psr-0": { "Monolog": ["src", "lib"] } }}
  86. 86. // composer.josn{ "name": "monolog/monolog", [ ... ] "autoload": { "classmap": ["src", "lib"] }}
  87. 87. // composer.josn{ "name": "monolog/monolog", [ ... ] "autoload": { "files": "src/myfunctions.php" }}
  88. 88. Excuse #1I need to use a patched version ofSymfony
  89. 89. // composer.json{ "repositories": [ { "type" : "cvs", "url" : "http://github.com/loalf/symfony" } ], "require": { "symfony/symfony" : "dev-patch2" }}
  90. 90. // composer.json{ "repositories": [ { "type" : "cvs", "url" : "http://github.com/loalf/symfony" } ], "require": { "symfony/symfony" : "dev-patch2" }}
  91. 91. // composer.json{ "repositories": [ { "type" : "cvs", "url" : "http://github.com/loalf/symfony" } ], "require": { "symfony/symfony" : "dev-patch2" }}
  92. 92. // composer.json{ "repositories": [ { "type" : "cvs", "url" : "http://github.com/loalf/symfony" } ], "require": { "symfony/symfony" : "dev-patch2" }}
  93. 93. // composer.json{ "repositories": [ { "type" : "cvs", "url" : "http://github.com/loalf/symfony" } ], "require": { "symfony/symfony" : "dev-patch2" }}
  94. 94. // composer.json{ "repositories": [ { "type" : "cvs", "url" : "http://github.com/loalf/symfony" } ], "require": { "symfony/symfony" : "dev-patch2" }}
  95. 95. // composer.json{ "repositories": [ { "type" : "cvs", "url" : "http://github.com/loalf/symfony" } ], "require": { "symfony/symfony" : "dev-patch2" }}
  96. 96. // composer.json{ "repositories": [ { "type" : "cvs", "url" : "http://github.com/loalf/symfony" } ], "require": { "symfony/symfony" : "dev-patch2" }}
  97. 97. // composer.json{ "repositories": [ { "type" : "cvs", "url" : "http://github.com/loalf/symfony" } ], "require": { "symfony/symfony" : "dev-patch2" }}
  98. 98. Excuse #2Some dependecies are in my ownprivate SVN repo
  99. 99. // composer.json{ "repositories": [ { "type" : "cvs", "url" : "svn://company.com/lib" } ], "require": { "company/lib" : "1.2.1" }}
  100. 100. // composer.json{ "repositories": [ { "type" : "cvs", "url" : "svn://company.com/lib" } ], "require": { "company/lib" : "1.2.1" }}
  101. 101. // composer.json{ "repositories": [ { "type" : "cvs", "url" : "svn://company.com/lib" } ], "require": { "company/lib" : "1.2.1" }}
  102. 102. // composer.json{ "repositories": [ { "type" : "cvs", "url" : "svn://company.com/lib" } ], "require": { "company/lib" : "1.2.1" }}
  103. 103. // composer.json{ "repositories": [ { "type" : "cvs", "url" : "svn://company.com/lib" } ], "require": { "company/lib" : "1.2.1" }}
  104. 104. // composer.json{ "repositories": [ { "type" : "cvs", "url" : "svn://company.com/lib" } ], "require": { "company/lib" : "1.2.1" }}
  105. 105. // composer.json{ "repositories": [ { "type" : "cvs", "url" : "svn://company.com/lib" } ], "require": { "company/lib" : "1.2.1" }}
  106. 106. // composer.json{ "repositories": [ { "type" : "cvs", "url" : "svn://company.com/lib" } ], "require": { "company/lib" : "1.2.1" }}
  107. 107. // composer.json{ "repositories": [ { "type" : "cvs", "url" : "svn://company.com/lib" } ], "require": { "company/lib" : "1.2.1" }}
  108. 108. Excuse #3I am using PEAR, you said I coulduse PEAR
  109. 109. // composer.json{ "repositories": [ { "type" : "pear", "url" : "http://pear2.php.net" } ], "require": { "pear-pear2/PEAR2_HTTP_Request" : "*" }}
  110. 110. // composer.json{ "repositories": [ { "type" : "pear", "url" : "http://pear2.php.net" } ], "require": { "pear-pear2/PEAR2_HTTP_Request" : "*" }}
  111. 111. // composer.json{ "repositories": [ { "type" : "pear", "url" : "http://pear2.php.net" } ], "require": { "pear-pear2/PEAR2_HTTP_Request" : "*" }}
  112. 112. // composer.json{ "repositories": [ { "type" : "pear", "url" : "http://pear2.php.net" } ], "require": { "pear-pear2/PEAR2_HTTP_Request" : "*" }}
  113. 113. // composer.json{ "repositories": [ { "type" : "pear", "url" : "http://pear2.php.net" } ], "require": { "pear-pear2/PEAR2_HTTP_Request" : "*" }}
  114. 114. // composer.json{ "repositories": [ { "type" : "pear", "url" : "http://pear2.php.net" } ], "require": { "pear-pear2/PEAR2_HTTP_Request" : "*" }}
  115. 115. // composer.json{ "repositories": [ { "type" : "pear", "url" : "http://pear2.php.net" } ], "require": { "pear-pear2/PEAR2_HTTP_Request" : "*" }}
  116. 116. // composer.json{ "repositories": [ { "type" : "pear", "url" : "http://pear2.php.net" } ], "require": { "pear-pear2/PEAR2_HTTP_Request" : "*" }}
  117. 117. // composer.json{ "repositories": [ { "type" : "pear", "url" : "http://pear2.php.net" } ], "require": { "pear-pear2/PEAR2_HTTP_Request" : "*" }}
  118. 118. Excuse #4My origin doesn´t have acomposer.json file
  119. 119. // composer.json{ "repositories" : [ { "type": "package", "package": { "name": "jquery/jquery", "version": "1.7.2", "dist": { "url": "http://code.jquery.com/jquery-1.7.2.js", "type": "file" } } } ], "require" : { "jquery/jquery" : "1.7.2" }}
  120. 120. // composer.json{ "repositories" : [ { "type": "package", "package": { "name": "jquery/jquery", "version": "1.7.2", "dist": { "url": "http://code.jquery.com/jquery-1.7.2.js", "type": "file" } } } ], "require" : { "jquery/jquery" : "1.7.2" }}
  121. 121. // composer.json{ "repositories" : [ { "type": "package", "package": { "name": "jquery/jquery", "version": "1.7.2", "dist": { "url": "http://code.jquery.com/jquery-1.7.2.js", "type": "file" } } } ], "require" : { "jquery/jquery" : "1.7.2" }}
  122. 122. // composer.json{ "repositories" : [ { "type": "package", "package": { "name": "jquery/jquery", "version": "1.7.2", "dist": { "url": "http://code.jquery.com/jquery-1.7.2.js", "type": "file" } } } ], "require" : { "jquery/jquery" : "1.7.2" }}
  123. 123. // composer.json{ "repositories" : [ { "type": "package", "package": { "name": "jquery/jquery", "version": "1.7.2", "dist": { "url": "http://code.jquery.com/jquery-1.7.2.js", "type": "file" } } } ], "require" : { "jquery/jquery" : "1.7.2" }}
  124. 124. // composer.json{ "repositories" : [ { "type": "package", "package": { "name": "jquery/jquery", "version": "1.7.2", "dist": { "url": "http://code.jquery.com/jquery-1.7.2.js", "type": "file" } } } ], "require" : { "jquery/jquery" : "1.7.2" }}
  125. 125. // composer.json{ "repositories" : [ { "type": "package", "package": { "name": "jquery/jquery", "version": "1.7.2", "dist": { "url": "http://code.jquery.com/jquery-1.7.2.js", "type": "file" } } } ], "require" : { "jquery/jquery" : "1.7.2" }}
  126. 126. // composer.json{ "repositories" : [ { "type": "package", "package": { "name": "jquery/jquery", "version": "1.7.2", "dist": { "url": "http://code.jquery.com/jquery-1.7.2.js", "type": "file" } } } ], "require" : { "jquery/jquery" : "1.7.2" }}
  127. 127. // composer.json{ "repositories" : [ { "type": "package", "package": { "name": "jquery/jquery", "version": "1.7.2", "dist": { "url": "http://code.jquery.com/jquery-1.7.2.js", "type": "file" } } } ], "require" : { "jquery/jquery" : "1.7.2" }}
  128. 128. // composer.json{ "repositories" : [ { "type": "package", "package": { "name": "jquery/jquery", "version": "1.7.2", "dist": { "url": "http://code.jquery.com/jquery-1.7.2.js", "type": "file" } } } ], "require" : { "jquery/jquery" : "1.7.2" }}
  129. 129. // composer.json{ "repositories" : [ { "type": "package", "package": { "name": "jquery/jquery", "version": "1.7.2", "dist": { "url": "http://code.jquery.com/jquery-1.7.2.js", "type": "file" } } } ], "require" : { "jquery/jquery" : "1.7.2" }}
  130. 130. Excuse #5I need a private packagerepository, but Packagist is toodemanding
  131. 131. Satishttp://getcomposer.org/doc/articles/handling-private- packages-with-satis.md
  132. 132. Reasons to composer
  133. 133. 1200 250watchs forks
  134. 134. 2703 2418 2703 1881 packages 1447 1004 692 478 347 204 1392011-09 48 2011-11 2012-01 2012-03 2012-05 2012-07 7
  135. 135. 2703 2418 2703 1881 packages 1447 1004 692 478 347 287 204 1392011-09 48 2011-11 2012-01 2012-03 2012-05 2012-07 7 588
  136. 136. +2.5 mill packages installed since 2012-04-13
  137. 137. Resources
  138. 138. Resources• getcomposer.org
  139. 139. Resources• getcomposer.org• packagist.org
  140. 140. Resources• getcomposer.org• packagist.org• github.com/composer
  141. 141. Thanks! Questions? Javier Lopez (@loalf)
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×