<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>lib/util/sfYamlDumper.class.php</filename>
    </added>
    <added>
      <filename>lib/util/sfYamlParser.class.php</filename>
    </added>
    <added>
      <filename>test/unit/util/fixtures/yaml/YtsAnchorAlias.yml</filename>
    </added>
    <added>
      <filename>test/unit/util/fixtures/yaml/YtsBasicTests.yml</filename>
    </added>
    <added>
      <filename>test/unit/util/fixtures/yaml/YtsBlockMapping.yml</filename>
    </added>
    <added>
      <filename>test/unit/util/fixtures/yaml/YtsDocumentSeparator.yml</filename>
    </added>
    <added>
      <filename>test/unit/util/fixtures/yaml/YtsErrorTests.yml</filename>
    </added>
    <added>
      <filename>test/unit/util/fixtures/yaml/YtsFlowCollections.yml</filename>
    </added>
    <added>
      <filename>test/unit/util/fixtures/yaml/YtsFoldedScalars.yml</filename>
    </added>
    <added>
      <filename>test/unit/util/fixtures/yaml/YtsNullsAndEmpties.yml</filename>
    </added>
    <added>
      <filename>test/unit/util/fixtures/yaml/YtsSpecificationExamples.yml</filename>
    </added>
    <added>
      <filename>test/unit/util/fixtures/yaml/YtsTypeTransfers.yml</filename>
    </added>
    <added>
      <filename>test/unit/util/fixtures/yaml/index.yml</filename>
    </added>
    <added>
      <filename>test/unit/util/fixtures/yaml/sfComments.yml</filename>
    </added>
    <added>
      <filename>test/unit/util/fixtures/yaml/sfTests.yml</filename>
    </added>
    <added>
      <filename>test/unit/util/sfYamlDumperTest.php</filename>
    </added>
    <added>
      <filename>test/unit/util/sfYamlParserTest.php</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -63,15 +63,6 @@ Url:       http://www.pradosoft.com/
 Copyright: 2004-2006, The PRADO Group
 License:   BSD - see licenses/LICENSE.prado file
 
-Spyc
-----
-
-symfony contains the Spyc software
-
-Url:       http://spyc.sourceforge.net/
-Copyright: 2005-2006 Chris Wanstrath
-License:   MIT - http://www.opensource.org/licenses/mit-license.php
-
 lime
 ----
 </diff>
      <filename>COPYRIGHT</filename>
    </modified>
    <modified>
      <diff>@@ -352,8 +352,9 @@ class sfCoreAutoload
   'sfParameterHolder' =&gt; 'util',
   'sfToolkit' =&gt; 'util',
   'sfYaml' =&gt; 'util',
+  'sfYamlDumper' =&gt; 'util',
   'sfYamlInline' =&gt; 'util',
-  'Spyc' =&gt; 'util',
+  'sfYamlParser' =&gt; 'util',
   'sfValidatorI18nChoiceCountry' =&gt; 'validator/i18n',
   'sfValidatorI18nChoiceLanguage' =&gt; 'validator/i18n',
   'sfValidator' =&gt; 'validator',</diff>
      <filename>lib/autoload/sfCoreAutoload.class.php</filename>
    </modified>
    <modified>
      <diff>@@ -61,7 +61,7 @@ abstract class sfYamlConfigHandler extends sfConfigHandler
     // parse our config
     $config = sfYaml::load($configFile);
 
-    if ($config === false || $config === null)
+    if ($config === false)
     {
       // configuration couldn't be parsed
       throw new sfParseException(sprintf('Configuration file &quot;%s&quot; could not be parsed', $configFile));</diff>
      <filename>lib/config/sfYamlConfigHandler.class.php</filename>
    </modified>
    <modified>
      <diff>@@ -282,7 +282,7 @@ class sfPropelData extends sfData
     // save to file(s)
     if (!is_dir($directory_or_file))
     {
-      file_put_contents($directory_or_file, sfYaml::dump($dumpData));
+      file_put_contents($directory_or_file, sfYaml::dump($dumpData, 3));
     }
     else
     {
@@ -294,7 +294,7 @@ class sfPropelData extends sfData
           continue;
         }
 
-        file_put_contents(sprintf(&quot;%s/%03d-%s.yml&quot;, $directory_or_file, ++$i, $tableName), sfYaml::dump(array($tableName =&gt; $dumpData[$tableName])));
+        file_put_contents(sprintf(&quot;%s/%03d-%s.yml&quot;, $directory_or_file, ++$i, $tableName), sfYaml::dump(array($tableName =&gt; $dumpData[$tableName]), 3));
       }
     }
   }</diff>
      <filename>lib/plugins/sfPropelPlugin/lib/propel/sfPropelData.class.php</filename>
    </modified>
    <modified>
      <diff>@@ -897,7 +897,7 @@ class sfPropelDatabaseSchema
 
   public function asYAML()
   {
-    return sfYaml::dump(array($this-&gt;connection_name =&gt; $this-&gt;database));
+    return sfYaml::dump(array($this-&gt;connection_name =&gt; $this-&gt;database), 3);
   }
 
   protected function getNameAndAttributes($hash, $name_attribute = 'name')</diff>
      <filename>lib/plugins/sfPropelPlugin/lib/propel/sfPropelDatabaseSchema.class.php</filename>
    </modified>
    <modified>
      <diff>@@ -90,7 +90,7 @@ EOF;
     }
     else
     {
-      fwrite(STDOUT, sfYaml::dump($data-&gt;getData('all', $options['connection'])));
+      fwrite(STDOUT, sfYaml::dump($data-&gt;getData('all', $options['connection']), 3));
     }
   }
 }</diff>
      <filename>lib/plugins/sfPropelPlugin/lib/task/sfPropelDataDumpTask.class.php</filename>
    </modified>
    <modified>
      <diff>@@ -85,7 +85,7 @@ EOF;
       'param' =&gt; array_merge(isset($config[$options['env']][$options['name']]['param']) ? $config[$options['env']][$options['name']]['param'] : array(), array('dsn' =&gt; $arguments['dsn'])),
     );
 
-    file_put_contents($file, sfYaml::dump($config));
+    file_put_contents($file, sfYaml::dump($config, 4));
 
     // update propel.ini
     if (</diff>
      <filename>lib/task/configure/sfConfigureDatabaseTask.class.php</filename>
    </modified>
    <modified>
      <diff>@@ -44,7 +44,7 @@ class sfYaml
       return $input;
     }
 
-    // syck is prefered over spyc
+    // syck is prefered over sfYamlParser
     if (function_exists('syck_load'))
     {
       $retval = syck_load($input);
@@ -53,11 +53,10 @@ class sfYaml
     }
     else
     {
-      require_once(dirname(__FILE__).'/Spyc.class.php');
+      require_once dirname(__FILE__).'/sfYamlParser.class.php';
+      $yaml = new sfYamlParser();
 
-      $spyc = new Spyc();
-
-      return $spyc-&gt;load($input);
+      return $yaml-&gt;parse($input);
     }
   }
 
@@ -71,7 +70,7 @@ class sfYaml
    *
    * @return string
    */
-  public static function dump($array)
+  public static function dump($array, $inline = 2)
   {
     if (function_exists('syck_dump'))
     {
@@ -79,11 +78,10 @@ class sfYaml
     }
     else
     {
-      require_once(dirname(__FILE__).'/Spyc.class.php');
-
-      $spyc = new Spyc();
+      require_once dirname(__FILE__).'/sfYamlDumper.class.php';
+      $yaml = new sfYamlDumper();
 
-      return $spyc-&gt;dump($array, false, 0);
+      return $yaml-&gt;dump($array, $inline);
     }
   }
 </diff>
      <filename>lib/util/sfYaml.class.php</filename>
    </modified>
    <modified>
      <diff>@@ -80,6 +80,10 @@ class sfYamlInline
         return &quot;''&quot;;
       case preg_match(self::getTimestampRegex(), $value):
         return &quot;'$value'&quot;;
+      case in_array(strtolower($value), array('true', 'on', '+', 'yes', 'y')):
+        return &quot;'$value'&quot;;
+      case in_array(strtolower($value), array('false', 'off', '-', 'no', 'n')):
+        return &quot;'$value'&quot;;
       default:
         return $value;
     }</diff>
      <filename>lib/util/sfYamlInline.class.php</filename>
    </modified>
    <modified>
      <diff>@@ -85,7 +85,7 @@ $testsForDump = array(
   '[\'foo,bar\', \'foo bar\']' =&gt; array('foo,bar', 'foo bar'),
 
   // mappings
-  '{ foo: bar, bar: foo, false: false, null: null, integer: 12 }' =&gt; array('foo' =&gt; 'bar', 'bar' =&gt; 'foo', 'false' =&gt; false, 'null' =&gt; null, 'integer' =&gt; 12),
+  '{ foo: bar, bar: foo, \'false\': false, null: null, integer: 12 }' =&gt; array('foo' =&gt; 'bar', 'bar' =&gt; 'foo', 'false' =&gt; false, 'null' =&gt; null, 'integer' =&gt; 12),
   '{ foo: bar, bar: \'foo: bar\' }' =&gt; array('foo' =&gt; 'bar', 'bar' =&gt; 'foo: bar'),
 
   // nested sequences and mappings</diff>
      <filename>test/unit/util/sfYamlInlineTest.php</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>lib/util/Spyc.class.php</filename>
    </removed>
    <removed>
      <filename>test/unit/util/SpycTest.php</filename>
    </removed>
    <removed>
      <filename>test/unit/util/fixtures/Spyc/YtsAnchorAlias.yml</filename>
    </removed>
    <removed>
      <filename>test/unit/util/fixtures/Spyc/YtsBasicTests.yml</filename>
    </removed>
    <removed>
      <filename>test/unit/util/fixtures/Spyc/YtsBlockMapping.yml</filename>
    </removed>
    <removed>
      <filename>test/unit/util/fixtures/Spyc/YtsDocumentSeparator.yml</filename>
    </removed>
    <removed>
      <filename>test/unit/util/fixtures/Spyc/YtsErrorTests.yml</filename>
    </removed>
    <removed>
      <filename>test/unit/util/fixtures/Spyc/YtsFlowCollections.yml</filename>
    </removed>
    <removed>
      <filename>test/unit/util/fixtures/Spyc/YtsFoldedScalars.yml</filename>
    </removed>
    <removed>
      <filename>test/unit/util/fixtures/Spyc/YtsNullsAndEmpties.yml</filename>
    </removed>
    <removed>
      <filename>test/unit/util/fixtures/Spyc/YtsSpecificationExamples.yml</filename>
    </removed>
    <removed>
      <filename>test/unit/util/fixtures/Spyc/YtsTypeTransfers.yml</filename>
    </removed>
    <removed>
      <filename>test/unit/util/fixtures/Spyc/index.yml</filename>
    </removed>
    <removed>
      <filename>test/unit/util/fixtures/Spyc/sfComments.yml</filename>
    </removed>
    <removed>
      <filename>test/unit/util/fixtures/Spyc/sfTests.yml</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>cc901dee2d02ba6b0a333bbc68f993c27b104a65</id>
    </parent>
  </parents>
  <author>
    <name>fabien</name>
    <email>fabien@ee427ae8-e902-0410-961c-c3ed070cd9f9</email>
  </author>
  <url>http://github.com/WIZARDISHUNGRY/symfony/commit/b094cdde6352ab1dffd1bca30e130022ea6bbede</url>
  <id>b094cdde6352ab1dffd1bca30e130022ea6bbede</id>
  <committed-date>2008-03-14T14:59:38-07:00</committed-date>
  <authored-date>2008-03-14T14:59:38-07:00</authored-date>
  <message>replaced Spyc with a new YAML parser/dumper (closes #3083, #2887, #2622, #2514, #1966, #1339, #3016)

  * removed Spyc
  * added sfYamlParser, sfYamlDumper (should be totally BC thanks to the unit tests)
  * the parser and the dumper are much more robust and much more easier to fix
  * exceptions are thrown when a non valid YAML file is parsed (when you forget a : after a key for example, or if the indentation is not right ;))
  * fixed a bunch of bugs of the old parser
  * speed is more or less the same as Spyc
  * added an option to control the dump to switch from the block to the flow notation (propel:build-schema is now much more readable in YAML)
  * added more unit tests



git-svn-id: http://svn.symfony-project.com/branches/1.1@7892 ee427ae8-e902-0410-961c-c3ed070cd9f9</message>
  <tree>e1597760981e3f800046ff1477f9f9d74a6ea372</tree>
  <committer>
    <name>fabien</name>
    <email>fabien@ee427ae8-e902-0410-961c-c3ed070cd9f9</email>
  </committer>
</commit>
