Download the PHP package yiisoft/composer-config-plugin without Composer

On this page you can find all versions of the php package yiisoft/composer-config-plugin. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package composer-config-plugin

Composer Config Plugin


Composer plugin for config assembling.

⚠️ The plugin is no longer supported in favor of yiisoft/config.

Latest Stable Version Total Downloads Build status Scrutinizer Code Quality Code Coverage

This Composer plugin provides assembling of configurations distributed with composer packages. It allows putting configuration needed to use a package right inside of the package thus implementing a plugin system. The package becomes a plugin holding both the code and its configuration.

Documentation

How it works?

Read more about the general idea behind this plugin in English or Russian.

Installation

Out of the box this plugin supports configs in PHP and JSON formats.

To enable additional formats require:

Usage

List your config files in composer.json like the following:

Markers


Define your configs like the following:

A special variable $params is read from params config.

To load assembled configs in your application use require:

Using sub-configs

In some cases it is convenient to extract part of your config into another file. For example, we want to extract database configuration into db.php. To do it add the config to composer.json:

Create db.php:

Then in the config use Builder::require():

Refreshing config

Plugin uses composer POST_AUTOLOAD_DUMP event i.e. composer runs this plugin on install, update and dump-autoload commands. As the result configs are ready to be used right after package installation or update.

When you make changes to any of configs you may want to reassemble configs manually. In order to do it run:

Above can be shortened to composer du.

If you need to force config rebuilding from your application, you can do it like the following:

File processing order

Config files are processed in proper order to achieve naturally expected behavior:

Debugging

There are several ways to debug config building internals.

Above can be shortened to composer du -v.

Known issues

This plugin treats configs as simple PHP arrays. No specific structure or semantics are expected and handled. It is simple and straightforward, but I'm in doubt... What about errors and typos? I think about adding config validation rules provided together with plugins. Will it solve all the problems?

License

This project is released under the terms of the BSD-3-Clause license. Read more here.

Copyright © 2016-2020, HiQDev (http://hiqdev.com/) Copyright © 2020, Yiisoft (https://www.yiiframework.com/)


All versions of composer-config-plugin with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4|^8.0
ext-json Version *
composer-plugin-api Version ^1.0|^2.0
composer/composer Version ^1.0|^2.0
opis/closure Version 3.6.x-dev@dev
riimu/kit-phpencoder Version ^2.4
yiisoft/files Version ^1.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package yiisoft/composer-config-plugin contains the following files

Loading the files please wait ....