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

Managing your code with Composer and Satis

Mihai Nica
January 14, 2016

Managing your code with Composer and Satis

A brief introduction into self hosted package repositories for Composer using Satis at Symfony Bucharest Meetup

Mihai Nica

January 14, 2016
Tweet

More Decks by Mihai Nica

Other Decks in Programming

Transcript

  1. Symfony Bucharest meetup Managing your code with Composer and Satis

    <?php
  2. Composer • Easy management for 3rd party code • Dependencies

    and requirements • Handles autoloading • Other goodies
  3. { "name": "redecs/composer-test", "description": "Test composer project", "require": { "symfony/console":

    "^2.8" }, "authors": [ { "name": "Mihai Nica", "email": "mihai@wisesystems.co" }] }
  4. Satis • static repository generator • used to host your

    private packages • can do caching, but it’s a lot of manual work involved • has support for lots of package types (vcs, archives)
  5. { "name": “My repository", "homepage": "http://packages.localhost", "repositories": [ { "type":

    "vcs", "url": “https://github.com/redecs/php-test-package" } ], "require-all": true }
  6. Composer + Satis • reference to the custom repository •

    bypass packagist (if you have caching enabled) • credentials to access the code
  7. { "name": "redecs/composer-test", "description": "Test composer project", "repositories": [ {"type":

    "composer", "url": "http://localhost:8000/repo/private/"} ], "require": { "symfony/console": "^2.8", "redecs/php-test-package": "1.0" }, "authors": [ {"name": "Mihai Nica”, "email": "mihai@wisesystems.co"} ] }
  8. Creating your own packages • Write code • composer init

    for the package • manage the code with your favorite VCS:
 git add . && git commit -m “first release” && git tag - a 1.0 && git push --tags
  9. • mihai@wisesystems.co • https://twiter.com/redecs • https://facebook.com/redecs
 
 
 
 Mihai

    Nica ?> Thank you!