forked from laruence/yaf
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support multi-inheritance in ini configs
- Loading branch information
Showing
3 changed files
with
196 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
--TEST-- | ||
Check for multi inheritance of section | ||
--SKIPIF-- | ||
<?php if (!extension_loaded("yaf")) print "skip"; ?> | ||
--FILE-- | ||
<?php | ||
$config = new Yaf_Config_Ini(dirname(__FILE__) . "/multi-section.ini"); | ||
print_r($config->toArray()); | ||
|
||
?> | ||
--EXPECTF-- | ||
Array | ||
( | ||
[base] => Array | ||
( | ||
[base] => Array | ||
( | ||
[a] => 1 | ||
[b] => 2 | ||
) | ||
|
||
) | ||
|
||
[extra] => Array | ||
( | ||
[base] => Array | ||
( | ||
[c] => 3 | ||
) | ||
|
||
) | ||
|
||
[foo] => Array | ||
( | ||
[base] => Array | ||
( | ||
[d] => 4 | ||
) | ||
|
||
) | ||
|
||
[multi] => Array | ||
( | ||
[base] => Array | ||
( | ||
[d] => 4 | ||
[a] => 1 | ||
[b] => 2 | ||
[c] => 3 | ||
) | ||
|
||
) | ||
|
||
[] => Array | ||
( | ||
[base] => Array | ||
( | ||
[d] => 4 | ||
) | ||
|
||
) | ||
|
||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[base ] | ||
base.a=1 | ||
base.b=2 | ||
[ extra] | ||
base.c=3 | ||
[ foo] | ||
base.d=4 | ||
|
||
[ multi:: extra: base : foo ] | ||
[ ::multi2::::: base:] | ||
[: : :: : foo] |