Table Of Contents

Previous topic

Class Phalcon\Config

Next topic

Class Phalcon\Config\Exception

This Page

Class Phalcon\Config\Adapter\Ini

extends Phalcon\Config

Reads ini files and convert it to Phalcon\Config objects. Given the next configuration file:

  <?php

  [database]
  adapter = Mysql
  host = localhost
  username = scott
  password = cheetah
  name = test_db

  [phalcon]
  controllersDir = "../app/controllers/"
  modelsDir = "../app/models/"
  viewsDir = "../app/views/"

You can read it as follows:
<?php

$config = new Phalcon\Config\Adapter\Ini("path/config.ini");
echo $config->phalcon->controllersDir;
echo $config->database->username;

Methods

public __construct (string $filePath)

Phalcon\Config\Adapter\Ini constructor

public static Phalcon\Config __set_state (unknown $data) inherited from Phalcon\Config

Restores the state of a Phalcon\Config object