Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dot directive parsing of ini files. #872

Merged
merged 2 commits into from Jul 18, 2013
Merged

dot directive parsing of ini files. #872

merged 2 commits into from Jul 18, 2013

Conversation

kjdev
Copy link
Contributor

@kjdev kjdev commented Jul 18, 2013

Update dot direvtive parse of Ini files.

INI file.

# test.ini
[test]
parent.property = On
parent.property2 = "yeah"
parent.property3.baseuri = /phalcon/
parent.property4.models.metadata = memory
parent.property5.database.adapter = mysql
parent.property5.database.host = localhost
parent.property5.database.username = user
parent.property5.database.password = passwd
parent.property5.database.name = demo
parent.property6.test[] = a
parent.property6.test[] = b
parent.property6.test[] = c

PHP execute.

$ini = new \Phalcon\Config\Adapter\Ini('/test.ini');
$ini->toArray();

Result (default)

array(
  'test' => array(
    'parent' => array(
      'property' => 1,
      'property2' => 'yeah',
      'property3' => '/phalcon/',
      'property4' => 'memory',
      'property5' => 'demo',
      'property6' => array(a', 'b', 'c'),
    )))

Result (Update source)

array(
  'test' => array(
    'parent' => array(
      'property' => 1,
      'property2' => 'yeah',
      'property3' => array('baseuri' => '/phalcon/'),
      'property4' => array(
        'models' => array('metadata' => 'memory')
      ),
      'property5' => array(
        'database' => array(
          'adapter' => 'mysql',
          'host' => 'localhost',
          'username' => 'user',
          'password' => 'passwd',
          'name' => 'demo')
        ),
      'property6' => array(
        'test' => array('a', 'b', 'c')
      ))))

phalcon pushed a commit that referenced this pull request Jul 18, 2013
dot directive parsing of ini files.
@phalcon phalcon merged commit 0a6b25b into phalcon:1.2.1 Jul 18, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants