Download the PHP package sheikhheera/iconfig without Composer

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

Iconfig Build Status Latest Stable Version Total Downloads GitHub license

A very simple, smart, light-weight and dynamic configuration manager for PHP.

Iconfig (Instant Config) could be used as a stand alone component to manage the configuration of any php application. It can load settings saved in a php file and build an array which would be available at run time. It provides useful methods to set or retrieve any configuration at the run time of an application.

Installation

Iconfig uses Composer to make things easy.

Learn to use composer and add this to require (in your composer.json):

"sheikhheera/iconfig": "1.0.0"

And run:

composer update

Library on Packagist.

How It Works ?

Basically, php applications or mvc frameworks use array for configurations, for example, this is a sample of database configuration

An mvc framework or an application without any framework must have some common settings and user can configure those according to his/her need and most often all configuration files reside in a single folder, commonly, the config name is used. So, keeping that on mind, this dynamic configuration manager (or whatever you say) has been built, which loads all files from a given path. For example :

Initialization

Above code will load all files from the config folder (it expects arrays inside files) and will put everything in an array (groups using file name). Now, you can set/get any item from the array. For example, if you want to get the default item from the array, then you can use

Now, what is getDatabase() ? Actually, in this example, I've used the file name database.php for this array so I can use getDatabase() and setDatabase() to get or set an item. If I have a file named with session.php then I can use getSession() and setSession() to get or set any settings for session management. Which means, when you will pass the path (where you all configuration files are saved) to the constructor it'l load all 'php' files from that path/folder. So If, for example, in a folder named settings you have three files inside that folder as database.php, session.php and for example chache.php and if you initialize it using

Then, it'll load all three php files from the folder and it'll create one associative array using three groups like

Now, you can use this array to retrieve a setting or you can also set/change any predefined settings using dynamic methods.

Dynamic Methods

You can use setDatabase() and getDatabase to set/get database' configurations and setSession() and getSession for session and so on. These dynamic methods will be available to you after initialization, using php's overloading technic.

Using Alias

If you want you can set an Alias and can use methods statically like this :

Give Default Value

Also you can use a defult value like

Access Nested Arrays

If you have three database connections and all have a driver key then you can specify which driver key you want like

Use callbacks

You can use closure as getMethod($key, $callback)

Same could be used when setting a value like setDatabase('connections.pgsql.driver', 'pgsql').

Search Using find() Method

You can also use ::find() to search for an item as

Get All Using getAll() Method

Also you can use

Load More Files Using load() Method

You can also use

Well, that's all for now. Feel free to use or modify it to improve it's functionality or if you find any bug, please inform me. Hope, I'll be able to add more features in future In-Sha-Allah (on God's will). Thanks!


© 2013 Sheikh Heera. Licensed under MIT.


All versions of iconfig with dependencies

PHP Build Version
Package Version
Requires php Version >=5.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 sheikhheera/iconfig contains the following files

Loading the files please wait ....