2017 © Pedro Peláez
 

library configee-php

Configee: A dead simple config manager for php

image

jwyuen/configee-php

Configee: A dead simple config manager for php

  • Friday, February 23, 2018
  • by jwingy
  • Repository
  • 2 Watchers
  • 0 Stars
  • 122 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 6 Versions
  • 4 % Grown

The README.md

Configee for PHP!

What is it?

A php library that you can add to any project to help you manage application specific php config files, such as database connection parameters. For example, if you were creating a PHP framework, you'd want anyone using your project to be able to define their own config parameters for connecting to their own database., (*1)

What is the purpose?

The purpose is to have a dead simple interface for setting and getting configuration parameters by only having to define config files., (*2)

Install

Just add to your composer.json like:, (*3)

{
  "require": {
    "jwyuen/configee-php": "1.1"
  }
}

Usage

Instantiate the main class wherever you need to use your configuration parameters, such as a bootstrap file., (*4)

$configee = new \Configee\Configee('your/config/path');
$config = $configee->getConfig();

Config Parsing Structure

Configee can handle an n-deep directory structure if you so choose to nest your configs like so. The only requirement is that your config files are php files and return an array., (*5)

For example, consider the following directory structure:, (*6)

configroot
\- db
 |- mysql.php
 \- AnEmptyFolder
\-general.php

Contents of mysql.php:, (*7)

<?php

return array(
  'host' => 'localhost',
  'user' => 'amysqluser',
  'password' => 'apassword',
);

Contents of general.php, (*8)

<?php

return array(
  'use_cookies' => true,
  'aconfigoption' => 1,
);

Given the above, you'll get a config structure like so:, (*9)

array(
  "db" => array(
    "mysql" => array(
      "host" => "localhost",
      "user" => "amysqluser",
      "password" => "apassword"
    )
  ),
  "general" => array(
    "use_cookies" => true,
    "aconfigoption" => 1
  )
)

Important PSA

If you decide to store sensitive credentials in your config(s), make sure to set proper permissions on them to make sure not just anyone can look at them! E.g., (*10)

chmod 640 <your-config-file>

The Versions

23/02 2018

dev-master

9999999-dev

Configee: A dead simple config manager for php

  Sources   Download

MIT MIT License

The Requires

  • php >=5.3.0

 

The Development Requires

by James Yuen

php configuration config

23/02 2018

v1.3

1.3.0.0

Configee: A dead simple config manager for php

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

by James Yuen

php configuration config

23/07 2014

v1.2

1.2.0.0

Configee: A dead simple config manager for php

  Sources   Download

MIT License

The Requires

  • php >=5.3.0

 

The Development Requires

by James Yuen

php configuration config

23/07 2014

dev-nilaratna

dev-nilaratna

Configee: A dead simple config manager for php

  Sources   Download

MIT License

The Requires

  • php >=5.3.0

 

The Development Requires

by James Yuen

php configuration config

18/03 2014

v1.1

1.1.0.0

Configee: A dead simple config manager for php

  Sources   Download

MIT License

The Requires

  • php >=5.3.0

 

The Development Requires

by James Yuen

php configuration config

18/03 2014

v1.0

1.0.0.0

Configee: A dead simple config manager for php

  Sources   Download

MIT License

The Requires

  • php >=5.3.0

 

The Development Requires

by James Yuen

php configuration config