Can I synchronize or mirror dependencies from packagist.org with my own Composer Satis installation? Can I synchronize or mirror dependencies from packagist.org with my own Composer Satis installation? php php

Can I synchronize or mirror dependencies from packagist.org with my own Composer Satis installation?


Satis now supports this.

Just follow the Satis setup instructions and add the following to your configuration file (which is named satis.json by default). Update prefix-url and require as appropriate.

{    "repositories": [        { "type": "composer", "url": "https://packagist.org" }    ],    "require-dependencies": true,    "require": {        {{your application dependencies from composer.json}}    },    "archive": {        "directory": "dist",        "prefix-url": "{{your server}}",        "skip-dev": true    }}

Then, you can create your Satis repository like normal:

php bin/satis build <configuration file> <build dir>

Now, your Satis repository will satisfy all of your application's dependencies.


Note: the first run might take a while. Subsequent runs are much faster. Also, note that Satis uses /tmp for its cache. On a small memory system where /tmp is backed by tmpfs, you might need to increase the space /tmp has available if you have a large dependency tree.

You might also want to disable the Packagist repository in your project's composer.json file to enforce that all dependencies come from your Satis repository. To do this, add:

{    "repositories": [        {            "packagist": false        }    ]}

to your project's composer.json.


You can use broker to achieve this for now. Most likely this capability will be added to satis itself down the line.