1# 2# S P Y C 3# a simple php yaml class 4# 5# authors: [vlad andersen (vlad.andersen@gmail.com), chris wanstrath (chris@ozmm.org)] 6# websites: [http://www.yaml.org, http://spyc.sourceforge.net/] 7# license: [MIT License, http://www.opensource.org/licenses/mit-license.php] 8# copyright: (c) 2005-2006 Chris Wanstrath, 2006-2014 Vlad Andersen 9# 10# spyc.yaml - A file containing the YAML that Spyc understands. 11 12--- 13 14# Mappings - with proper types 15String: Anyone's name, really. 16Int: 13 17BadHex: f0xf3 18Hex: 0xf3 19True: true 20False: false 21Zero: 0 22Null: NULL 23NotNull: 'null' 24NotTrue: 'y' 25NotBoolTrue: 'true' 26NotInt: '5' 27Float: 5.34 28Negative: -90 29SmallFloat: 0.7 30NewLine: \n 31QuotedNewLine: "\n" 32 33# A sequence 34- PHP Class 35- Basic YAML Loader 36- Very Basic YAML Dumper 37 38# A sequence of a sequence 39- 40 - YAML is so easy to learn. 41 - Your config files will never be the same. 42 43# Sequence of mappings 44- 45 cpu: 1.5ghz 46 ram: 1 gig 47 os : os x 10.4.1 48 49# Mapped sequence 50domains: 51 - yaml.org 52 - php.net 53 54# A sequence like this. 55- program: Adium 56 platform: OS X 57 type: Chat Client 58 59# A folded block as a mapped value 60no time: > 61 There isn't any time 62 for your tricks! 63 64 Do you understand? 65 66# A literal block as a mapped value 67some time: | 68 There is nothing but time 69 for your tricks. 70 71# Crazy combinations 72databases: 73 - name: spartan 74 notes: 75 - Needs to be backed up 76 - Needs to be normalized 77 type: mysql 78 79# You can be a bit tricky 80"if: you'd": like 81 82# Inline sequences 83- [One, Two, Three, Four] 84 85# Nested Inline Sequences 86- [One, [Two, And, Three], Four, Five] 87 88# Nested Nested Inline Sequences 89- [This, [Is, Getting, [Ridiculous, Guys]], Seriously, [Show, Mercy]] 90 91# Inline mappings 92- {name: chris, age: young, brand: lucky strike} 93 94# Nested inline mappings 95- {name: mark, age: older than chris, brand: [marlboro, lucky strike]} 96 97# References -- they're shaky, but functional 98dynamic languages: &DLANGS 99 - Perl 100 - Python 101 - PHP 102 - Ruby 103compiled languages: &CLANGS 104 - C/C++ 105 - Java 106all languages: 107 - *DLANGS 108 - *CLANGS 109 110# Added in .2.2: Escaped quotes 111- you know, this shouldn't work. but it does. 112- 'that''s my value.' 113- 'again, that\'s my value.' 114- "here's to \"quotes\", boss." 115 116# added in .2.3 117- {name: "Foo, Bar's", age: 20} 118 119# Added in .2.4: bug [ 1418193 ] Quote Values in Nested Arrays 120- [a, ['1', "2"], b] 121 122# Add in .5.2: Quoted new line values. 123- "First line\nSecond line\nThird line" 124 125# Added in .2.4: malformed YAML 126all 127 javascripts: [dom1.js, dom.js] 128 129# Added in .2 1301040: Ooo, a numeric key! # And working comments? Wow! Colons in comments: a menace (0.3). 131 132hash_1: Hash #and a comment 133hash_2: "Hash #and a comment" 134"hash#3": "Hash (#) can appear in key too" 135 136float_test: 1.0 137float_test_with_quotes: '1.0' 138float_inverse_test: 001 139 140a_really_large_number: 115792089237316195423570985008687907853269984665640564039457584007913129639936 # 2^256 141 142int array: [ 1, 2, 3 ] 143 144array on several lines: 145 [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 146 10, 11, 12, 13, 14, 15, 16, 17, 18, 19 ] 147 148morelesskey: "<value>" 149 150array_of_zero: [0] 151sophisticated_array_of_zero: {rx: {tx: [0]} } 152 153switches: 154 - { row: 0, col: 0, func: {tx: [0, 1]} } 155 156empty_sequence: [ ] 157empty_hash: { } 158 159special_characters: "[{]]{{]]" 160 161asterisks: "*" 162 163empty_key: 164 : 165 key: value 166 167trailing_colon: "foo:" 168 169multiline_items: 170 - type: SomeItem 171 values: [blah, blah, blah, 172 blah] 173 ints: [2, 54, 12, 174 2143] 175 176many_lines: | 177 A quick 178 fox 179 180 181 jumped 182 over 183 184 185 186 187 188 a lazy 189 190 191 192 dog 193 194 195werte: 196 1: nummer 1 197 0: Stunde 0 198 199noindent_records: 200- record1: value1 201- record2: value2 202 203"a:1": [1000] 204"a:2": 205 - 2000 206a:3: [3000] 207 208complex_unquoted_key: 209 a:b:''test': value 210 211array with commas: 212 ["0","1"] 213 214invoice: ["Something", "", '', "Something else"] 215quotes: ['Something', "Nothing", 'Anything', "Thing"] 216 217# [Endloop] 218endloop: | 219 Does this line in the end indeed make Spyc go to an infinite loop? 220