菜谱项目

sfMergeKey.yml 1.7KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. --- %YAML:1.0
  2. test: Simple In Place Substitution
  3. brief: >
  4. If you want to reuse an entire alias, only overwriting what is different
  5. you can use a << in place substitution. This is not part of the official
  6. YAML spec, but a widely implemented extension. See the following URL for
  7. details: http://yaml.org/type/merge.html
  8. yaml: |
  9. foo: &foo
  10. a: Steve
  11. b: Clark
  12. c: Brian
  13. e: notnull
  14. bar:
  15. a: before
  16. d: other
  17. e: ~
  18. <<: *foo
  19. b: new
  20. x: Oren
  21. c:
  22. foo: bar
  23. bar: foo
  24. foo2: &foo2
  25. a: Ballmer
  26. ding: &dong [ fi, fei, fo, fam]
  27. check:
  28. <<:
  29. - *foo
  30. - *dong
  31. isit: tested
  32. head:
  33. <<: [ *foo , *dong , *foo2 ]
  34. taz: &taz
  35. a: Steve
  36. w:
  37. p: 1234
  38. nested:
  39. <<: *taz
  40. d: Doug
  41. w: &nestedref
  42. p: 12345
  43. z:
  44. <<: *nestedref
  45. php: |
  46. array(
  47. 'foo' => array('a' => 'Steve', 'b' => 'Clark', 'c' => 'Brian', 'e' => 'notnull'),
  48. 'bar' => array('a' => 'before', 'd' => 'other', 'e' => null, 'b' => 'new', 'c' => array('foo' => 'bar', 'bar' => 'foo'), 'x' => 'Oren'),
  49. 'foo2' => array('a' => 'Ballmer'),
  50. 'ding' => array('fi', 'fei', 'fo', 'fam'),
  51. 'check' => array('a' => 'Steve', 'b' => 'Clark', 'c' => 'Brian', 'e' => 'notnull', 'fi', 'fei', 'fo', 'fam', 'isit' => 'tested'),
  52. 'head' => array('a' => 'Steve', 'b' => 'Clark', 'c' => 'Brian', 'e' => 'notnull', 'fi', 'fei', 'fo', 'fam'),
  53. 'taz' => array('a' => 'Steve', 'w' => array('p' => 1234)),
  54. 'nested' => array('a' => 'Steve', 'w' => array('p' => 12345), 'd' => 'Doug', 'z' => array('p' => 12345))
  55. )