evalok/php-rest-lightly 问题修复 & 功能扩展

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

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

evalok/php-rest-lightly

最新稳定版本:0.1.2

Composer 安装命令:

composer require evalok/php-rest-lightly

包简介

a lightweight component for implementing a REST API

关键字:

README 文档

README

a lightweight component for implementing a REST API

this library helps you to leverage namespacing to implicitly define API endpoint routes rather than write them by hand; adding new endpoints wont require you to update a routes list

authentication or other operations can be done within the endpoint classes themselves

installation instructions

composer require evalok/php-rest-lightly

example usage: https://github.com/EvaLok/php-rest-lightly/blob/master/demo/public/index.php

demo

configure .htaccess in demo/public

Examples

  • GET: api/v1/Thing1/555
{
	id: 555,
	owner: {
		*owner: null
	},
	class: "api\v1\Thing1",
	method: "api\v1\Thing1::get",
	message: "testing testing 123",
	params: [ ]
}
  • GET: api/v1/Thing1/555/Thing2/777?some=thing
{
	id: 777,
	owner: {
		*id: 555,
		*owner: { }
	},
	class: "api\v1\Thing1\Thing2",
	method: "api\v1\Thing1\Thing2::get",
	message: "testing testing 123",
	params: {
		some: "thing"
	}
}
  • api/v1/Restricted/Thing3/888
"403: Forbidden"

TODO

  • tests
  • versioning deprecation demo
  • non-json responses
  • support for request headers

统计信息

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

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-07-25