Download the PHP package raphhh/puppy-config without Composer

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

Puppy Config

Latest Stable Version Build Status Scrutinizer Quality Score Code Coverage Dependency Status Total Downloads Reference Status License

Puppy Config is a config manager that loads your config from files according to your env.

Config basic logic:

Installation

Run composer:

Read your config

Add the main config file /config/global.php:

Launch the Config class:

Dynamic values

You can retrieve dynamically a previous defined value with it key.

Set new values

You can set new values on the fly, which will be available in the Config object during all the script (and not saved into a file config).

You can also use the dynamic mapping.

Visibility restriction

You can determine some namespaces in your config, and restrict the visibility of each namespace.

For example, imagine you set this config, with two namespaces: 'a' and 'b'.

With the global scope config you can access to all the values.

Now, restrict the config to the namespace 'a':

With this restricted scope config, you can only have access to the namespace 'a' values:

The original keys are not visible anymore:

But, the global scope config is still bound to your restricted scope. So, if you modify one, you modify the other.

Files format

By default, Config load 'php' files. This kind of file must return a PHP array.

But you can specify or add specific file formats.

Available formats:

Multi environment

Your config is the merge of the values coming from three kind of files:

type file name loading overloading usage
global config global.php always loaded prod & test
env config e.i. dev.php according to the env override global config dev
local config local.php specific for each machine override global and env config prod & test - dev

When is loaded the global config?

In all the cases, Config will load the file 'global.php'. (You can easily change this default file.)

By default, this is your prod config.

When is loaded the env config?

If you specify an env in the constructor, it will load also the associated file.

For example:

The env config will override the global config. So, use it for your dev env, which will override your prod params.

How env can change dynamically?

Set an environment variable in your server virtual host configuration, and retrieve it with the php getenv() method.

In your httpd.conf or a .htaccess file of your dev Apache server, put:

In your PHP file, retrieve the env:

What is the local config?

The config will load also a local config, if the file config/local.php exists.

This config will override the global and the env configs. Be careful: this file must be NOT versioned.

So, it is an individual config, where your can put temporary or specific config. Your can also put config you do not want to version, like the passwords.


All versions of puppy-config with dependencies

PHP Build Version
Package Version
Requires php Version >=5.5.9
symfony/yaml Version ^3.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 raphhh/puppy-config contains the following files

Loading the files please wait ....