Skip to content

Instantly share code, notes, and snippets.

@GromNaN GromNaN/
Last active Jul 11, 2019

What would you like to do?
Split Composer Satis repositories into smaller packages
# For each sub-package, run the Satis build command.
php bin/satis build repositories-mirrors.json ./web/mirrors
php bin/satis build repositories-pear.json ./web/pear
php bin/satis build repositoriesp-rojects.json ./web/projects
# Merge all the package files.
php web/packages.php > web/packages.json
// File located in web/packages.php
require __DIR__.'/../vendor/autoload.php';
$dirs = array(
$packages = array(
'packages' => array(),
'includes' => array(),
foreach ($dirs as $dir) {
$file = __DIR__.'/'.$dir.'/packages.json';
if (!file_exists($file)) {
fwrite(STDERR, "File $file does not exist.\n");
$packages['includes'][$dir.'/packages.json'] = new stdClass;
$data = json_decode(file_get_contents($file), true);
foreach ($data['includes'] as $key => $value) {
$packages['includes'][$dir.'/'.$key] = $value;
header('Content-Type: text/plain');
echo Composer\Json\JsonFormatter::format(json_encode($packages), false, true);
echo PHP_EOL;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.