Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Composerthe right way
@rdohms
Rafael Dohms
photo: smileymanwithahat
photo: Rob Allen
photo: 18millionpixels
Library Publisher
photo: 18millionpixels
Library Publisher
Library Consumer
photo: 18millionpixels
Library Publisher
Library
Library Consumer
photo: 18millionpixels
Library Publisher
Library
Library Consumer
Packagist
photo: 18millionpixels
photo: 18millionpixels
{
"require": {
"monolog/monolog": “2.0”
}
}
photo: 18millionpixels
{
"require": {
"monolog/monolog": “2.0”
}
}
{
"name": “monolog/monolog”
...
}
photo: 18millionpixels
{
"require": {
"monolog/monolog": “2.0”
}
}
{
"name": “monolog/monolog”
...
}
./composer.json has been updated
Loading com...
{
"require": {
"monolog/monolog": “2.0”
}
}
{
"name": “monolog/monolog”
...
}
./composer.json has been updated
Loading com...
{
"require": {
"monolog/monolog": “2.0”
}
}
{
"name": “monolog/monolog”
...
}
./composer.json has been updated
Loading com...
composer
composercomposer.json!
composercomposer.json!
composer.lock!
composercomposer.json!
composer.lock!
discovery Packagist
"
composercomposer.json!
composer.lock!
discovery sourcePackagist
"
Repository
#
composercomposer.json!
composer.lock!
discovery source
installation
Packagist
"
Vendor

Folder
$
Repository
#
composercomposer.json!
composer.lock!
$ composer init
Library Publisher
$ composer init
Library Publisher
$ composer require <vendor>/<package>
Library Consumer
$ composer require monolog/monolog
Tip
$ composer require monolog/monolog
Tip
Using version ~1.11 for monolog/monolog
Release the @DOHMSRAKEN!!
photo by @rosstuck
$ composer require monolog/monolog --sort-packages
Tip
Library Publishers
Composer for
Library Publisher Unique vendor names
vendor / package
Library Publisher Unique vendor names
pick your own 

unique vendor
Library Publisher Unique vendor names
or join a collective
README!
CHANGELOG%
LICENSE&
Library Publisher What’s in your library?
README!
CHANGELOG%
LICENSE&
Library Publisher What’s in your library?
' What problem does it solve?
' Usage examples
' Ins...
README!
CHANGELOG%
LICENSE&
Library Publisher What’s in your library?
' List relevant changes
' Make BC breaks prominent
'...
README!
CHANGELOG%
LICENSE&
Library Publisher What’s in your library?
' List relevant changes
' Make BC breaks prominent
'...
Library Publisher Semantic Versioning
1 . 2 3.major minor patch
Library Publisher Semantic Versioning
1 . 2 3.major minor patch
Bug Fixes
Library Publisher Semantic Versioning
1 . 2 3.major minor patch
New Features Bug Fixes
Library Publisher Semantic Versioning
1 . 2 3.major minor patch
API / BC
Breaks
New Features Bug Fixes
Library Publisher Tagging
Tag it and Bag it
Library Publisher Tagging
# Simple Tag
$ git tag v1.2.3

# Annotated Tag

$ git tag -a v1.2.3 -m “Description of Release"
Library Publisher “I'm out"
photo: jilliancorinne
Library Publisher “I'm out"
Library Publisher “I'm out"
Click here and provide an alternative
Library Publisher “I'm out"
Pick the 

correct 

version
Library Publisher Pick a Version
*the asterisk
Library Publisher Pick a Version
*the asterisk○Library Publisher Pick a Version
~the tilde
Library Publisher Pick a Version
~1.2
>=1.2.0, <2.0.0
Library Publisher Pick a Version
~1.2
>=1.2.0, <2.0.0
Library Publisher Pick a Version
)
~1.2.3
>=1.2.3, <1.3
Library Publisher Pick a Version
~1.2.3
>=1.2.3, <1.3
Library Publisher Pick a Version
)
"require": {
"zendframework/zend-stdlib": “2.1.*”,
"zendframework/zend-servicemanager": "2.1.*",
},
“require-dev": {
“phpu...
"require": {
"zendframework/zend-stdlib": “2.1.*”,
"zendframework/zend-servicemanager": "2.1.*",
},
“require-dev": {
“phpu...
"require": {
"zendframework/zend-stdlib": “2.1.*”,
"zendframework/zend-servicemanager": "2.1.*",
},
“require-dev": {
“phpu...
"require": {
"zendframework/zend-stdlib": “2.1.*”,
"zendframework/zend-servicemanager": "2.1.*",
},
“require-dev": {
“phpu...
Yo @rdohms, I’m
really happy for you and
I’m gonna let you finish, but
the tilde operator is
totally old news.
^the caret
Library Publisher Pick a Version
1.2.3
>=1.2.3, <2.0.0
Library Publisher Pick a Version
^
1.2.3
>=1.2.3, <2.0.0
Library Publisher Pick a Version
)
^
)
0.3.0
>=0.3.0, <0.4.0
Library Publisher Pick a Version
^
0.3.0
>=0.3.0, <0.4.0
Library Publisher Pick a Version
^
)
0.3.0
>=0.3.0, <0.4.0
Library Publisher Pick a Version
^
)
Major Version Zero
Library Consumers
Composer for
Library Consumer Install or update?
install or update?
Library Consumer Install or update?
Make sure you have
installed the last
updates from other
developers.
?
install updateor
Library Consumer Install or update?
Make sure you have
installed the last
updates from other
developers.
?
install updateor
Library Consumer Install or update?
Deploying a new
release of your
application to
production.
?
install updateor
Library Consumer Install or update?
Deploying a new
release of your
application to
production.
?
install updateor
Library Consumer Install or update?
Checked out a new
project and want to
start coding.
?
install updateor
Library Consumer Install or update?
Checked out a new
project and want to
start coding.
?
install updateor
Library Consumer Install or update?
Grab new versions for
the dependencies of
your project.
?
install updateor
Library Consumer Install or update?
Grab new versions for
the dependencies of
your project.
?
install updateor
Your application
$
Public
Repository
#
Library Consumer Install or update?
composer.lock!
composer install
composer update
Your application
$
Public
Repository
#
Library Consumer Install or update?
composer.lock!
read
composer install
composer u...
Your application
$
Public
Repository
#
Library Consumer Install or update?
composer.lock!
read grab version
composer insta...
Your application
$
Public
Repository
#
Library Consumer Install or update?
composer.lock!
read grab version
check latest c...
Your application
$
Public
Repository
#
Library Consumer Install or update?
composer.lock!
read grab version
check latest c...
Library Consumer Install or update?
commit your lock file
Library Consumer Install or update?
$ composer update --lock
Tip
Pick the 

correct 

version
Library Consumer Version Selection
Library Consumer Version Selection
dev-master
Library Consumer Version Selection
Library Consumer Version Selection
Library Consumer Using forks
found a bug?
Library Consumer Using forks
$ composer install --prefer-source
Tip
Library Consumer Using forks
Library Consumer Using forks
patch it,
Library Consumer Using forks
patch it,
fork it,
Library Consumer Using forks
patch it,
fork it,
push it…
Library Consumer Using forks
patch it,
fork it,
push it…
wait for it.
Library Consumer Using forks
patch it,
fork it,
push it…
wait for it.
Library Consumer Using forks
symfony/symfony
Library Consumer Using forks
symfony/symfony
rdohms/symfony
Library Consumer Using forks
symfony/symfony
rdohms/symfony
"repositories": [
{
"type": "vcs",
"url": "https://github.com/...
Library Consumer Using forks
symfony/symfony
rdohms/symfony
"repositories": [
{
"type": "vcs",
"url": "https://github.com/...
Library Consumer Using forks
Do not put
forked repositories

on packagist
,
Library Consumer Using forks
"require": {
"symfony/symfony": "dev-my-patch as 2.5.0"
}
Tip
Library Consumer Composer and deployments
Composer
and
production
Library Consumer Composer and deployments
Production
Server
-
Packagist
.
Library Consumer Composer and deployments
Production
Server
-
Packagist
.
/ Man in the middle
Library Consumer Composer and deployments
Build Server
0
Production
Server
-
"
Packagist
.
/ Man in the middle
Library Consumer Composer and deployments
$ composer install --prefer-dist --no-dev --optimize-autoloader
,
Library Consumer Composer and deployments
$ composer install --prefer-dist --no-dev --optimize-autoloader
,
Library Consumer Composer and deployments
$ composer install --prefer-dist --no-dev --optimize-autoloader
,
1 Install same...
$ composer install --prefer-dist --no-dev --optimize-autoloader
Library Consumer Composer and deployments
,
$ composer install --prefer-dist --no-dev --optimize-autoloader
Library Consumer Composer and deployments
,
1 Downloads di...
$ composer install --prefer-dist --no-dev --optimize-autoloader
Library Consumer Composer and deployments
,
$ composer install --prefer-dist --no-dev --optimize-autoloader
Library Consumer Composer and deployments
,
1 Avoids downl...
$ composer install --prefer-dist --no-dev --optimize-autoloader
Library Consumer Composer and deployments
,
$ composer install --prefer-dist --no-dev --optimize-autoloader
Library Consumer Composer and deployments
,
1 Generates cl...
Library Consumer Licensing
$ composer licenses
Name: __root__
Version: 1.0.0
Licenses: none
Dependencies:
doctrine/annotat...
Library Consumer Private Packages and Proxy
Satis and Toran
composer Packagist
"
Your application
$
Public
Repository
#
Library Consumer Private Packages and Proxy
composer
Packagist
"
Your application
$
Public
Repository
#
Satis / Toran
"
Private
Repository
2
proxy
Library Consumer Pr...
Library Consumer Private Packages and Proxy
toranproxy.com
private repos, automatic packagist proxy
and support composer d...
Library Consumer Tooling
$ composer require jquery/jquery
How many of you?
Library Consumer Tooling
Library Consumer Tooling
Javascript only Developer
Library Consumer Tooling
3 my-js-library
4
Javascript only Developer
Library Consumer Tooling
3 my-js-library
! package.json
4
Javascript only Developer
Library Consumer Tooling
3 my-js-library
! package.json
! bower.json
4
Javascript only Developer
Library Consumer Tooling
3 my-js-library
! composer.json
! package.json
! bower.json
4
Javascript only Developer
Library Consumer Tooling
3 my-js-library
! composer.json
! package.json
! bower.json
! .gemspec
4
Javascript only Developer
Library Consumer Tooling
3 my-js-library
! composer.json
! package.json
! bower.json
! .gemspec
...
Library Consumer Tooling
Library Consumer Tooling
Right tool.

Right job.
Library Consumer One last thing
One last thing…
Library Consumer pickle!
Library Consumer pickle!
$ pickle install memcache
https://wiki.php.net/rfc/pickle
https://github.com/FriendsOfPHP/pickle
Thank you.
https://joind.in/14245
https://leanpub.com/
composer-cookbook
Thank you.any questions?
5 http://slides.doh.ms
6 http://doh.ms
7 @rdohms
https://joind.in/14245
https://leanpub.com/
comp...
Composer the right way - DPC15
Composer the right way - DPC15
Upcoming SlideShare
Loading in …5
×

Composer the right way - DPC15

1,329 views

Published on

Composer has triggered a renaissance in the PHP community, it has changed the way we deal with other people’s code and it has changed the way we share our code. We are all slowly moving to using Composer, from Wordpress to Joomla and Drupal and frameworks in between. But many of us mistreat composer, follow outdated practices or simply lack a few tricks. In this session i’ll get you the low down on how to use composer the right way.

Published in: Technology
  • Be the first to comment

Composer the right way - DPC15

  1. 1. Composerthe right way @rdohms Rafael Dohms
  2. 2. photo: smileymanwithahat
  3. 3. photo: Rob Allen
  4. 4. photo: 18millionpixels
  5. 5. Library Publisher photo: 18millionpixels
  6. 6. Library Publisher Library Consumer photo: 18millionpixels
  7. 7. Library Publisher Library Library Consumer photo: 18millionpixels
  8. 8. Library Publisher Library Library Consumer Packagist photo: 18millionpixels
  9. 9. photo: 18millionpixels
  10. 10. { "require": { "monolog/monolog": “2.0” } } photo: 18millionpixels
  11. 11. { "require": { "monolog/monolog": “2.0” } } { "name": “monolog/monolog” ... } photo: 18millionpixels
  12. 12. { "require": { "monolog/monolog": “2.0” } } { "name": “monolog/monolog” ... } ./composer.json has been updated Loading composer repositories with package information Updating dependencies (including require-dev) Your requirements could not be resolved to an installable set of packages. Problem 1 - The requested package monolog/monolog could not be found in any version, there may be a typo in the package name. Potential causes: - A typo in the package name - The package is not available in a stable-enough version according to your minimum-stability setting see <https://groups.google.com/d/topic/composer-dev/_g3ASeIFlrc/discussion> for more details. Read <http://getcomposer.org/doc/articles/troubleshooting.md> for further common problems. Installation failed, reverting ./composer.json to its original content. photo: 18millionpixels
  13. 13. { "require": { "monolog/monolog": “2.0” } } { "name": “monolog/monolog” ... } ./composer.json has been updated Loading composer repositories with package information Updating dependencies (including require-dev) Your requirements could not be resolved to an installable set of packages. Problem 1 - The requested package monolog/monolog could not be found in any version, there may be a typo in the package name. Potential causes: - A typo in the package name - The package is not available in a stable-enough version according to your minimum-stability setting see <https://groups.google.com/d/topic/composer-dev/_g3ASeIFlrc/discussion> for more details. Read <http://getcomposer.org/doc/articles/troubleshooting.md> for further common problems. Installation failed, reverting ./composer.json to its original content. ___
 ~1.1 photo: 18millionpixels
  14. 14. { "require": { "monolog/monolog": “2.0” } } { "name": “monolog/monolog” ... } ./composer.json has been updated Loading composer repositories with package information Updating dependencies (including require-dev) Your requirements could not be resolved to an installable set of packages. Problem 1 - The requested package monolog/monolog could not be found in any version, there may be a typo in the package name. Potential causes: - A typo in the package name - The package is not available in a stable-enough version according to your minimum-stability setting see <https://groups.google.com/d/topic/composer-dev/_g3ASeIFlrc/discussion> for more details. Read <http://getcomposer.org/doc/articles/troubleshooting.md> for further common problems. Installation failed, reverting ./composer.json to its original content. ./composer.json has been updated Loading composer repositories with package information Updating dependencies (including require-dev) - Installing psr/log (1.0.0) Loading from cache - Installing monolog/monolog (1.11.0) Downloading: 100% monolog/monolog suggests installing graylog2/gelf-php (Allow sending log messages to a GrayLog2 server) [...] monolog/monolog suggests installing ext-mongo (Allow sending log messages to a MongoDB server) monolog/monolog suggests installing aws/aws-sdk-php (Allow sending log messages to AWS services like DynamoDB) monolog/monolog suggests installing rollbar/rollbar (Allow sending log messages to Rollbar) Writing lock file Generating autoload files ___
 ~1.1 photo: 18millionpixels
  15. 15. composer
  16. 16. composercomposer.json!
  17. 17. composercomposer.json! composer.lock!
  18. 18. composercomposer.json! composer.lock!
  19. 19. discovery Packagist " composercomposer.json! composer.lock!
  20. 20. discovery sourcePackagist " Repository # composercomposer.json! composer.lock!
  21. 21. discovery source installation Packagist " Vendor
 Folder $ Repository # composercomposer.json! composer.lock!
  22. 22. $ composer init Library Publisher
  23. 23. $ composer init Library Publisher $ composer require <vendor>/<package> Library Consumer
  24. 24. $ composer require monolog/monolog Tip
  25. 25. $ composer require monolog/monolog Tip Using version ~1.11 for monolog/monolog
  26. 26. Release the @DOHMSRAKEN!! photo by @rosstuck
  27. 27. $ composer require monolog/monolog --sort-packages Tip
  28. 28. Library Publishers Composer for
  29. 29. Library Publisher Unique vendor names vendor / package
  30. 30. Library Publisher Unique vendor names pick your own 
 unique vendor
  31. 31. Library Publisher Unique vendor names or join a collective
  32. 32. README! CHANGELOG% LICENSE& Library Publisher What’s in your library?
  33. 33. README! CHANGELOG% LICENSE& Library Publisher What’s in your library? ' What problem does it solve? ' Usage examples ' Install instructions ' How can I contribute?
  34. 34. README! CHANGELOG% LICENSE& Library Publisher What’s in your library? ' List relevant changes ' Make BC breaks prominent ' Show examples of how to upgrade ' What problem does it solve? ' Usage examples ' Install instructions ' How can I contribute?
  35. 35. README! CHANGELOG% LICENSE& Library Publisher What’s in your library? ' List relevant changes ' Make BC breaks prominent ' Show examples of how to upgrade ' Pick one that reflects your values ' choosealicense.com can help ' What problem does it solve? ' Usage examples ' Install instructions ' How can I contribute?
  36. 36. Library Publisher Semantic Versioning 1 . 2 3.major minor patch
  37. 37. Library Publisher Semantic Versioning 1 . 2 3.major minor patch Bug Fixes
  38. 38. Library Publisher Semantic Versioning 1 . 2 3.major minor patch New Features Bug Fixes
  39. 39. Library Publisher Semantic Versioning 1 . 2 3.major minor patch API / BC Breaks New Features Bug Fixes
  40. 40. Library Publisher Tagging Tag it and Bag it
  41. 41. Library Publisher Tagging # Simple Tag $ git tag v1.2.3
 # Annotated Tag
 $ git tag -a v1.2.3 -m “Description of Release"
  42. 42. Library Publisher “I'm out" photo: jilliancorinne
  43. 43. Library Publisher “I'm out"
  44. 44. Library Publisher “I'm out" Click here and provide an alternative
  45. 45. Library Publisher “I'm out"
  46. 46. Pick the 
 correct 
 version Library Publisher Pick a Version
  47. 47. *the asterisk Library Publisher Pick a Version
  48. 48. *the asterisk○Library Publisher Pick a Version
  49. 49. ~the tilde Library Publisher Pick a Version
  50. 50. ~1.2 >=1.2.0, <2.0.0 Library Publisher Pick a Version
  51. 51. ~1.2 >=1.2.0, <2.0.0 Library Publisher Pick a Version )
  52. 52. ~1.2.3 >=1.2.3, <1.3 Library Publisher Pick a Version
  53. 53. ~1.2.3 >=1.2.3, <1.3 Library Publisher Pick a Version )
  54. 54. "require": { "zendframework/zend-stdlib": “2.1.*”, "zendframework/zend-servicemanager": "2.1.*", }, “require-dev": { “phpunit/phpunit": “~3.7” } Library Publisher Pick a Version "require": { "zendframework/zend-stdlib": “~2.3”, "zendframework/zend-servicemanager": “~2.3", }, “require-dev": { “phpunit/phpunit": “~4” } 3rd party library Your application
  55. 55. "require": { "zendframework/zend-stdlib": “2.1.*”, "zendframework/zend-servicemanager": "2.1.*", }, “require-dev": { “phpunit/phpunit": “~3.7” } Library Publisher Pick a Version "require": { "zendframework/zend-stdlib": “~2.3”, "zendframework/zend-servicemanager": “~2.3", }, “require-dev": { “phpunit/phpunit": “~4” } 3rd party library Your application *
  56. 56. "require": { "zendframework/zend-stdlib": “2.1.*”, "zendframework/zend-servicemanager": "2.1.*", }, “require-dev": { “phpunit/phpunit": “~3.7” } Library Publisher Pick a Version "require": { "zendframework/zend-stdlib": “~2.3”, "zendframework/zend-servicemanager": “~2.3", }, “require-dev": { “phpunit/phpunit": “~4” } 3rd party library Your application *
  57. 57. "require": { "zendframework/zend-stdlib": “2.1.*”, "zendframework/zend-servicemanager": "2.1.*", }, “require-dev": { “phpunit/phpunit": “~3.7” } Library Publisher Pick a Version "require": { "zendframework/zend-stdlib": “~2.3”, "zendframework/zend-servicemanager": “~2.3", }, “require-dev": { “phpunit/phpunit": “~4” } 3rd party library Your application * ~2.1
  58. 58. Yo @rdohms, I’m really happy for you and I’m gonna let you finish, but the tilde operator is totally old news.
  59. 59. ^the caret Library Publisher Pick a Version
  60. 60. 1.2.3 >=1.2.3, <2.0.0 Library Publisher Pick a Version ^
  61. 61. 1.2.3 >=1.2.3, <2.0.0 Library Publisher Pick a Version ) ^ )
  62. 62. 0.3.0 >=0.3.0, <0.4.0 Library Publisher Pick a Version ^
  63. 63. 0.3.0 >=0.3.0, <0.4.0 Library Publisher Pick a Version ^ )
  64. 64. 0.3.0 >=0.3.0, <0.4.0 Library Publisher Pick a Version ^ ) Major Version Zero
  65. 65. Library Consumers Composer for
  66. 66. Library Consumer Install or update? install or update?
  67. 67. Library Consumer Install or update? Make sure you have installed the last updates from other developers. ? install updateor
  68. 68. Library Consumer Install or update? Make sure you have installed the last updates from other developers. ? install updateor
  69. 69. Library Consumer Install or update? Deploying a new release of your application to production. ? install updateor
  70. 70. Library Consumer Install or update? Deploying a new release of your application to production. ? install updateor
  71. 71. Library Consumer Install or update? Checked out a new project and want to start coding. ? install updateor
  72. 72. Library Consumer Install or update? Checked out a new project and want to start coding. ? install updateor
  73. 73. Library Consumer Install or update? Grab new versions for the dependencies of your project. ? install updateor
  74. 74. Library Consumer Install or update? Grab new versions for the dependencies of your project. ? install updateor
  75. 75. Your application $ Public Repository # Library Consumer Install or update? composer.lock! composer install composer update
  76. 76. Your application $ Public Repository # Library Consumer Install or update? composer.lock! read composer install composer update
  77. 77. Your application $ Public Repository # Library Consumer Install or update? composer.lock! read grab version composer install composer update
  78. 78. Your application $ Public Repository # Library Consumer Install or update? composer.lock! read grab version check latest compatible release composer install composer update
  79. 79. Your application $ Public Repository # Library Consumer Install or update? composer.lock! read grab version check latest compatible release update composer install composer update
  80. 80. Library Consumer Install or update? commit your lock file
  81. 81. Library Consumer Install or update? $ composer update --lock Tip
  82. 82. Pick the 
 correct 
 version Library Consumer Version Selection
  83. 83. Library Consumer Version Selection dev-master
  84. 84. Library Consumer Version Selection
  85. 85. Library Consumer Version Selection
  86. 86. Library Consumer Using forks found a bug?
  87. 87. Library Consumer Using forks $ composer install --prefer-source Tip
  88. 88. Library Consumer Using forks
  89. 89. Library Consumer Using forks patch it,
  90. 90. Library Consumer Using forks patch it, fork it,
  91. 91. Library Consumer Using forks patch it, fork it, push it…
  92. 92. Library Consumer Using forks patch it, fork it, push it… wait for it.
  93. 93. Library Consumer Using forks patch it, fork it, push it… wait for it.
  94. 94. Library Consumer Using forks symfony/symfony
  95. 95. Library Consumer Using forks symfony/symfony rdohms/symfony
  96. 96. Library Consumer Using forks symfony/symfony rdohms/symfony "repositories": [ { "type": "vcs", "url": "https://github.com/rdohms/symfony" } ]
  97. 97. Library Consumer Using forks symfony/symfony rdohms/symfony "repositories": [ { "type": "vcs", "url": "https://github.com/rdohms/symfony" } ] +
  98. 98. Library Consumer Using forks Do not put forked repositories
 on packagist ,
  99. 99. Library Consumer Using forks "require": { "symfony/symfony": "dev-my-patch as 2.5.0" } Tip
  100. 100. Library Consumer Composer and deployments Composer and production
  101. 101. Library Consumer Composer and deployments Production Server - Packagist .
  102. 102. Library Consumer Composer and deployments Production Server - Packagist . / Man in the middle
  103. 103. Library Consumer Composer and deployments Build Server 0 Production Server - " Packagist . / Man in the middle
  104. 104. Library Consumer Composer and deployments $ composer install --prefer-dist --no-dev --optimize-autoloader ,
  105. 105. Library Consumer Composer and deployments $ composer install --prefer-dist --no-dev --optimize-autoloader ,
  106. 106. Library Consumer Composer and deployments $ composer install --prefer-dist --no-dev --optimize-autoloader , 1 Install same versions 1 Uses information defined in the composer.lock file
  107. 107. $ composer install --prefer-dist --no-dev --optimize-autoloader Library Consumer Composer and deployments ,
  108. 108. $ composer install --prefer-dist --no-dev --optimize-autoloader Library Consumer Composer and deployments , 1 Downloads distribution packages 1 Can use local cache for previously downloaded 1 No git required
  109. 109. $ composer install --prefer-dist --no-dev --optimize-autoloader Library Consumer Composer and deployments ,
  110. 110. $ composer install --prefer-dist --no-dev --optimize-autoloader Library Consumer Composer and deployments , 1 Avoids download unnecessary developer libraries
  111. 111. $ composer install --prefer-dist --no-dev --optimize-autoloader Library Consumer Composer and deployments ,
  112. 112. $ composer install --prefer-dist --no-dev --optimize-autoloader Library Consumer Composer and deployments , 1 Generates classmap from PSR-0/4 autoloaders 1 Speeds up autoloading
  113. 113. Library Consumer Licensing $ composer licenses Name: __root__ Version: 1.0.0 Licenses: none Dependencies: doctrine/annotations v1.2.1 MIT doctrine/cache v1.3.1 MIT doctrine/collections v1.2 MIT doctrine/common v2.4.2 MIT doctrine/inflector v1.0 MIT doctrine/lexer v1.0 MIT psr/log 1.0.0 MIT symfony/symfony v2.5.6 MIT twig/twig v1.16.2 BSD-3-Clause Tip
  114. 114. Library Consumer Private Packages and Proxy Satis and Toran
  115. 115. composer Packagist " Your application $ Public Repository # Library Consumer Private Packages and Proxy
  116. 116. composer Packagist " Your application $ Public Repository # Satis / Toran " Private Repository 2 proxy Library Consumer Private Packages and Proxy
  117. 117. Library Consumer Private Packages and Proxy toranproxy.com private repos, automatic packagist proxy and support composer development
  118. 118. Library Consumer Tooling $ composer require jquery/jquery How many of you?
  119. 119. Library Consumer Tooling
  120. 120. Library Consumer Tooling
  121. 121. Javascript only Developer Library Consumer Tooling 3 my-js-library 4
  122. 122. Javascript only Developer Library Consumer Tooling 3 my-js-library ! package.json 4
  123. 123. Javascript only Developer Library Consumer Tooling 3 my-js-library ! package.json ! bower.json 4
  124. 124. Javascript only Developer Library Consumer Tooling 3 my-js-library ! composer.json ! package.json ! bower.json 4
  125. 125. Javascript only Developer Library Consumer Tooling 3 my-js-library ! composer.json ! package.json ! bower.json ! .gemspec 4
  126. 126. Javascript only Developer Library Consumer Tooling 3 my-js-library ! composer.json ! package.json ! bower.json ! .gemspec 4 / /
  127. 127. Library Consumer Tooling
  128. 128. Library Consumer Tooling Right tool.
 Right job.
  129. 129. Library Consumer One last thing One last thing…
  130. 130. Library Consumer pickle!
  131. 131. Library Consumer pickle! $ pickle install memcache https://wiki.php.net/rfc/pickle https://github.com/FriendsOfPHP/pickle
  132. 132. Thank you. https://joind.in/14245 https://leanpub.com/ composer-cookbook
  133. 133. Thank you.any questions? 5 http://slides.doh.ms 6 http://doh.ms 7 @rdohms https://joind.in/14245 https://leanpub.com/ composer-cookbook

×