Download the PHP package jinnguyen/puja-config without Composer
On this page you can find all versions of the php package jinnguyen/puja-config. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download jinnguyen/puja-config
More information about jinnguyen/puja-config
Files in jinnguyen/puja-config
Download jinnguyen/puja-config
More information about jinnguyen/puja-config
Files in jinnguyen/puja-config
Vendor jinnguyen
Package puja-config
Short Description Allow load multi configured files, access the configured value as an object
License Apache License 2.0
Package puja-config
Short Description Allow load multi configured files, access the configured value as an object
License Apache License 2.0
Please rate this library. Is it a good library?
Informations about the package puja-config
puja-config v1.0.0
Allow load multi configured files, access the configured value as an object
Install:
composer require jinnguyen/puja-config
Usage:
require 'path/to/vendor/autoload.php';
Example:
Folder tree:
root/ root/app/configure.php root/app/configure_local.php root/config/configure.php root/config/configure_local.php
File root/config/configure.php
$configures['database'] = array( 'host' => 'localhost', ); $configures['app_name'] = 'Puja/Config';
File root/config/configure_local.php
$configures['database'] = array( 'host' => 'remote_host', );
File root/app/configure.php
$configures['session'] = array( 'savePath' => '/tmp', );
File root/app/configure_local.php
$configures['session'] = array( 'savePath' => '/home/tmp', );
File root/demo.php:
include 'path/to/vendor/autoload.php'; use Puja\Configure\Configure; new Configure(array('config/', 'app/')); $databaseCfg = Configure::getInstance('database'); echo $databaseCfg->get('host'); // remote_host $sessionCfg = Configure::getInstance('session'); echo $sessionCfg->get('savePath'); // /home/tmp $allCfg = Configure::getInstance(); echo $allCfg->get('app_name'); // Puja/Config
Note
new Configure(array('config/', 'app/')); is same with
require config/configure.php require config/configure_local.php require app/configure.php require app/configure_local.php
So the values from configure_local.php will overwrite configure.php in same folder, the last folder will overwrite the previous folder.
All versions of puja-config with dependencies
PHP Build Version
Package Version
No informations.
The package jinnguyen/puja-config contains the following files
Loading the files please wait ....