Config\Exception

extends class Phalcon\Exception implements Throwable Source on GitHub Methods final private Exception __clone () inherited from Exception Clone the exception public __construct ([string $message], [int $code], [Exception $previous]) inherited from Exception Exception constructor public __wakeup () inherited from Exception ... final public string getMessage () inherited from Exception Gets the Exception message final public int getCode () inherited from Exception Gets the Exception code fin

Config\Adapter\Yaml

extends class Phalcon\Config implements Countable, ArrayAccess Source on GitHub Reads YAML files and converts them to Phalcon\Config objects. Given the following configuration file: phalcon: baseuri: /phalcon/ controllersDir: !approot /app/controllers/ models: metadata: memory You can read it as follows: define('APPROOT', dirname(__DIR__)); $config = new Phalcon\Config\Adapter\Yaml("path/config.yaml", [ '!approot' => function($value) { return APPRO

Config\Adapter\Php

extends class Phalcon\Config implements Countable, ArrayAccess Source on GitHub Reads php files and converts them to Phalcon\Config objects. Given the next configuration file: <?php return array( 'database' => array( 'adapter' => 'Mysql', 'host' => 'localhost', 'username' => 'scott', 'password' => 'cheetah', 'dbname' => 'test_db' ), 'phalcon' => array( 'controllersDir' => '../app/controllers/', 'modelsDir' =&g

Config\Adapter\Json

extends class Phalcon\Config implements Countable, ArrayAccess Source on GitHub Reads JSON files and converts them to Phalcon\Config objects. Given the following configuration file: {"phalcon":{"baseuri":"\/phalcon\/"},"models":{"metadata":"memory"}} You can read it as follows: $config = new Phalcon\Config\Adapter\Json("path/config.json"); echo $config->phalcon->baseuri; echo $config->models->metadata; Methods public __construct (mixed $filePath) Phalcon\Config\Adapter\Json con

Config\Adapter\Ini

extends class Phalcon\Config implements Countable, ArrayAccess Source on GitHub Reads ini files and converts them to Phalcon\Config objects. Given the next configuration file: [database] adapter = Mysql host = localhost username = scott password = cheetah dbname = test_db [phalcon] controllersDir = "../app/controllers/" modelsDir = "../app/models/" viewsDir = "../app/views/" You can read it as follows: $config = new Phalcon\Config\Adapter\Ini("path/config.ini");

Config::__set_state

public static __set_state (array $data) Restores the state of a Phalcon\Config object

Config::toArray

public toArray () Converts recursively the object to an array print_r($config->toArray());

Config::offsetUnset

public offsetUnset (mixed $index) Unsets an attribute using the array-syntax unset($config['database']);

Config::offsetSet

public offsetSet (mixed $index, mixed $value) Sets an attribute using the array-syntax $config['database'] = array('type' => 'Sqlite');

Config::offsetGet

public offsetGet (mixed $index) Gets an attribute using the array-syntax print_r($config['database']);