Saturday, August 27, 2016

Local Composer for Everyone! A Conference-Friendly Satis Setup

While preparing my technical materials for WebSummerCamp, I realized my workshop would rely on a fairly stable internet connection, as we'd have a lot of ground to cover and a lot of packages to install. Rather than rely on the gods of live demos, or pre-installing everything and ruining the experience, I picked another route.

In this post, I'll show you how to set up a local Satis instance and have it host the packages over the network it's currently on, so that everyone who's also connected to it can put the address into composer.json as a custom repository source, and retrieve all packages from your machine locally - no internet connection required!

Composer logo with deal with it sunglasses

Prerequisites

Due to a habit of never installing programming-related software on my main OS (more about that here), I'm using Homestead Improved, as usual. If you have a working PHP installation on your host machine, or prefer Docker or something similar, please feel free to use that. Note, however, that for the sake of cross-platform friendliness and simplicity, this tutorial will be Homestead Improved-specific.

Before booting up the VM, make sure you share an arbitrary port. This can be done by editing the bottom section of Homestead.yaml. I picked 6789, so that my local "packagist" will be hosted on IP:6789 where IP will be the IP address of my host machine.

Satis

Inside the VM, in an arbitrary location of your choice (I picked /home/vagrant/Code/) install a new Satis project with:

composer create-project composer/satis --stability=dev --keep-vcs

This will create the subfolder satis.

Continue reading %Local Composer for Everyone! A Conference-Friendly Satis Setup%


by Bruno Skvorc via SitePoint

No comments:

Post a Comment