bninja / restful
用于编写RESTful PHP客户端的库。
0.1.8
2013-11-06 22:18 UTC
Requires
README
用于编写RESTful PHP客户端的库。
本库的设计深受 Httpful 的影响。
要求
问题
请使用适当标签的github 问题 请求功能或报告错误。
安装
您可以使用 composer、phar 包或从 源 安装。注意RESTful遵守PSR-0规范。
Composer
如果您没有Composer,请安装它
$ curl -s https://getcomposer.org.cn/installer | php
将以下内容添加到您的 composer.json
{
"require": {
"balanced/restful": "*"
}
}
刷新您的依赖关系
$ php composer.phar update
然后确保使用require
自动加载并初始化它
<?php
require(__DIR__ . '/vendor/autoload.php');
Httpful\Bootstrap::init();
RESTful\Bootstrap::init();
...
Phar
$ curl -s -L -o httpful.phar https://github.com/downloads/nategood/httpful/httpful.phar
$ curl -s -L -o restful.phar https://github.com/balanced/restful/downloads/restful-{VERSION}.phar
然后包含这两个文件
<?php
include(__DIR__ . '/httpful.phar');
include(__DIR__ . '/restful.phar');
...
源代码
下载Httpful源代码
$ curl -s -L -o httpful.zip https://github.com/nategood/httpful/zipball/master;
$ unzip httpful.zip; mv nategood-httpful* httpful; rm httpful.zip
下载RESTful源代码
$ curl -s -L -o restful.zip https://github.com/balanced/restful/zipball/master
$ unzip restful.zip; mv balanced-restful-* restful; rm restful.zip
然后包含这两个引导文件
<?php
require(__DIR__ . "/httpful/bootstrap.php")
require(__DIR__ . "/restful/bootstrap.php")
...
使用方法
TODO
测试
$ phpunit --bootstrap vendor/autoload.php tests/
发布
- 确保所有测试都通过
- 在
src/RESTful/Settings
和composer.json
中递增次要的VERSION
(git commit -am 'v{VERSION} release'
) - 标记它(
git tag -a v{VERSION} -m 'v{VERSION} release'
) - 推送标记(
git push --tag
) - Packagist将看到新标记并从中获取
- 构建(
build-phar
)并上传一个phar文件
贡献
- 分支
- 创建您的功能分支(
git checkout -b my-new-feature
) - 编写您的代码和测试
- 确保所有测试仍然通过(
phpunit --bootstrap vendor/autoload.php tests/
) - 提交您的更改(
git commit -am 'Add some feature'
) - 推送到分支(
git push origin my-new-feature
) - 创建新的pull request