[php] Spyc (YAML load/dump library) 使ったよ

YAML パーサに BogoYaml を使っていたのだけど, アンカー/エイリアスが使えないなぁ (多分) とボヤいたところ Spyc を教えて貰ったので乗り換えてみた。

spyc は現行バージョン (0.1.1 or rev 1.7) だと Notice を吐くので spyc の中だけ E_ALL & ~E_NOTICE にするか

spyc.php line 154
// The current node's parent is the same as the previous node's
if ($this->_allNodes[$this->_lastNode] instanceof YAMLNode) {
  $node->parent = @$this->_allNodes[$this->_lastNode]->parent;
}

ってな感じで囲うかエラー制御子を付けて回避する。他は問題なく動作している。

ちゃんと E_ALL で開発しましょうぜ〜