Download the PHP package northwoods/config without Composer

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

Northwoods Config

Build Status StyleCI Scrutinizer Code Quality Code Coverage Latest Stable Version Total Downloads License SensioLabsInsight

PHP configuration loading library. It is made to enable your application to have different configurations depending on the environment it is running in. For example, your application can have different configurations for testing, development, staging, and production.

It is not recommended to include your staging or production configuration in version control! To support system specific configuration, you may install josegonzalez/dotenv.

Installation

The best way to install and use this package is through composer:

Usage

There are several different ways to use this package. The most simple is to use the static factory:

Configuration can now be read using a "dot path":

This will load config/app.php and return the timezone key, if it exists.

Optionally, an environment can be set that will add an additional search path:

Now when app.timezone is requested, both config/dev/app.php and config/app.php will be searched for the timezone key and the first result will be returned.

Best Practice

It is not recommended to add your staging or production secrets to configuration files that are checked into source control. A better solution is to use an env loader such as josegonzalez/dotenv or vlucas/phpdotenv. This will allow writing PHP configuration files that read from getenv:

Refer the package documentation for how to populate env values from a .env file.

YAML Files

YAML configuration files are supported when the symfony/yaml package is installed:

Note: This assumes that all configuration files have a .yaml extension! If you wish to combine PHP and YAML files, create a custom ConfigCollection with ConfigFactory.

Decorators

It is also possible to replace variables in configuration by using the VariableDecorator. This allows you to define variables at runtime without changing configuration:

Now any configuration value that contains %cacheDir% will have it replaced with /tmp:

Would resolve to /tmp/emails when decorated.

ConfigInterface

All configuration containers must implement ConfigInterface.

get()

Configuration values are accessed using the get($path, $default) method.

The first parameter is a "dot path" to search for in the form file.key.extra. An unlimited depth is supported.

The second parameter is a default value that will be returned if the path cannot be resolved. If the default is not provided null will be used.

set()

Configuration values can also be set at runtime using the set($path, $value) method.

The first parameter is a "dot path" to set in the form file.key.extra. An unlimited depth is supported.

The second parameter is the value to set for the path.

Classes

The following classes are part of this package:

Functions

Getting and setting functionality is implemented by array_path and array_path_set:

Examples

See more examples in the examples folder.

PHP Configuration File

Example of a PHP configuration file:

YAML Configuration File

Example of a YAML configuration file:

Original Ownership

This library is a fork of sinergi/config, starting in July 2017, and has changed significantly. Thank you to Gabriel Bull for creating the original package!

License

Config is licensed under The MIT License (MIT).


All versions of config with dependencies

PHP Build Version
Package Version
Requires php Version >=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 northwoods/config contains the following files

Loading the files please wait ....