SPHPlayground API
SPHPlayground
sphplayground sphplayground

Application configuration

BASIC INFORMATION:

Applications require a centralized place where settings are stored. All the values stored here are required to configure the behavior of the application and to define the resources for other entities of the application. [1]

Application configuration contains tools for storing configuration variables and PHP runtime environment manipulation

Config a general configuration manager

A Config object can be used to store any type of PHP variables. An application can have multiple named singleton configuration objects. These objects are accessible via a static Config::instance() method.

PHP is a runtime PHP environment manager container

PHP utility class handles common PHP configuration related tasks via build-in singleton PHPConfig and named PHPIni instances.

Manipulating include paths

The include_path string specifies a list of directories where the require, include, fopen(), file(), readfile() and file_get_contents() functions look for files.[2]

This static utility class manipulates the include_path configuration option for the duration of the script. With it is possible to extend the include path regardless of the operating system.

  1. IncludePaths::addPaths() adds new paths to the already existing include path configuration option.
  2. IncludePaths::setPaths() Sets the include_path configuration option.

PHPIni manipulates configuration options

PHPIni::set() sets the value of the given configuration option. However only the PHPIni::init() sets these options to the system. The configuration option will keep this new value during the script's execution, and will be restored at the script's ending[3]. Not all the available options can be changed using ini_set(). These are all available options in this list.