Re: PHP binding for LibYAML

"Alexey Zakhlestin" <[email protected]>
Newsgroups gmane.text.yaml.general
Message-ID <[email protected]>
On 4/26/08, Makoto Kuwata <[email protected]> wrote:
> Hi all,
>  I found the PHP binding for LibYAML.
>  php_yaml - http://www.opendogs.org/pub/php_yaml-0.3.0.tgz
>
>  The author rsky is known for QIQ, a next generation PHP.

"next generation PHP" sounds a bit loud. (offtopic on this list, anyway)

but regarding libyaml binding: that's interesting!
I looked thru the sources — looks, like there are some rough edges.
will try to run it thru some tests.

what is the status of this extension?
is it still developed? is there some subversion/cvs/git/whatever
repository available for it? why wasn't it submitted to pecl?

>
>  Usage:
>  ------------------
>  <?php
>  /// load yaml.so
>  if (! extension_loaded('yaml')) {
>     dl('yaml.so') or die('cannot load yaml.so.');
>  }
>  /// configure to parse date and timestamp
>  if (function_exists('date_create')) {
>   ini_set('yaml.decode_timestamp', 2);  // use DateTime
>  } else {
>   ini_set('yaml.decode_timestamp', 1);  // use seconds (integer)
>  }
>  /// read YAML document
>  $str = file_get_contents("example.yaml");
>  $ydoc = yaml_parse($str);
>  /// or
>  //$ydoc = yaml_parse_file("example.yaml");
>  var_dump($ydoc);
>  ?>
>  ------------------
>
>
>  I found some problems in php_yaml.
>  (a) Currently it only supports loading YAML.
>     It means that dumping is not available.
>  (b) Merge ('<<') is not supported.
>  (c) Default value ('=') is not supported.
>  (d) Scalar value can be empty string instead of NULL
>     when no data specified.
>  (e) It can't parse '2008-01-01 12:34:56'.
>
>
>  I create a patch to fixe (d) and (e).
>  http://www.kuwata-lab.com/materials/php_yaml-0.3.0.patch
>
>
>  If you want to get YAML1.1 parser in PHP, try php_yaml.
>
>  --
>  regards,
>  makoto kuwata
>
>  -------------------------------------------------------------------------
>  This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
>  Don't miss this year's exciting event. There's still time to save $100.
>  Use priority code J8TL2D2.
>  http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
>  _______________________________________________
>  Yaml-core mailing list
>  [email protected]
>  https://lists.sourceforge.net/lists/listinfo/yaml-core
>


-- 
Alexey Zakhlestin
http://blog.milkfarmsoft.com/
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Yaml-core mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/yaml-core
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.