Upgrade to Pro — share decks privately, control downloads, hide ads and more …

[Yatego] The basics of composer

Sponsored · Your Podcast. Everywhere. Effortlessly. Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.

[Yatego] The basics of composer

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.

Avatar for Stefan Winter

Stefan Winter

May 27, 2013
Tweet

Other Decks in Programming

Transcript

  1. Warum sind wir hier? Kleine Projekte haben Abhängigkeiten. Große Projekte

    auch. Nur mehr! Wie gehe ich mit Tools, Libraries & Co um? Mittwoch, 29. Mai 13
  2. Als Softwareentwickler möchte ich, dass die technischen Abhängigkeiten des Projekts

    zentral und sauber verwaltet und modifiziert werden können, damit der Wartungsaufwand minimiert wird. Mittwoch, 29. Mai 13
  3. *hust* Schon mal von PEAR gehört? $ pear install phpunit/PHPUnit

    funktioniert! Aber nur im kleinen Maßstab! Mittwoch, 29. Mai 13
  4. *hust* Schon mal von PEAR gehört? $ pear install phpunit/PHPUnit

    funktioniert! Aber nur im kleinen Maßstab! Was, wenn ich legacy-Projekte auf dem selben Server habe? Mittwoch, 29. Mai 13
  5. Also, Composer? leicht zu installieren & zu nutzen erlaubt projektbezogene

    Konfiguration zentral Abhänigkeiten präzise definiert (composer.lock) Mittwoch, 29. Mai 13
  6. Also, Composer? leicht zu installieren & zu nutzen erlaubt projektbezogene

    Konfiguration zentral Abhänigkeiten präzise definiert (composer.lock) “Every project is a package” Mittwoch, 29. Mai 13
  7. Erste Gehversuche <?php class MyFooTest extends \PHPUnit_Framework_TestCase { ! public

    function testFoo () ! { ! ! $this->assertNotEquals('foo', 'bar'); ! } } $ git clone [email protected]:winterstefan/composer- example.git Mittwoch, 29. Mai 13
  8. Erste Gehversuche { ! "config":{ ! ! "bin-dir":"bin" ! },

    ! "require-dev":{ ! ! "phpunit/phpunit":"~3.7" ! } } $ cd composer-example $ less composer.json Mittwoch, 29. Mai 13
  9. Do’s & Don’ts and Facts composer.json Use ‘require-dev’ for development

    dependencies (instead of ‘require’) Mittwoch, 29. Mai 13