Composer - Package Management for PHP. Silver Bullet?

  • 6,574 views
Uploaded on

Modern package management for PHP projects. …

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

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
No Downloads

Views

Total Views
6,574
On Slideshare
0
From Embeds
0
Number of Embeds
2

Actions

Shares
Downloads
28
Comments
0
Likes
4

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

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