Created
January 26, 2015 07:16
-
-
Save dcb9/b4a4f8f3821e57653cad to your computer and use it in GitHub Desktop.
测试使用 Neon 配置,感觉非常棒
This file contains hidden or 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
{ | |
"require": { | |
"nette/neon": "*" | |
} | |
} |
This file contains hidden or 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
# neon file - edit it now! | |
name: Homer | |
address: | |
street: 742 Evergreen Terrace | |
city: Springfield | |
country: USA | |
phones: { home: 555-6528, work: 555-7334 } | |
children: | |
- Bart | |
- Lisa | |
- Maggie | |
entity: Column(type=integer) | |
special: "#characters put in quotes" | |
# this is a comment |
This file contains hidden or 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
<?php | |
include('./vendor/autoload.php'); | |
$content = file_get_contents('config.neon'); | |
$config = \Nette\Neon\Neon::decode($content); | |
echo "Raw data:\n==========\n"; | |
echo $content; | |
echo "Decode data:\n==========\n"; | |
print_r($config); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment