pecl/yaml 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

pecl/yaml

最新稳定版本:2.3.0

Composer 安装命令:

pie install pecl/yaml

包简介

YAML-1.1 parser and emitter

README 文档

README

The Yaml PHP Extension provides a wrapper to the LibYAML library. It gives the user the ability to parse YAML document streams into PHP constructs and emit PHP constructs as valid YAML 1.1 documents. For more information about LibYAML see http://pyyaml.org/wiki/LibYAML. For more information about YAML see http://yaml.org/ Requirements: * libyaml 0.1.x BUILDING ON UNIX etc. ===================== To compile your new extension, you will have to execute the following steps: 1. $ phpize 2. $ ./configure [--with-yaml] 3. $ make 4. $ sudo make install BUILDING ON WINDOWS =================== The extension provides the VisualStudio V6 project file yaml.dsp To compile the extension you open this file using VisualStudio, select the apropriate configuration for your installation (either "Release_TS" or "Debug_TS") and create "php_yaml.dll" After successfull compilation you have to copy the newly created "php_yaml.dll" to the PHP extension directory (default: C:\PHP\extensions). TESTING ======== You can now load the extension using a php.ini directive extension="php_yaml.[so|dll]" or load it at runtime using the dl() function dl("php_yaml.[so|dll]"); The extension should now be available, you can test this using the extension_loaded() function: if (extension_loaded(yaml)) echo "yaml loaded :)"; else echo "something is wrong :("; The extension will also add its own block to the output of phpinfo(); CONFIGURATION ============= ini settings: yaml.decode_timestamp=0 for no timestamp parsing yaml.decode_timestamp=1 for strtotime parsing yaml.decode_timestamp=2 for date_create parsing yaml.decode_binary=0 for no binary decoding yaml.decode_binary=1 for base64 binary decoding yaml.decode_php=0 for no serialized object parsing yaml.decode_php=1 for serialized object parsing /** * @param string $input String to parse as YAML document stream * @param int $pos Document to extract from stream (-1 for all, 0 for first, ...) * @param int $ndocs Number of documents found in stream * @param array $callbacks Content handlers for YAML nodes. Array of tag => handler * @return mixed Parsed data */ yaml_parse ($input, $pos=0, &$ndocs=null, $callbacks=null) /** * @param mixed $data Data to encode * @param int $encoding Output encoding * @param int $linebreak Output linebreak * @return string Encoded data */ yaml_emit ($data, $encoding=YAML_ANY_ENCODING, $linebreak=YAML_ANY_BREAK) CREDITS ======== php-yaml v0.1.0 through v0.3.0 was developed by Ryusuke Sekiyama. Starting with v0.4.0 the extension has been maintained by Bryan Davis. Development of versions v0.4.0 - v1.1.0 funded by Keynetics Inc [http://keynetics.com/]. Inspiration and some implementation details have been taken from: * php-syck [http://pecl.php.net/package/syck] * MacRuby's libyaml wrapper [http://www.macruby.org/trac/browser/MacRuby/trunk/ext/libyaml] * LibYAML's examples [http://pyyaml.org/wiki/LibYAML] 

统计信息

  • 总下载量: 814
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 74
  • 点击次数: 9
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 74
  • Watchers: 9
  • Forks: 34
  • 开发语言: C

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-04