Download the PHP package locomotivemtl/charcoal-config without Composer

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

Charcoal Config

License Latest Stable Version Code Quality Coverage Status SensioLabs Insight Build Status

A Charcoal component for organizing configuration data and designing object data models.

This component is the glue for much of the Charcoal framework.

Table of Contents

Installation

The preferred (and only supported) method is with Composer:

Requirements

PSR

Entity & Config

The Config component simplifies access to object data. It provides a property-based user interface for retrieving and storing arbitrary data within application code. Data is organized into two primary object types: Entity and Config.

Entity

Entities represent simple data-object containers designed as a flexible foundation for domain model objects.
Examples: a single result from a repository or serve as the basis for each component of an MVC system.

Config

Configs are advanced Entities designed for runtime configuration values with support for loading files and storing hierarchical data.
Examples: application preferences, service options, and factory settings.

Features

File Loader

The Config container currently supports four file formats: INI, JSON, PHP, and YAML.

A configuration file can be imported into a Config object via the addFile($path) method, or by direct instantiation:

The file's extension will be used to determine how to import the file. The file will be parsed and, if its an array, will be merged into the container.

If you want to load a configuration file without adding its content to the Config, use loadFile($path) instead. The file will be parsed and returned regardless if its an array.

Check out the examples for more information.

Key Separator Lookup

It is possible to lookup, retrieve, assign, or merge values in multi-dimensional arrays using key separators.

In Config objects, the default separator is the period character (.). The token can be retrieved with the separator() method and customized using the setSeparator() method.

Check out the documentation for more information.

Delegates Lookup

Delegates allow several objects to share values and act as fallbacks when the current object cannot resolve a given data key.

In Config objects, delegate objects are regsitered to an internal stack. If a data key cannot be resolved, the Config iterates over each delegate in the stack and stops on the first match containing a value that is not NULL.

Check out the documentation for more information.

Array Access

The Entity object implements the ArrayAccess interface and therefore can be used with array style:

👉 A data key MUST be a string otherwise InvalidArgumentException is thrown.

Interoperability

The Config object implements PSR-11: Psr\Container\ContainerInterface.

This interface exposes two methods: get() and has(). These methods are implemented by the Entity object as aliases of ArrayAccess::offsetGet() and ArrayAccess::offsetExists().

👉 A call to the get() method with a non-existing key DOES NOT throw an exception.

Configurable Objects

Also provided in this package is a Configurable mixin:

Configurable objects (which could have been called "Config Aware") can have an associated Config object that can help define various properties, states, or other.

The Config object can be assigned with setConfig() and retrieved with config().

An added benefit of ConfigurableTrait is the createConfig($data) method which is used to create a Config object if one is not assigned. This method can be overridden in sub-classes to customize the instance returned and whatever initial state might be needed.

Check out the documentation for examples and more information.

Development

To install the development environment:

To run the scripts (phplint, phpcs, and phpunit):

API Documentation

Development Dependencies

Coding Style

The charcoal-config module follows the Charcoal coding-style:

Coding style validation / enforcement can be performed with composer phpcs. An auto-fixer is also available with composer phpcbf.

This module should also throw no error when running phpstan analyse -l7 src/ 👍.

Credits

License

Charcoal is licensed under the MIT license. See LICENSE for details.


All versions of charcoal-config with dependencies

PHP Build Version
Package Version
Requires php Version >=5.6.0 || >=7.0
ext-json Version *
ext-spl Version *
psr/container 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 locomotivemtl/charcoal-config contains the following files

Loading the files please wait ....