halfpastfouram/satis-generator

This package is abandoned and no longer maintained. No replacement package was suggested.

A satis.json generator to use with composer/satis

dev-master 2018-03-19 20:26 UTC

This package is auto-updated.

Last update: 2022-04-10 05:22:42 UTC


README

Latest Stable Version Maintainability composer.lock available License Total Downloads

Satis.json Generator

A satis.json generator to use with composer/satis

Installation

Install using composer:

composer require halfpastfouram/satis-generator

Implementation

<?php

$settings = new \Halfpastfour\SatisGenerator\SatisSettings();
$settings->setName('My Packages');

// Add a repository
$repository = new \Halfpastfour\SatisGenerator\Model\Repository();
$repository->setType('vcs')
           ->setUrl('https://github.com/someuser/somerepo.git');

$settings->getRepositories()->append($repository);

// Add a requirement/dependency
$requirement = new \Halfpastfour\SatisGenerator\Model\Requirement();
$requirement->setPackage('namespace/package');

$settings->getRequirements()->append($requirement);

// Provide generator with settings and generoute the file
$generator = new \Halfpastfour\SatisGenerator\SatisGenerator($settings);
$output    = $generator->generate();

header('content-type: application/json');
echo $output;