My favorites | Sign in
Project Logo
                
Details: Show all Hide all

Last 7 days

  • Dec 10, 2009
    issue 31 (Line with single quotes does not get escaped with double quo...) commented on by tuxtiger   -   I added the characters to the _dumpNode long 'if' statement
    I added the characters to the _dumpNode long 'if' statement
  • Dec 10, 2009
    issue 31 (Line with single quotes does not get escaped with double quo...) reported by tuxtiger   -   $results = array(); $results['video_state'] = 'unknown'; $results['video_title'] = "'Biz' pimpt bedrijventerreinen"; echo Spyc::YAMLDump($results); returns: --- video_state: unknown video_title: 'Biz' pimpt bedrijventerreinen But the last line should be: video_title: "'Biz' pimpt bedrijventerreinen" I found the problem reading the output of spyc in perl YAML.pm, it crashes at the unescaped single quotes. I'm using the last version 0.4.5, on linux. Also an & character in the middle of a string does not trigger the escape mechanism. A hello&yes should be escaped to "hello&yes" Thanks
    $results = array(); $results['video_state'] = 'unknown'; $results['video_title'] = "'Biz' pimpt bedrijventerreinen"; echo Spyc::YAMLDump($results); returns: --- video_state: unknown video_title: 'Biz' pimpt bedrijventerreinen But the last line should be: video_title: "'Biz' pimpt bedrijventerreinen" I found the problem reading the output of spyc in perl YAML.pm, it crashes at the unescaped single quotes. I'm using the last version 0.4.5, on linux. Also an & character in the middle of a string does not trigger the escape mechanism. A hello&yes should be escaped to "hello&yes" Thanks

Last 30 days

  • Dec 02, 2009
    issue 22 (Incorrect parsing of Ruby YAML) commented on by gerrit.boettcher   -   there are much errors on your $msg/yaml output. missing some ":" and too much spaces... also much errors if you try to load this shit into python/PyYAML. i don't think that this ($msg) is 1:1 your ruby file.
    there are much errors on your $msg/yaml output. missing some ":" and too much spaces... also much errors if you try to load this shit into python/PyYAML. i don't think that this ($msg) is 1:1 your ruby file.
  • Dec 01, 2009
    issue 30 (Spyc::YAMLDump() generated unsuitable document) reported by cat.s.panch   -   What steps will reproduce the problem? 1. Spyc::YAMLDump() generate unsuitable document as YAML when the array contained string likes '&foo'. 2. For example --- some: &foo What is the expected output? What do you see instead? Should be quoted by '. For instance at the example above. --- some: '&foo' What version of the product are you using? On what operating system? 0.4.5 Please provide any additional information below. I evaded temporary with this way. --- spyc.php : 303 --- Add the condition strpos($value,"&") !== false ||
    What steps will reproduce the problem? 1. Spyc::YAMLDump() generate unsuitable document as YAML when the array contained string likes '&foo'. 2. For example --- some: &foo What is the expected output? What do you see instead? Should be quoted by '. For instance at the example above. --- some: '&foo' What version of the product are you using? On what operating system? 0.4.5 Please provide any additional information below. I evaded temporary with this way. --- spyc.php : 303 --- Add the condition strpos($value,"&") !== false ||
  • Nov 19, 2009
    ComparisonWithSyck Wiki page commented on by mail4smsuba   -   # # S P Y C # a simple php yaml class # # Load this README! # >> $readme = Spyc::YAMLLoad('README'); # --- %YAML:1.1 title: Spyc -- a Simple PHP YAML Class 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, 2006-2009 Vlad Andersen" tested on: [php 5.2.x] installation: > Copy spyc.php to a directory you can access with your YAML-ready PHP script. That's it! about: > From www.yaml.org: "YAML(tm) (rhymes with 'camel') is a human-friendly, cross language, Unicode based data serialization language designed around the common native data structures of agile programming languages. It is broadly useful for programming needs ranging from configuration files to Internet messaging to object persistence to data auditing. Together with the Unicode standard for characters, the YAML specification provides all the information necessary to understand YAML Version 1.1 and to creating programs that process YAML information. YAML(tm) is a balance of the following design goals: - YAML documents are very readable by humans. - YAML interacts well with scripting languages. - YAML uses host languages' native data structures. - YAML has a consistent information model. - YAML enables stream-based processing. - YAML is expressive and extensible. - YAML is easy to implement." YAML makes a lot of sense. It's easy to use, easy to learn, and cool. As the lucky stiff named why once said, "YAML is a beacon of light." If you're new to YAML, may we suggest YAML In Five Minutes: - http://yaml.kwiki.org/?YamlInFiveMinutes If you don't have five minutes, realize that this README is a completely valid YAML document. Dig in, load this or any YAML file into an array with Spyc and see how easy it is to translate friendly text into usable data. The purpose of Spyc is to provide a pure PHP alternative to Syck, a simple API for loading and dumping YAML documents, a YAML loader which understands a usable subset of the YAML spec, and to further spread the glory of YAML to the PHP masses. If you're at all hesitant ("usable subset of YAML?!"), navigate http://yaml.org/start.html. Spyc completely understands the YAML document shown there, a document which has features way beyond the scope of what normal config files might require. Try it for yourself, and then start enjoying the peace of mind YAML brings to your life. meat and a few potatoes: - concept: Loading a YAML document into PHP brief: > $yaml will become an array of all the data in wicked.yaml code: | include('spyc.php'); $yaml = Spyc::YAMLLoad('wicked.yaml'); - concept: Loading a YAML string into PHP brief: > $array will look like this: array('A YAML','document in a','string') code: | include('spyc.php'); $yaml = '- A YAML\n- document in a\n- string.'; $array = Spyc::YAMLLoad($yaml); - concept: Dumping a PHP array to YAML brief: > $yaml will become a string of a YAML document created from $array. code: | include('spyc.php'); $array['name'] = 'chris'; $array['sport'] = 'curbing'; $yaml = Spyc::YAMLDump($array); prior art: - who: [Brian Ingerson, Clark Evans, Oren Ben-Kiki] why?: > The YAML spec is really a piece of work, and these guys did a great job on it. A simple and elegant language like YAML was a long time coming and it's refreshing to know such able minded individuals took the task to heart and executed it with cunning and strength. In addition to their various noteworthy contributions to YAML parsers and related projects, YAML.pm's README is a treasure trove of information for knowledge seekers. Thanks, guys. - who: why the lucky stiff why?: > As the author of Syck, the code used in Ruby for the language's YAML class and methods, why is indirectly (directly?) responsible for my first exposure to YAML (as a config file in a Ruby web-app) and the countless hours I spent playing with this sheik new data format afterwards. Syck's README is a YAML file and thus the inspiration for this file and, even, this very piece of software. - who: Steve Howell why?: > Python's YAML implementation. PyYAML's README file is also YAML, so it too inspired the YAML format of this README file. - who: [Rasmus Lerdorf, Zeev Suraski, Andi Gutmans, et al] why?: > PHP is great at what it does best. It's also paid a lot of my bills. Thanks. bugs: report: > Please see Spyc's Sourceforge project page for information on reporting bugs. speed: > This implementation was not designed for speed. Rather, it was designed for those who need a pure PHP implementation of a YAML parser and who are not overly concerned with performance. If you want speed, check out Syck. depth: > This parser is by no means a comprehensive YAML parser. For supported features and future plans, check the website. unicode: > YAML is supposed to be unicode, but for now we're just using ASCII. PHP has crappy unicode support but who knows what the future holds. resources: - http://www.yaml.org - http://www.yaml.org/spec/ - http://yaml.kwiki.org/?YamlInFiveMinutes - http://www.whytheluckystiff.net/syck/ - http://yaml4r.sourceforge.net/cookbook/ thanks: - Adam Wood - Daniel Ferreira - Aaron Jensen - Mike Thornton - Fabien Potencier - Mustafa Kumas
    # # S P Y C # a simple php yaml class # # Load this README! # >> $readme = Spyc::YAMLLoad('README'); # --- %YAML:1.1 title: Spyc -- a Simple PHP YAML Class 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, 2006-2009 Vlad Andersen" tested on: [php 5.2.x] installation: > Copy spyc.php to a directory you can access with your YAML-ready PHP script. That's it! about: > From www.yaml.org: "YAML(tm) (rhymes with 'camel') is a human-friendly, cross language, Unicode based data serialization language designed around the common native data structures of agile programming languages. It is broadly useful for programming needs ranging from configuration files to Internet messaging to object persistence to data auditing. Together with the Unicode standard for characters, the YAML specification provides all the information necessary to understand YAML Version 1.1 and to creating programs that process YAML information. YAML(tm) is a balance of the following design goals: - YAML documents are very readable by humans. - YAML interacts well with scripting languages. - YAML uses host languages' native data structures. - YAML has a consistent information model. - YAML enables stream-based processing. - YAML is expressive and extensible. - YAML is easy to implement." YAML makes a lot of sense. It's easy to use, easy to learn, and cool. As the lucky stiff named why once said, "YAML is a beacon of light." If you're new to YAML, may we suggest YAML In Five Minutes: - http://yaml.kwiki.org/?YamlInFiveMinutes If you don't have five minutes, realize that this README is a completely valid YAML document. Dig in, load this or any YAML file into an array with Spyc and see how easy it is to translate friendly text into usable data. The purpose of Spyc is to provide a pure PHP alternative to Syck, a simple API for loading and dumping YAML documents, a YAML loader which understands a usable subset of the YAML spec, and to further spread the glory of YAML to the PHP masses. If you're at all hesitant ("usable subset of YAML?!"), navigate http://yaml.org/start.html. Spyc completely understands the YAML document shown there, a document which has features way beyond the scope of what normal config files might require. Try it for yourself, and then start enjoying the peace of mind YAML brings to your life. meat and a few potatoes: - concept: Loading a YAML document into PHP brief: > $yaml will become an array of all the data in wicked.yaml code: | include('spyc.php'); $yaml = Spyc::YAMLLoad('wicked.yaml'); - concept: Loading a YAML string into PHP brief: > $array will look like this: array('A YAML','document in a','string') code: | include('spyc.php'); $yaml = '- A YAML\n- document in a\n- string.'; $array = Spyc::YAMLLoad($yaml); - concept: Dumping a PHP array to YAML brief: > $yaml will become a string of a YAML document created from $array. code: | include('spyc.php'); $array['name'] = 'chris'; $array['sport'] = 'curbing'; $yaml = Spyc::YAMLDump($array); prior art: - who: [Brian Ingerson, Clark Evans, Oren Ben-Kiki] why?: > The YAML spec is really a piece of work, and these guys did a great job on it. A simple and elegant language like YAML was a long time coming and it's refreshing to know such able minded individuals took the task to heart and executed it with cunning and strength. In addition to their various noteworthy contributions to YAML parsers and related projects, YAML.pm's README is a treasure trove of information for knowledge seekers. Thanks, guys. - who: why the lucky stiff why?: > As the author of Syck, the code used in Ruby for the language's YAML class and methods, why is indirectly (directly?) responsible for my first exposure to YAML (as a config file in a Ruby web-app) and the countless hours I spent playing with this sheik new data format afterwards. Syck's README is a YAML file and thus the inspiration for this file and, even, this very piece of software. - who: Steve Howell why?: > Python's YAML implementation. PyYAML's README file is also YAML, so it too inspired the YAML format of this README file. - who: [Rasmus Lerdorf, Zeev Suraski, Andi Gutmans, et al] why?: > PHP is great at what it does best. It's also paid a lot of my bills. Thanks. bugs: report: > Please see Spyc's Sourceforge project page for information on reporting bugs. speed: > This implementation was not designed for speed. Rather, it was designed for those who need a pure PHP implementation of a YAML parser and who are not overly concerned with performance. If you want speed, check out Syck. depth: > This parser is by no means a comprehensive YAML parser. For supported features and future plans, check the website. unicode: > YAML is supposed to be unicode, but for now we're just using ASCII. PHP has crappy unicode support but who knows what the future holds. resources: - http://www.yaml.org - http://www.yaml.org/spec/ - http://yaml.kwiki.org/?YamlInFiveMinutes - http://www.whytheluckystiff.net/syck/ - http://yaml4r.sourceforge.net/cookbook/ thanks: - Adam Wood - Daniel Ferreira - Aaron Jensen - Mike Thornton - Fabien Potencier - Mustafa Kumas
  • Nov 17, 2009
    issue 29 (Negative integers cast as string, not integer.) reported by cblaise.public   -   What steps will reproduce the problem? 1. Create a target with a negative number like: titleRotation: -90 What is the expected output? What do you see instead? In PHP use gettype() to confirm that it is (incorrectly) a string. What version of the product are you using? On what operating system? .45 Please provide any additional information below. I fixed with the following patch: @@ -568,7 +568,8 @@ return null; } - if (intval($first_character) > 0 && preg_match ('/^[1-9]+[0-9]*$/', $value)) { + if ( is_numeric($value) && + preg_match ('/^(-|)[1-9]+[0-9]*$/', $value) ){ $intvalue = (int)$value; if ($intvalue != PHP_INT_MAX) $value = $intvalue;
    What steps will reproduce the problem? 1. Create a target with a negative number like: titleRotation: -90 What is the expected output? What do you see instead? In PHP use gettype() to confirm that it is (incorrectly) a string. What version of the product are you using? On what operating system? .45 Please provide any additional information below. I fixed with the following patch: @@ -568,7 +568,8 @@ return null; } - if (intval($first_character) > 0 && preg_match ('/^[1-9]+[0-9]*$/', $value)) { + if ( is_numeric($value) && + preg_match ('/^(-|)[1-9]+[0-9]*$/', $value) ){ $intvalue = (int)$value; if ($intvalue != PHP_INT_MAX) $value = $intvalue;

Earlier this year

  • Nov 13, 2009
    issue 28 (Problem with list + id (?)) reported by david7...@gmail.com   -   What steps will reproduce the problem? DBUser: ... default: - id : 1 user : admin pass : admin firstName: Administrator What is the expected output? What do you see instead? EXPECTED: [default] => Array ( [0] => Array ( [id] => 1 [user] => admin [pass] => admin [firstName] => Administrator ) ) I SEE: [default] => Array ( [0] => Array ( [id] => 1 ) [user] => admin ) What version of the product are you using? On what operating system? Spyc 0.4.5 PHP 5.3.0
    What steps will reproduce the problem? DBUser: ... default: - id : 1 user : admin pass : admin firstName: Administrator What is the expected output? What do you see instead? EXPECTED: [default] => Array ( [0] => Array ( [id] => 1 [user] => admin [pass] => admin [firstName] => Administrator ) ) I SEE: [default] => Array ( [0] => Array ( [id] => 1 ) [user] => admin ) What version of the product are you using? On what operating system? Spyc 0.4.5 PHP 5.3.0
  • Nov 10, 2009
    issue 27 (Aliases within in-line arrays aren't expended) commented on by casadebender   -   This may not be the greatest way to solve the problem, but it does work for my use case. I added a check to _toType for values in the form /^*[\w-]+$/ and expand them using referenceContentsByAlias.
    This may not be the greatest way to solve the problem, but it does work for my use case. I added a check to _toType for values in the form /^*[\w-]+$/ and expand them using referenceContentsByAlias.
  • Nov 10, 2009
    issue 27 (Aliases within in-line arrays aren't expended) reported by casadebender   -   Input: --- foo : &FOO foo bar : &BAR bar baz : &BAZ baz foo_ref : *FOO bar_ref : *BAR baz_ref : *BAZ foobarbaz : - *FOO - *BAR - *BAZ foobarbaz_inline : [ *FOO, *BAR, *BAZ ] Got: foobarbaz_inline == ('*FOO', '*BAR', '*BAZ') Expected: foobarbaz_inline == ('foo', 'bar', 'baz') The nodeContainsGroup function only looks for anchors/aliases at the beginning and end of the line and also only expects a single anchor/alias per line.
    Input: --- foo : &FOO foo bar : &BAR bar baz : &BAZ baz foo_ref : *FOO bar_ref : *BAR baz_ref : *BAZ foobarbaz : - *FOO - *BAR - *BAZ foobarbaz_inline : [ *FOO, *BAR, *BAZ ] Got: foobarbaz_inline == ('*FOO', '*BAR', '*BAZ') Expected: foobarbaz_inline == ('foo', 'bar', 'baz') The nodeContainsGroup function only looks for anchors/aliases at the beginning and end of the line and also only expects a single anchor/alias per line.
  • Nov 10, 2009
    issue 26 (spyc does not recognize the float) reported by stubo.pl   -   hello if the value is in the range 0.1 - 0.9 spyc does not recognize it as a float This is my solution: line: 588 - 594 if (is_numeric($value)) { if ($value === '0') return 0; if( count( explode( '.' , $value ) ) === 2 ) // <- inject code //if (trim ($value, 0) === $value) $value = (float)$value; return $value; }
    hello if the value is in the range 0.1 - 0.9 spyc does not recognize it as a float This is my solution: line: 588 - 594 if (is_numeric($value)) { if ($value === '0') return 0; if( count( explode( '.' , $value ) ) === 2 ) // <- inject code //if (trim ($value, 0) === $value) $value = (float)$value; return $value; }
  • Nov 09, 2009
    issue 25 (string with * unexpectedly treated as alias) reported by laurence.miao   -   What steps will reproduce the problem? 1. {{{ node: string1: some string *abc string2: some string *abc }}} 2. {{{ var_dump(Spyc::YAMLLoad("test.txt")); }}} What is the expected output? {{{ array(1) { ["node"]=> array(2) { ["string1"]=> string(11) "some string *abc" ["string2"]=> string(11) "some string *abc" } } }}} What do you see instead? {{{ Bad group name: abc.Bad group name: abc.array(1) { ["node"]=> array(2) { ["string1"]=> NULL ["string2"]=> NULL } } }}} What version of the product are you using? 0.4.5 On what operating system? linux Please provide any additional information below.
    What steps will reproduce the problem? 1. {{{ node: string1: some string *abc string2: some string *abc }}} 2. {{{ var_dump(Spyc::YAMLLoad("test.txt")); }}} What is the expected output? {{{ array(1) { ["node"]=> array(2) { ["string1"]=> string(11) "some string *abc" ["string2"]=> string(11) "some string *abc" } } }}} What do you see instead? {{{ Bad group name: abc.Bad group name: abc.array(1) { ["node"]=> array(2) { ["string1"]=> NULL ["string2"]=> NULL } } }}} What version of the product are you using? 0.4.5 On what operating system? linux Please provide any additional information below.
  • Oct 14, 2009
    issue 24 (PHP Notice: Array to string conversion in /Library/WebServe...) reported by rptgoo...@shapefruit.de   -   What steps will reproduce the problem? - PHP Notice if error_reporting is set to E_ALL - tested with provided spyc.yaml What is the expected output? What do you see instead? No PHP Notice What version of the product are you using? On what operating system? spyc-0.4.5 (PHP5) Please provide any additional information below. My solution: (spyc.php: line 775) 775. if (!is_array ($_arr)) $_arr = array ($key=>$value); 776. else $_arr[$key] = $value;
    What steps will reproduce the problem? - PHP Notice if error_reporting is set to E_ALL - tested with provided spyc.yaml What is the expected output? What do you see instead? No PHP Notice What version of the product are you using? On what operating system? spyc-0.4.5 (PHP5) Please provide any additional information below. My solution: (spyc.php: line 775) 775. if (!is_array ($_arr)) $_arr = array ($key=>$value); 776. else $_arr[$key] = $value;
  • Oct 11, 2009
    issue 23 (Inline list with a comment is not recognized as a list) reported by Andrei.Fokau   -   If I have a yaml file with: root: child: [one, two, three] # comment then Spyc gives me a string instead of array. $data[root][child] = '[one, two, three]' ___ Spyc version: 0.4.5
    If I have a yaml file with: root: child: [one, two, three] # comment then Spyc gives me a string instead of array. $data[root][child] = '[one, two, three]' ___ Spyc version: 0.4.5
  • Oct 08, 2009
    issue 21 (php4 incompatibility) commented on by t...@tombartling.com   -   I had this same problem. Run 5to4.php. This creates spyc-latest.php4. I renamed it to spyc-php4.php. When running that, I got the error mentioned above. I also added the brackets because that's my preference, but it properly works without them. I resolved it by removing "throw" from line 322. if ($first_key===0) { new Exception('Keys are all screwy. The first one was zero, now it\'s "'. $key .'"'); } I have only done some basic testing, but it's not dying anymore.
    I had this same problem. Run 5to4.php. This creates spyc-latest.php4. I renamed it to spyc-php4.php. When running that, I got the error mentioned above. I also added the brackets because that's my preference, but it properly works without them. I resolved it by removing "throw" from line 322. if ($first_key===0) { new Exception('Keys are all screwy. The first one was zero, now it\'s "'. $key .'"'); } I have only done some basic testing, but it's not dying anymore.
  • Sep 23, 2009
    issue 22 (Incorrect parsing of Ruby YAML) reported by jwentz1   -   What steps will reproduce the problem? 1. $msg = "--- \n:fingerprint: |\n 006f915442a1f1f3074b3356fc17023addc33c6c76297b9683e68c95dfc63b15\n\n:message: \n :identity: jpeck\n :vmc_id: 12\n :admin: false\n :last_name: Peck\n :email: xxx@foo.net\n :first_name: Justine\n :product_access: \n - - Product1\n - http://localhost/test/p1.php\n - - Product2\n - http://localhost/test/p2.php\n"; $x = spyc_load( $msg ); echo "YAML: " . print_r( $x ) . "<br>"; What is the expected output? What do you see instead? Expected: Array ( [:fingerprint] => 006f915442a1f1f3074b3356fc17023addc33c6c76297b9683e68c95dfc63b15 [:message] => Array ( [:last_name] => Peck [:first_name] => Justine [:product_access] => Array ( [0] => Array ( [0] => Product1 [1] => http://localhost/test/p1.php ) [1] => Array ( [0] => Product2 [1] => http://localhost/test/p2.php ) [:identity] => jpeck [:email] => xxx@foo.net [:vmc_id] => 12 [:admin] => false ) ) Actual: Array ( [0] => 006f915442a1f1f3074b3356fc17023addc33c6c76297b9683e68c95dfc63b15 [:message] => Array ( [0] => :identity: jpeck [1] => :vmc_id: 12 [2] => :admin: false [3] => :last_name: Peck [4] => :email: xxx@foo.net [5] => :first_name: Justine [:product_access] => [6] => Array ( [0] => http://localhost/test/p1.php ) [7] => Array ( [0] => http://localhost/test/p2.php ) ) ) What version of the product are you using? On what operating system? 0.4.5 on Windows XP Please provide any additional information below. YAML generated by Ruby; also correctly reconstructed by Ruby YAML.load()
    What steps will reproduce the problem? 1. $msg = "--- \n:fingerprint: |\n 006f915442a1f1f3074b3356fc17023addc33c6c76297b9683e68c95dfc63b15\n\n:message: \n :identity: jpeck\n :vmc_id: 12\n :admin: false\n :last_name: Peck\n :email: xxx@foo.net\n :first_name: Justine\n :product_access: \n - - Product1\n - http://localhost/test/p1.php\n - - Product2\n - http://localhost/test/p2.php\n"; $x = spyc_load( $msg ); echo "YAML: " . print_r( $x ) . "<br>"; What is the expected output? What do you see instead? Expected: Array ( [:fingerprint] => 006f915442a1f1f3074b3356fc17023addc33c6c76297b9683e68c95dfc63b15 [:message] => Array ( [:last_name] => Peck [:first_name] => Justine [:product_access] => Array ( [0] => Array ( [0] => Product1 [1] => http://localhost/test/p1.php ) [1] => Array ( [0] => Product2 [1] => http://localhost/test/p2.php ) [:identity] => jpeck [:email] => xxx@foo.net [:vmc_id] => 12 [:admin] => false ) ) Actual: Array ( [0] => 006f915442a1f1f3074b3356fc17023addc33c6c76297b9683e68c95dfc63b15 [:message] => Array ( [0] => :identity: jpeck [1] => :vmc_id: 12 [2] => :admin: false [3] => :last_name: Peck [4] => :email: xxx@foo.net [5] => :first_name: Justine [:product_access] => [6] => Array ( [0] => http://localhost/test/p1.php ) [7] => Array ( [0] => http://localhost/test/p2.php ) ) ) What version of the product are you using? On what operating system? 0.4.5 on Windows XP Please provide any additional information below. YAML generated by Ruby; also correctly reconstructed by Ruby YAML.load()
  • Sep 21, 2009
    issue 21 (php4 incompatibility) reported by ekstern.konto.2000   -   What steps will reproduce the problem? 1. Run the 0.4.5 spyc for php4 Parse error: syntax error, unexpected T_NEW in spyc_php4.inc on line 322 322: if ($first_key===0) throw new Exception('Keys are all screwy. The first one was zero, now it\'s "'. $key .'"'); I have used the included php4 version and tried the 5to4.php (which seems to produce the same file). Should the 5to4 be extended to also change php5's error throwing mechanism or should the users do that themselves? Any takes on this?
    What steps will reproduce the problem? 1. Run the 0.4.5 spyc for php4 Parse error: syntax error, unexpected T_NEW in spyc_php4.inc on line 322 322: if ($first_key===0) throw new Exception('Keys are all screwy. The first one was zero, now it\'s "'. $key .'"'); I have used the included php4 version and tried the 5to4.php (which seems to produce the same file). Should the 5to4 be extended to also change php5's error throwing mechanism or should the users do that themselves? Any takes on this?
  • Sep 21, 2009
    issue 20 (exception parsing a yaml hash) reported by robbie.wilhelm   -   What steps will reproduce the problem? $t0 = array("titel"=> array("0" => "", 1 => "Dr.", 5 => "Prof.", 6 => "Prof. Dr.")); Spyc::YAMLDump($t0); What is the expected output? What do you see instead? titel: 0: 1: Dr. 5: Prof. 6: Prof. Dr. spyck throws an exception: Keys are all screwy. The first one was zero, now it's "5" What version of the product are you using? On what operating system? 0.4.5 from svn Please provide any additional information below. there should be only *one single* case where a list is dumped as a yaml array. that is when every key is the next incremented value (+1) starting from 0 (vektor). every other array should be dumped as yaml hash. $is_vektor = (array_keys($arr) === range(0, count($arr) - 1))
    What steps will reproduce the problem? $t0 = array("titel"=> array("0" => "", 1 => "Dr.", 5 => "Prof.", 6 => "Prof. Dr.")); Spyc::YAMLDump($t0); What is the expected output? What do you see instead? titel: 0: 1: Dr. 5: Prof. 6: Prof. Dr. spyck throws an exception: Keys are all screwy. The first one was zero, now it's "5" What version of the product are you using? On what operating system? 0.4.5 from svn Please provide any additional information below. there should be only *one single* case where a list is dumped as a yaml array. that is when every key is the next incremented value (+1) starting from 0 (vektor). every other array should be dumped as yaml hash. $is_vektor = (array_keys($arr) === range(0, count($arr) - 1))
  • Sep 20, 2009
    issue 9 (Empty array inside array generates warning) commented on by ran...@gmail.com   -   Thanks. Confirmed with the latest r91. Spyc is very handy :)
    Thanks. Confirmed with the latest r91. Spyc is very handy :)
  • Sep 20, 2009
    r91 (RoundTrip test for word wrap.) committed by vlad.andersen   -   RoundTrip test for word wrap.
    RoundTrip test for word wrap.
  • Sep 20, 2009
    r90 (Correctly parsing newlines.) committed by vlad.andersen   -   Correctly parsing newlines.
    Correctly parsing newlines.
  • Sep 20, 2009
    r89 (Introducing RoundTripTest and dumping with trailing spaces.) committed by vlad.andersen   -   Introducing RoundTripTest and dumping with trailing spaces.
    Introducing RoundTripTest and dumping with trailing spaces.
  • Sep 20, 2009
    r88 (Fixing some roundtrip bugs.) committed by vlad.andersen   -   Fixing some roundtrip bugs.
    Fixing some roundtrip bugs.
  • Sep 20, 2009
    r87 (Updating PHP4 versions.) committed by vlad.andersen   -   Updating PHP4 versions.
    Updating PHP4 versions.
  • Sep 20, 2009
    issue 10 (spyc doesn't handle "|-" or "|+") commented on by vlad.andersen   -   This will be definitely fixed in one of the future versions of Spyc.
    This will be definitely fixed in one of the future versions of Spyc.
  • Sep 20, 2009
    issue 14 (Notice: Undefined index: in spyc.php on line 709) Status changed by vlad.andersen   -  
    Status: Fixed
    Status: Fixed
  • Sep 20, 2009
    Changelog (Changelog for Spyc) Wiki page edited by vlad.andersen   -   Revision r86 Edited wiki page through web user interface.
    Revision r86 Edited wiki page through web user interface.
  • Sep 20, 2009
    Changelog (Changelog for Spyc) Wiki page edited by vlad.andersen   -   Revision r85 Edited wiki page through web user interface.
    Revision r85 Edited wiki page through web user interface.
  • Sep 20, 2009
    issue 14 (Notice: Undefined index: in spyc.php on line 709) commented on by vlad.andersen   -   And it is fixed in 0.4.5, the latest release.
    And it is fixed in 0.4.5, the latest release.
  • Sep 20, 2009
    spyc-0.4.5.zip (Spyc 0.4.5) file uploaded by vlad.andersen   -  
    Labels: Featured Type-Source OpSys-All
    Labels: Featured Type-Source OpSys-All
  • Sep 20, 2009
    r84 (Upgrading version to spyc 0.4.5) committed by vlad.andersen   -   Upgrading version to spyc 0.4.5
    Upgrading version to spyc 0.4.5
  • Sep 20, 2009
    issue 8 (Parse key with quotes when the quotes needs to be removed) Status changed by vlad.andersen   -   Okay, it's fixed in the latest revision.
    Status: Fixed
    Okay, it's fixed in the latest revision.
    Status: Fixed
  • Sep 20, 2009
    r83 (Fixing parsing keys with quotes (issue #8).) committed by vlad.andersen   -   Fixing parsing keys with quotes ( issue #8 ).
    Fixing parsing keys with quotes ( issue #8 ).
  • Sep 20, 2009
    issue 9 (Empty array inside array generates warning) Status changed by vlad.andersen   -  
    Status: Fixed
    Status: Fixed
  • Sep 20, 2009
    issue 9 (Empty array inside array generates warning) commented on by vlad.andersen   -   Ok, and the warning should be fixed too now!
    Ok, and the warning should be fixed too now!
  • Sep 20, 2009
    r82 (Fixing a PHP warning (issue #9).) committed by vlad.andersen   -   Fixing a PHP warning ( issue #9 ).
    Fixing a PHP warning ( issue #9 ).
  • Sep 20, 2009
    issue 15 (Extra blank string is getting induced if array element inden...) Status changed by vlad.andersen   -   Unfortunately, your solution breaks a lot of indentation tests for Spyc (you can download the SVN version and run the latest tests). Moreover, I'm not sure this is indeed the correct behaviour for Spyc in such instances (maybe we want an empty value for `key` and two sequential values). Can you show me a point in YAML specification where it says that syntax like this is possible? Thanks.
    Status: WontFix
    Unfortunately, your solution breaks a lot of indentation tests for Spyc (you can download the SVN version and run the latest tests). Moreover, I'm not sure this is indeed the correct behaviour for Spyc in such instances (maybe we want an empty value for `key` and two sequential values). Can you show me a point in YAML specification where it says that syntax like this is possible? Thanks.
    Status: WontFix
  • Sep 20, 2009
    r81 (Adding (commented) test for no indentation issue (#15).) committed by vlad.andersen   -   Adding (commented) test for no indentation issue (#15).
    Adding (commented) test for no indentation issue (#15).
  • Sep 20, 2009
    issue 16 (parsing value of colon only) Status changed by vlad.andersen   -   This should be already fixed in the latest SVN version.
    Status: Fixed
    This should be already fixed in the latest SVN version.
    Status: Fixed
  • Sep 20, 2009
    issue 17 (Unable to handle empty arrays) Status changed by vlad.andersen   -   Please use the latest SVN version, the problem was fixed long ago ;-)
    Status: Fixed
    Please use the latest SVN version, the problem was fixed long ago ;-)
    Status: Fixed
  • Sep 20, 2009
    issue 18 (Writing colon-ending text values) Status changed by vlad.andersen   -   This seems to be already fixed in the SVN version, please try it and report if the problem resurfaces.
    Status: Fixed
    This seems to be already fixed in the SVN version, please try it and report if the problem resurfaces.
    Status: Fixed
  • Sep 20, 2009
    r80 (Adding a dump test for trailing colons (issue #18)) committed by vlad.andersen   -   Adding a dump test for trailing colons ( issue #18 )
    Adding a dump test for trailing colons ( issue #18 )
  • Sep 20, 2009
    issue 19 (hashes with numerical named keys get mangled) Status changed by vlad.andersen   -   Fixed in the latest SVN version. Thanks for the bug report!
    Status: Fixed
    Fixed in the latest SVN version. Thanks for the bug report!
    Status: Fixed
  • Sep 20, 2009
    r79 (Fixes hashes with numeric names (issue 19)) committed by vlad.andersen   -   Fixes hashes with numeric names ( issue 19 )
    Fixes hashes with numeric names ( issue 19 )
  • Sep 17, 2009
    issue 19 (hashes with numerical named keys get mangled) reported by robbie.wilhelm   -   reproduce with this: $test=array("werte"=>array("1"=>"nummer 1", "0"=>"Stunde 0")); $t_y = Spyc::YAMLDump($test); print $t_y; print_r(Spyc::YAMLLoad($t_y)); What is the expected output? What do you see instead? expected this: --- werte: 1: nummer 1 0: Stunde 0 Array ( [werte] => Array ( [1] => nummer 1 [0] => Stunde 0 ) ) result is this array: Array ( [werte] => Array ( [1] => nummer 1 [0] => Stunde 0 ) ) What version of the product are you using? On what operating system? 0.4.2 Please provide any additional information below. if in the yaml-file something ist marked as hash key: value one must convert the key to a "string" to remain the numbers intact
    reproduce with this: $test=array("werte"=>array("1"=>"nummer 1", "0"=>"Stunde 0")); $t_y = Spyc::YAMLDump($test); print $t_y; print_r(Spyc::YAMLLoad($t_y)); What is the expected output? What do you see instead? expected this: --- werte: 1: nummer 1 0: Stunde 0 Array ( [werte] => Array ( [1] => nummer 1 [0] => Stunde 0 ) ) result is this array: Array ( [werte] => Array ( [1] => nummer 1 [0] => Stunde 0 ) ) What version of the product are you using? On what operating system? 0.4.2 Please provide any additional information below. if in the yaml-file something ist marked as hash key: value one must convert the key to a "string" to remain the numbers intact
  • Sep 15, 2009
    issue 18 (Writing colon-ending text values) reported by daniel.zahariev   -   in yaml file "key": "value:" is parsed like this: ["key"]=>string(6) "value:" but when the array is dumped into yaml string - it is returned like this: "key": value: which is then parsed to ["key: value"]=>string(0) "" My suggestion for fixing this issue is to add one more condition for folding block in _dumpNode method: || strpos($value,":") == strlen($value)-1
    in yaml file "key": "value:" is parsed like this: ["key"]=>string(6) "value:" but when the array is dumped into yaml string - it is returned like this: "key": value: which is then parsed to ["key: value"]=>string(0) "" My suggestion for fixing this issue is to add one more condition for folding block in _dumpNode method: || strpos($value,":") == strlen($value)-1
  • Sep 11, 2009
    issue 17 (Unable to handle empty arrays) reported by ekstern.konto.2000   -   What steps will reproduce the problem? 1. Dump an empty array 2. Read in [] What is the expected output? What do you see instead? When dumping an empty array, I expect SPYC to generate '[]' When reading a YAML file, I expect SPYC to correctly convert '[]' into array() What version of the product are you using? On what operating system? * @version 0.3 for php4 on Debian Linux Please provide any additional information below. Code: print '<pre>'; $data = "--- a: [] b: 5 "; $arr = Spyc::YAMLLoad($data); var_dump($arr); $x['a'] = array(); $x['b'] = 5; $str = Spyc::YAMLDump($x); var_dump($str); Output: array(2) { ["a"]=> string(2) "[]" ["b"]=> int(5) } string(13) "--- a: b: 5 "
    What steps will reproduce the problem? 1. Dump an empty array 2. Read in [] What is the expected output? What do you see instead? When dumping an empty array, I expect SPYC to generate '[]' When reading a YAML file, I expect SPYC to correctly convert '[]' into array() What version of the product are you using? On what operating system? * @version 0.3 for php4 on Debian Linux Please provide any additional information below. Code: print '<pre>'; $data = "--- a: [] b: 5 "; $arr = Spyc::YAMLLoad($data); var_dump($arr); $x['a'] = array(); $x['b'] = 5; $str = Spyc::YAMLDump($x); var_dump($str); Output: array(2) { ["a"]=> string(2) "[]" ["b"]=> int(5) } string(13) "--- a: b: 5 "
  • Sep 07, 2009
    issue 16 (parsing value of colon only) commented on by porbas   -   J've fixed it up by changing regex in returnKeyValuePair /^(["\'](.*)["\'](\s)*:)/ -> /^(["\'](.*?)["\'](\s)*:)/
    J've fixed it up by changing regex in returnKeyValuePair /^(["\'](.*)["\'](\s)*:)/ -> /^(["\'](.*?)["\'](\s)*:)/
  • Sep 07, 2009
    issue 16 (parsing value of colon only) reported by porbas   -   "abc": ":" is parsed as (var_dump output): ["abc": "]=>string(0) "" should be parsed as: ["abc"]=>string(1) ":"
    "abc": ":" is parsed as (var_dump output): ["abc": "]=>string(0) "" should be parsed as: ["abc"]=>string(1) ":"
  • Sep 04, 2009
    issue 15 (Extra blank string is getting induced if array element inden...) reported by prasad83.a   -   Load the following YAML data: using spyc_load --- key: - record1: value1 - record2: value2 Expected Output: array( 'key' => array( array ('record1'=>'value1'), array ('record2'=>'value2') ) ) Observed Output: (contains extra blank string!) array( 'key' => '', array( array ('record1'=>'value1'), array ('record2'=>'value2') ) ) The issue seems to be arising due to array element indentation equal to the parent key indentation. Workaround: Add the following line of code to function loadWithSource $cnt = count($Source); for ($i = 0; $i < $cnt; $i++) { $line = $Source[$i]; $this->indent = strlen($line) - strlen(ltrim($line)); /* Workaround start */ if(isset($this->path[$this->indent]) && $this->isArrayElement(ltrim($line))) { // Forcefully induce a space. $line = " " . $line; $this->indent++; } /* Workaround end */ Hope you will fix this issue.
    Load the following YAML data: using spyc_load --- key: - record1: value1 - record2: value2 Expected Output: array( 'key' => array( array ('record1'=>'value1'), array ('record2'=>'value2') ) ) Observed Output: (contains extra blank string!) array( 'key' => '', array( array ('record1'=>'value1'), array ('record2'=>'value2') ) ) The issue seems to be arising due to array element indentation equal to the parent key indentation. Workaround: Add the following line of code to function loadWithSource $cnt = count($Source); for ($i = 0; $i < $cnt; $i++) { $line = $Source[$i]; $this->indent = strlen($line) - strlen(ltrim($line)); /* Workaround start */ if(isset($this->path[$this->indent]) && $this->isArrayElement(ltrim($line))) { // Forcefully induce a space. $line = " " . $line; $this->indent++; } /* Workaround end */ Hope you will fix this issue.
  • Sep 01, 2009
    issue 8 (Parse key with quotes when the quotes needs to be removed) commented on by ilya.sher   -   I guess the quotes should be stripped. The code $x = array('a:1'=>array(1000)); $yaml = Spyc::YAMLDump($x); $y = Spyc::YAMLLoadString($yaml); var_dump($x); var_dump($y); produces array(1) { ["a:1"]=> array(1) { [0]=> int(1000) } } array(1) { [""a:1""]=> array(1) { [0]=> int(1000) } } Note that $x != $y. That's with both 0.4.1 and trunk@78
    I guess the quotes should be stripped. The code $x = array('a:1'=>array(1000)); $yaml = Spyc::YAMLDump($x); $y = Spyc::YAMLLoadString($yaml); var_dump($x); var_dump($y); produces array(1) { ["a:1"]=> array(1) { [0]=> int(1000) } } array(1) { [""a:1""]=> array(1) { [0]=> int(1000) } } Note that $x != $y. That's with both 0.4.1 and trunk@78
 
Hosted by Google Code