#
# S P Y C
# a simple php yaml class
# v0.2(.3)
#
# Load this README!
# >> $readme = Spyc::YAMLLoad('README');
#
--- %YAML:1.1
title: Spyc -- a Simple PHP YAML Class
version: 0.2.3
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
tested on: [php 4.3.11, php 5.0.4]
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.yml
code: |
include('spyc.php');
$yaml = Spyc::YAMLLoad('wicked.yml');
- 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/
- http://www.sourceforge.net/projects/spyc/
- http://spyc.sourceforge.net/
thanks:
- Adam Wood
- Daniel Ferreira
- Aaron Jensen
- Mike Thornton
- Fabien Potencier
- Mustafa Kumas
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
DOJO加FLEA做的信息管理系统 (495个子文件)
NormalGroup_m.bmp 1KB
COPYRIGHT 4KB
style.css 1KB
all.css 676B
Thumbs.db 73KB
Entries 788B
Entries 597B
Entries 559B
Entries 548B
Entries 548B
Entries 477B
Entries 379B
Entries 268B
Entries 196B
Entries 140B
Entries 125B
Entries 125B
Entries 122B
Entries 113B
Entries 111B
Entries 111B
Entries 111B
Entries 99B
Entries 98B
Entries 72B
Entries 58B
Entries 56B
Entries 51B
Entries 48B
Entries 47B
sketchey.gdf 41KB
Statistics.gif 17KB
logo.gif 14KB
prev.gif 13KB
view.gif 9KB
banner.gif 6KB
training.gif 5KB
compete.gif 3KB
groupoffice.gif 3KB
people.gif 2KB
addAthlete.gif 2KB
im48x48.gif 2KB
grid48x48.gif 2KB
treeExpand_loading.gif 2KB
login.gif 1KB
addpeop.gif 1KB
password.gif 1KB
eye.gif 1KB
loading.gif 751B
import.gif 730B
introduce.gif 730B
download.gif 366B
tableFormat.gif 162B
Search.gif 155B
last.gif 128B
first.gif 128B
next.gif 125B
add.gif 114B
lock.gif 97B
del.gif 85B
refresh.gif 61B
edit.html 21KB
edit.html 20KB
edit.html 20KB
list.html 17KB
list.html 17KB
list.html 17KB
edit.html 17KB
list.html 17KB
list.html 17KB
list.html 16KB
edit.html 16KB
list.html 16KB
edit.html 16KB
edit.html 15KB
edit.html 15KB
expr_edit.html 15KB
gantt.html 14KB
edit.html 13KB
list.html 13KB
list.html 13KB
list.html 12KB
edit.html 11KB
edit.html 11KB
list.html 11KB
search.html 11KB
list.html 10KB
setOperation.html 10KB
view.html 10KB
item.html 10KB
desktop.html 9KB
item.html 9KB
item.html 9KB
item.html 9KB
edit.html 9KB
compete.html 9KB
edit.html 9KB
edit.html 9KB
single.html 9KB
list.html 7KB
共 495 条
- 1
- 2
- 3
- 4
- 5
资源评论
- nebula3692017-08-11不是很能看懂。运行没什么问题。
w2y0xy0sf5z
- 粉丝: 4
- 资源: 26
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功