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\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

Contextual Escaping

Websites and web applications are vulnerable to XSS attacks and although PHP provides escaping functionality, in some contexts it is not sufficient/appropriate. Phalcon\Escaper provides contextual escaping and is written in Zephir, providing the minimal overhead when escaping different kinds of texts. We designed this component based on the XSS (Cross Site Scripting) Prevention Cheat Sheet created by the OWASP. Additionally, this component relies on mbstring to support almost any charset. To il

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::offsetUnset

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

Config::offsetGet

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

Config::toArray

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

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::offsetSet

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