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