Download the PHP package mtymek/expressive-config-manager without Composer

On this page you can find all versions of the php package mtymek/expressive-config-manager. 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 expressive-config-manager

Expressive Configuration Manager

Deprecated! This library was merged into Zend Framework organization as zend-config-aggregator - please use it instead.


Lightweight library for collecting and merging configuration from different sources.

It is designed for zend-expressive applications, but it can work with any PHP project.

Usage

Config files

At the basic level, ConfigManager can be used to merge PHP-based configuration files:

Each file should return plain PHP array:

Result:

Configuration is merged in the same order as it is passed, with later entries having precedence.

Config providers

ConfigManager works by aggregating "Config Providers" passed when creating object. Each provider should be a callable, returning configuration array (or generator) to be merged.

If provider is a class name, it is automatically instantiated. This can be used to mimic ZF2 module system - you can specify list of config classes from different packages, and aggregated configuration will be available to your application. Or, as a library owner you can distribute config class with default values.

Example:

Output from both examples will be the same:

Caching

In order to enable configuration cache, pass cache file name as a second parameter to ConfigManager constructor:

When cache file is specified, you will also need to add config_cache_enabled key to the config, and set it to TRUE (use ConfigManager::ENABLE_CACHE constant for convenience). This allows to enable cache during deployment by simply putting extra *.local.php file in config directory:

When caching is enabled, ConfigManager does not iterate config providers. Because of that it is very fast, but after it is enabled you cannot do any changes to configuration without clearing the cache. Caching should be used only in production environment, and your deployment process should clear the cache.

Generators

Config providers can be written as generators. This way single callable can provide multiple configurations:

PhpFileProvider is implemented using generators.

Available config providers

PhpFileProvider

Loads configuration from PHP files returning arrays, like this one:

Wildcards are supported:

Example above will merge all matching files from config directory - if you have files like app.global.php, database.global.php, they will be loaded using this few lines of code.

Internally, ZendStdlib\Glob is used for resolving wildcards, meaning that you can use more complex patterns (for instance: 'config/autoload/{{,*.}global,{,*.}local}.php'), that will work even on Windows platform.

ZendConfigProvider

Sometimes using plain PHP files may be not enough - you may want to build your configuration from multiple files of different formats: INI, YAML, or XML. For this purpose you can leverage ZendConfigProvider:

ZendConfigProvider accepts wildcards and autodetects config type based on file extension.

ZendConfigProvider requires two packages to be installed: zendframework/zend-config and zendframework/zend-servicemanager. Some config readers (JSON, YAML) may need additional dependencies - please refer to Zend Config Manual for more details.


All versions of expressive-config-manager with dependencies

PHP Build Version
Package Version
Requires php Version ^5.5 || ^7.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 mtymek/expressive-config-manager contains the following files

Loading the files please wait ....