Skip to content

Commit

Permalink
Update ext/config/adapter/ini.c
Browse files Browse the repository at this point in the history
No section.
No section items.
  • Loading branch information
kamijo committed Jul 11, 2013
1 parent 660ba13 commit 8a8509e
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions ext/config/adapter/ini.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,23 @@ PHP_METHOD(Phalcon_Config_Adapter_Ini, __construct){
PHALCON_GET_HKEY(section, ah0, hp0);
PHALCON_GET_HVALUE(directives);

if (unlikely(Z_TYPE_P(directives) != IS_ARRAY)) {
Z_ADDREF_P(directives);
if (phalcon_array_update_zval(&config, section, &directives, 0 TSRMLS_CC) != SUCCESS) {
Z_DELREF_P(directives);
}
zend_hash_move_forward_ex(ah0, &hp0);
continue;
}

phalcon_is_iterable(directives, &ah1, &hp1, 0, 0);

if (zend_hash_num_elements(ah1) == 0) {
phalcon_array_update_zval(&config, section, &directives, 0 TSRMLS_CC);
zend_hash_move_forward_ex(ah0, &hp0);
continue;
}

while (zend_hash_get_current_data_ex(ah1, (void**) &hd, &hp1) == SUCCESS) {

PHALCON_GET_HKEY(key, ah1, hp1);
Expand Down

0 comments on commit 8a8509e

Please sign in to comment.