Composer —  Package Management for PHP. Silver Bullet? Kirill chEbba Chebunin Billix [email_address] http://github.com/chE...
Problem
Dependent Libraries
Dependent Libraries
Dependent Libraries
Many Separate Projects
Overview of Tools <ul><li>Python: easy_install, pip </li></ul><ul><li>Ruby: gems </li></ul><ul><li>Java: maven, ivy </li><...
PEAR. Why NOT? <ul><li>#pyrus mypear = hack </li></ul><ul><li>Channel1/Package1 != Channel2/Package1 </li></ul><ul><li>No ...
Composer. Silver Bullet?
Composer. Simple <ul><li>#wget  http://getcomposer.org/composer.phar </li></ul><ul><li>#vi /path/to/project/.composer.json...
Composer. File <ul><li>{ </li></ul><ul><li>&quot;require&quot; :   { </li></ul><ul><li>&quot;vendor/package1&quot; :   &qu...
Composer. Fundamentals <ul><li>Package Repository = Metadata </li></ul><ul><li>Storage Separated from Repository </li></ul...
Composer. Repository File <ul><li>&quot;composer / composer&quot; :{ </li></ul><ul><li>&quot;name&quot; : &quot;composer /...
Composer. Repository <ul><li>PlatformRepository (php & extensions) </li></ul><ul><li>ComposerRepository ($url/composer.jso...
Composer. Downloader <ul><li>&quot;source&quot; :{ </li></ul><ul><li>&quot;type&quot; : &quot;git&quot; , </li></ul><ul><l...
Composer. Downloader <ul><li>ZipDownloader (dist) </li></ul><ul><li>TarDownloader (dist: tar, tar.gz, tar.bz2) </li></ul><...
Composer. Installer <ul><li>LibraryInstaller (vendor/*) </li></ul><ul><li>&quot;composer / composer&quot; :{ </li></ul><ul...
Composer. Dependency Resolver <ul><li>OpenSUSE's Libzypp satsolver </li></ul><ul><li>Requires </li></ul><ul><li>Conflicts ...
Composer. Dependency Resolver <ul><li>&quot;require&quot; :{ </li></ul><ul><li>&quot;php&quot; : &quot;>=5.3.0&quot; , </l...
Composer. Autoload <ul><li>PSR-0 Autoloading (.composer/autoload.php) </li></ul><ul><li>&quot;versions&quot; :{ </li></ul>...
Questions? =)
Upcoming SlideShare
Loading in...5
×

Composer - Package Management for PHP. Silver Bullet?

6,846

Published on

Modern package management for PHP projects.
http://packagist.org/
http://github.com/composer/composer

0 Comments
5 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
6,846
On Slideshare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
33
Comments
0
Likes
5
Embeds 0
No embeds

No notes for slide

Composer - Package Management for PHP. Silver Bullet?

  1. 1. Composer — Package Management for PHP. Silver Bullet? Kirill chEbba Chebunin Billix [email_address] http://github.com/chEbba @iamchEbba
  2. 2. Problem
  3. 3. Dependent Libraries
  4. 4. Dependent Libraries
  5. 5. Dependent Libraries
  6. 6. Many Separate Projects
  7. 7. Overview of Tools <ul><li>Python: easy_install, pip </li></ul><ul><li>Ruby: gems </li></ul><ul><li>Java: maven, ivy </li></ul><ul><li>C#(.NET): NuGet, NuPack </li></ul><ul><li>PHP: PEAR/Pyrus </li></ul>
  8. 8. PEAR. Why NOT? <ul><li>#pyrus mypear = hack </li></ul><ul><li>Channel1/Package1 != Channel2/Package1 </li></ul><ul><li>No “Source”, only “Dists” </li></ul><ul><li>Special Package Type (+/-) </li></ul>
  9. 9. Composer. Silver Bullet?
  10. 10. Composer. Simple <ul><li>#wget http://getcomposer.org/composer.phar </li></ul><ul><li>#vi /path/to/project/.composer.json </li></ul><ul><li>#php composer.phar install </li></ul><ul><li>PEAR package on release? </li></ul>
  11. 11. Composer. File <ul><li>{ </li></ul><ul><li>&quot;require&quot; : { </li></ul><ul><li>&quot;vendor/package1&quot; : &quot;1.3.2&quot; , </li></ul><ul><li>&quot;vendor/package2&quot; : &quot;1.*&quot; , </li></ul><ul><li>&quot;vendor/package3&quot; : &quot;>=2.0.3&quot; </li></ul><ul><li>} </li></ul><ul><li>} </li></ul>
  12. 12. Composer. Fundamentals <ul><li>Package Repository = Metadata </li></ul><ul><li>Storage Separated from Repository </li></ul><ul><li>Unique Package Name = vendor/package </li></ul><ul><li>Different Storage Types (Downloaders) </li></ul><ul><li>“ Source” & “Dist” </li></ul><ul><li>Dependecy Resolver </li></ul>
  13. 13. Composer. Repository File <ul><li>&quot;composer / composer&quot; :{ </li></ul><ul><li>&quot;name&quot; : &quot;composer / composer&quot; , </li></ul><ul><li>&quot;description&quot; : &quot;Package Manager&quot; , </li></ul><ul><li>&quot;maintainers&quot; :[], </li></ul><ul><li>&quot;versions&quot; :{ </li></ul><ul><li>&quot;master-dev&quot; :{ </li></ul><ul><li>&quot;require&quot; :{ </li></ul><ul><li>&quot;php&quot; : &quot;>=5.3.0&quot; , </li></ul><ul><li>&quot;symfony / console&quot; : &quot;2.0.5&quot; , </li></ul><ul><li>&quot;symfony / finder&quot; : &quot;2.0.5&quot; </li></ul><ul><li>} </li></ul><ul><li>} </li></ul><ul><li>} </li></ul><ul><li>} </li></ul>
  14. 14. Composer. Repository <ul><li>PlatformRepository (php & extensions) </li></ul><ul><li>ComposerRepository ($url/composer.json) </li></ul><ul><li>PearRepository (PEAR channel support) </li></ul><ul><li>VcsRepository (github, git, svn, hg) </li></ul><ul><li>LocalRepository? </li></ul>
  15. 15. Composer. Downloader <ul><li>&quot;source&quot; :{ </li></ul><ul><li>&quot;type&quot; : &quot;git&quot; , </li></ul><ul><li>&quot;url&quot; : &quot;http: // github.com / composer / composer.git&quot; , </li></ul><ul><li>&quot;reference&quot; : &quot;e6c3929ea9f7d732ed3352dc06ed950af140ebf7&quot; , </li></ul><ul><li>&quot;shasum&quot; : &quot;&quot; </li></ul><ul><li>}, </li></ul><ul><li>&quot;dist&quot; :{ </li></ul><ul><li>&quot;type&quot; : &quot;zip&quot; , </li></ul><ul><li>&quot;url&quot; : &quot;<...>e6c3929ea9f7d732ed3352dc06ed950af140ebf7&quot; , </li></ul><ul><li>&quot;shasum&quot; : &quot;e32a4bac17d56533393b856699491c4c02f3e1ab&quot; , </li></ul><ul><li>&quot;reference&quot; : &quot;e6c3929ea9f7d732ed3352dc06ed950af140ebf7&quot; </li></ul><ul><li>} </li></ul>
  16. 16. Composer. Downloader <ul><li>ZipDownloader (dist) </li></ul><ul><li>TarDownloader (dist: tar, tar.gz, tar.bz2) </li></ul><ul><li>PharDownloader (dist) </li></ul><ul><li>PearDownloader (dist: uses tar) </li></ul><ul><li>GitDownloader (source) </li></ul><ul><li>HgDownloader (source) </li></ul>
  17. 17. Composer. Installer <ul><li>LibraryInstaller (vendor/*) </li></ul><ul><li>&quot;composer / composer&quot; :{ </li></ul><ul><li>&quot;name&quot; : &quot;composer / composer&quot; , </li></ul><ul><li>&quot;description&quot; : &quot;Package Manager&quot; , </li></ul><ul><li>&quot;type&quot; : &quot;library&quot; </li></ul><ul><li>} </li></ul>
  18. 18. Composer. Dependency Resolver <ul><li>OpenSUSE's Libzypp satsolver </li></ul><ul><li>Requires </li></ul><ul><li>Conflicts </li></ul><ul><li>Provides </li></ul><ul><li>Replaces </li></ul><ul><li>Recommends </li></ul><ul><li>Suggests </li></ul>
  19. 19. Composer. Dependency Resolver <ul><li>&quot;require&quot; :{ </li></ul><ul><li>&quot;php&quot; : &quot;>=5.3.0&quot; , </li></ul><ul><li>&quot;symfony / console&quot; : &quot;2.0.5&quot; , </li></ul><ul><li>&quot;symfony / finder&quot; : &quot;2.0.5&quot; </li></ul><ul><li>} </li></ul>
  20. 20. Composer. Autoload <ul><li>PSR-0 Autoloading (.composer/autoload.php) </li></ul><ul><li>&quot;versions&quot; :{ </li></ul><ul><li>&quot;master-dev&quot; :{ </li></ul><ul><li>&quot;autoload&quot; :{ </li></ul><ul><li>&quot;psr-0&quot; :{ </li></ul><ul><li>&quot;Composer&quot; : &quot;src / &quot; </li></ul><ul><li>} </li></ul><ul><li>} </li></ul><ul><li>} </li></ul><ul><li>} </li></ul>
  21. 21. Questions? =)
  1. A particular slide catching your eye?

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

×