Download the PHP package sugiphp/config without Composer

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

Config

Build Status

Installation

SugiPHP\Config is designed to simplify access to configuration settings. Config class natively supports reading and parsing configuration options from several file types (php, json, yaml, ini, xml) stored in one or several locations in your project. Config::get("file.key") method automatically finds configuration file, loads it, parses it and then searches for the key and returns it's value. If the file or the key is not found gracefully returns NULL or some other default value if it is provided like a second parameter.

Usage

You can use different file types to store settings:

To access the host option no matter wich type of configurations file you use:

FileLocator

FileLocator is used to search for a (configuration) file in one or more directories.

Loader

A loader binds a key with a corresponding value which can be found somewhere (in a file, in a database, etc.) and can be in any form (a php array, json string, xml, etc.). A simple example that explains a loader: Lets assume your application resides in a "/path/to/app", and your configuration files are in "/path/to/app/config" path. Your application needs a database connection. The host, database, user and password are described in a PHP file living in configuration directory. You can use a loader which will include a file (a $key = "database" with ".php" extension) in that folder and return the contents, like the PHP code will do:

A slightly more complicated example is when a database is described in an json format. So the loader will do something like:

Another example is if some of your app configurations are stored not in files but lets say in a NoSQL storage. So you can write your custom loader which will connect to the NoSQL DB, fetch items and return them as array. And that's really easy, and the better thing is that your existing code will not need any modification.

You can peek in Database Loader for a simple database configuration store example.


All versions of config with dependencies

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

Loading the files please wait ....