Skip to content
Browse files

Upgrading version to spyc 0.4.5

  • Loading branch information...
1 parent 501cea8 commit e52a7710f5bc0fe8b0a0c2cdddcc90a54ed611fa vlad.andersen committed Sep 20, 2009
Showing with 7 additions and 19 deletions.
  1. +4 −4 README
  2. +1 −13 examples/yaml-dump.php
  3. +2 −2 spyc.php
View
8 README
@@ -7,12 +7,12 @@
#
--- %YAML:1.1
title: Spyc -- a Simple PHP YAML Class
-version: 0.4.2
-author: [chris wanstrath, chris@ozmm.org]
+version: 0.4.5
+authors: [chris wanstrath (chris@ozmm.org), vlad andersen (vlad.andersen@gmail.com)]
websites: [http://www.yaml.org, http://spyc.sourceforge.net]
license: [MIT License, http://www.opensource.org/licenses/mit-license.php]
-copyright: (c) 2005-2006 Chris Wanstrath
-tested on: [php 5.2]
+copyright: "(c) 2005-2006 Chris Wanstrath, 2006-2009 Vlad Andersen"
+tested on: [php 5.2.x]
installation: >
Copy spyc.php to a directory you can
View
14 examples/yaml-dump.php
@@ -3,12 +3,6 @@
#
# S P Y C
# a simple php yaml class
-# v0.2(.5)
-#
-# author: [chris wanstrath, chris@ozmm.org]
-# websites: [http://www.yaml.org, http://spyc.sourceforge.net/]
-# license: [MIT License, http://www.opensource.org/licenses/mit-license.php]
-# copyright: (c) 2005-2006 Chris Wanstrath
#
# Feel free to dump an array to YAML, and then to load that YAML back into an
# array. This is a good way to test the limitations of the parser and maybe
@@ -28,10 +22,4 @@
$array['Old Dog'] = "And if you want\n to preserve line breaks, \ngo ahead!";
$array['key:withcolon'] = "Should support this to";
-$yaml = Spyc::YAMLDump($array,4,60);
-
-echo '<pre>A PHP array run through YAMLDump():<br/>';
-print_r($yaml);
-echo '</pre>';
-
-?>
+$yaml = Spyc::YAMLDump($array,4,60);
View
4 spyc.php
@@ -1,7 +1,7 @@
<?php
/**
* Spyc -- A Simple PHP YAML Class
- * @version 0.4.2
+ * @version 0.4.5
* @author Vlad Andersen <vlad.andersen@gmail.com>
* @author Chris Wanstrath <chris@ozmm.org>
* @link http://code.google.com/p/spyc/
@@ -319,7 +319,7 @@ private function _dumpNode($key, $value, $indent, $previous_key = -1, $first_key
// It's a sequence
$string = $spaces.'- '.$value."\n";
} else {
- // if ($first_key===0) throw new Exception('Keys are all screwy. The first one was zero, now it\'s "'. $key .'"');
+ if ($first_key===0) throw new Exception('Keys are all screwy. The first one was zero, now it\'s "'. $key .'"');
// It's mapped
if (strpos($key, ":") !== false) { $key = '"' . $key . '"'; }
$string = $spaces.$key.': '.$value."\n";

0 comments on commit e52a771

Please sign in to comment.
Something went wrong with that request. Please try again.