Skip to content

Manifest in free format

Warning

Additional free format is in charge of User to implement it.

This class should implement the Bartlett\BoxManifest\Composer\ManifestBuilderInterface contract and must be loadable, either by your autoloader or with bootstrap helper feature (see --bootstrap|-b option).

<?php

use Bartlett\BoxManifest\Composer\ManifestBuilderInterface;

class MyCustomFormat implements ManifestBuilderInterface
{
    public function __invoke(array $content): string
    {
        return var_export($content['installed.php'], true);  # (1)
    }
}
  1. Here the result produced by php var_export function did not contains PHP extensions requirements. You should use instead content of composer.json or composer.lock.
<?php return array(
    'root' => array(
        'name' => 'root/app-fixtures',
        'pretty_version' => '3.x-dev',
        'version' => '3.9999999.9999999.9999999-dev',
        'reference' => '966188206a550366b0e3fe30b6722a16d2246bce',
        'type' => 'library',
        'install_path' => __DIR__ . '/../../',
        'aliases' => array(),
        'dev' => true,
    ),
    'versions' => array(
        'psr/log' => array(
            'pretty_version' => '3.0.0',
            'version' => '3.0.0.0',
            'reference' => 'fe5ea303b0887d5caefd3d431c3e61ad47037001',
            'type' => 'library',
            'install_path' => __DIR__ . '/../psr/log',
            'aliases' => array(),
            'dev_requirement' => true,
        ),
        'root/app-fixtures' => array(
            'pretty_version' => '3.x-dev',
            'version' => '3.9999999.9999999.9999999-dev',
            'reference' => '966188206a550366b0e3fe30b6722a16d2246bce',
            'type' => 'library',
            'install_path' => __DIR__ . '/../../',
            'aliases' => array(),
            'dev_requirement' => false,
        ),
    ),
);

Important

These commands and results are applied from examples/app-fixtures immutable demo folder. Must be your current working directory.

With legacy command

Warning

We've dropped legacy commands, but we still show syntax usage to help Users of version 3 for a smooth migration.

box-manifest manifest:build -f MyCustomFormat -b bootstrap.php
array (
  'root' =>
  array (
    'name' => 'root/app-fixtures',
    'pretty_version' => '3.x-dev',
    'version' => '3.9999999.9999999.9999999-dev',
    'reference' => '966188206a550366b0e3fe30b6722a16d2246bce',
    'type' => 'library',
    'install_path' => '/shared/backups/bartlett/box-manifest/examples/app-fixtures/vendor/composer/../../',
    'aliases' =>
    array (
    ),
    'dev' => true,
  ),
  'versions' =>
  array (
    'psr/log' =>
    array (
      'pretty_version' => '3.0.0',
      'version' => '3.0.0.0',
      'reference' => 'fe5ea303b0887d5caefd3d431c3e61ad47037001',
      'type' => 'library',
      'install_path' => '/shared/backups/bartlett/box-manifest/examples/app-fixtures/vendor/composer/../psr/log',
      'aliases' =>
      array (
      ),
      'dev_requirement' => true,
    ),
    'root/app-fixtures' =>
    array (
      'pretty_version' => '3.x-dev',
      'version' => '3.9999999.9999999.9999999-dev',
      'reference' => '966188206a550366b0e3fe30b6722a16d2246bce',
      'type' => 'library',
      'install_path' => '/shared/backups/bartlett/box-manifest/examples/app-fixtures/vendor/composer/../../',
      'aliases' =>
      array (
      ),
      'dev_requirement' => false,
    ),
  ),
)

With pipeline command

box-manifest make -r custom.bin -b bootstrap.php -f MyCustomFormat -vvv build

custom format

array (
  'root' =>
  array (
    'name' => 'root/app-fixtures',
    'pretty_version' => '3.x-dev',
    'version' => '3.9999999.9999999.9999999-dev',
    'reference' => '966188206a550366b0e3fe30b6722a16d2246bce',
    'type' => 'library',
    'install_path' => '/shared/backups/bartlett/box-manifest/examples/app-fixtures/vendor/composer/../../',
    'aliases' =>
    array (
    ),
    'dev' => true,
  ),
  'versions' =>
  array (
    'psr/log' =>
    array (
      'pretty_version' => '3.0.0',
      'version' => '3.0.0.0',
      'reference' => 'fe5ea303b0887d5caefd3d431c3e61ad47037001',
      'type' => 'library',
      'install_path' => '/shared/backups/bartlett/box-manifest/examples/app-fixtures/vendor/composer/../psr/log',
      'aliases' =>
      array (
      ),
      'dev_requirement' => true,
    ),
    'root/app-fixtures' =>
    array (
      'pretty_version' => '3.x-dev',
      'version' => '3.9999999.9999999.9999999-dev',
      'reference' => '966188206a550366b0e3fe30b6722a16d2246bce',
      'type' => 'library',
      'install_path' => '/shared/backups/bartlett/box-manifest/examples/app-fixtures/vendor/composer/../../',
      'aliases' =>
      array (
      ),
      'dev_requirement' => false,
    ),
  ),
)