2017 © Pedro Peláez
 

library deployer-loader

Autoload of vendors and autoload of deployer tasks.

image

sourcebroker/deployer-loader

Autoload of vendors and autoload of deployer tasks.

  • Tuesday, October 24, 2017
  • by sourcebroker
  • Repository
  • 1 Watchers
  • 1 Stars
  • 5,846 Installations
  • PHP
  • 8 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 7 Versions
  • 33 % Grown

The README.md

deployer-loader

Latest Stable Version License, (*1)

What does it do?

This package allows to load:, (*2)

  1. single task or set of tasks from given path -> loader type: path
  2. set of tasks from "deployer" folder of composer package -> loader type: package
  3. loader config from composer package -> loader type: get

Installation

composer require sourcebroker/deployer-loader

Usage

TYPE path

You can load single file or multiple files. You can use excludePattern to exclude., (*3)

new \SourceBroker\DeployerLoader\Load(
   ['path' => 'vendor/sourcebroker/deployer-extended-database/deployer/db/task/db:copy.php'],
   ['path' => 'vendor/sourcebroker/deployer-extended-database/deployer/db/task/db:move.php'],
);

new \SourceBroker\DeployerLoader\Load(
   ['path' => 'vendor/sourcebroker/deployer-extended-database/deployer/db', 'excludePattern' => '/move/'],
   ['path' => 'vendor/sourcebroker/deployer-extended-media/deployer/media'],
);

TYPE file_phar

A file is loaded from relative to root project. Allows to include Deployer phar file., (*4)

new \SourceBroker\DeployerLoader\Load(
   ['file_phar' => 'recipe/common.php'],
);

TYPE package

Files are loaded recursively form given package from hardcoded folder deployer., (*5)

new \SourceBroker\DeployerLoader\Load(
   ['package' => 'sourcebroker/deployer-extended-database'],
   ['package' => 'sourcebroker/deployer-extended-media'],
);

TYPE get

In case of get first the file with array of loader configurations is read from given package. The logic to read the file is like:, (*6)

  • First it checks if the composer.json file contains the key extra.sourcebroker/deployer.loader-file.
  • If the key exists, it read it and execute inclusions.
  • If the key does not exist, it defaults to the path config/loader.php within the package directory.

Then the loader configurations read from that file are executed., (*7)

Example of loader file: https://github.com/sourcebroker/deployer-typo3-database/blob/main/config/loader.php, (*8)

new \SourceBroker\DeployerLoader\Load(
   ['get' => 'sourcebroker/deployer-typo3-database'],
   ['get' => 'sourcebroker/deployer-typo3-media'],
   ['get' => 'sourcebroker/deployer-typo3-deploy-ci'],
);

Conflict detection

If a loader specifies a 'conflict' configuration that matches another loaded configuration, an exception is thrown with detailed information about the conflict, including which package caused it., (*9)

    [
        'package' => 'sourcebroker/deployer-typo3-deploy',
        'conflict' => [
            'package' => [
                'sourcebroker/deployer-typo3-deploy-ci'
            ]
        ]
    ]

Check if configuration is loaded

You can check if a specific configuration item has already been loaded using the isLoaded() method:, (*10)

if (\SourceBroker\DeployerLoader\Utility\LoadUtility::isLoaded(['package' => 'sourcebroker/deployer-typo3-deploy'])) {

}

Changelog

See CHANGELOG.rst, (*11)

The Versions

24/10 2017

dev-master

9999999-dev

Autoload of vendors and autoload of deployer tasks.

  Sources   Download

MIT

The Requires

 

by Krystian Szymukowicz

deployer

24/10 2017

1.0.4

1.0.4.0

Autoload of vendors and autoload of deployer tasks.

  Sources   Download

MIT

The Requires

 

by Krystian Szymukowicz

deployer

01/10 2017

1.0.3

1.0.3.0

Autoload of vendors and autoload of deployer tasks.

  Sources   Download

MIT

The Requires

 

by Krystian Szymukowicz

deployer

01/10 2017

1.0.2

1.0.2.0

Autoload of vendors and autoload of deployer tasks.

  Sources   Download

MIT

The Requires

 

by Krystian Szymukowicz

deployer

01/10 2017

1.0.1

1.0.1.0

Autoload of vendors and autoload of deployer tasks.

  Sources   Download

MIT

The Requires

 

by Krystian Szymukowicz

deployer

01/10 2017

1.0.0

1.0.0.0

Autoload of vendors and autoload of deployer tasks.

  Sources   Download

MIT

The Requires

 

by Krystian Szymukowicz

deployer

01/10 2017

0.0.1

0.0.1.0

Autoload of vendors and autoload of deployer tasks.

  Sources   Download

MIT

The Requires

 

by Krystian Szymukowicz

deployer