定制 demartis/rest-proxy 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

demartis/rest-proxy

最新稳定版本:1.1.11

Composer 安装命令:

composer require demartis/rest-proxy

包简介

Simple rest proxy

README 文档

README

Simple Rest Proxy

Example

<?php
require_once __DIR__ . '/../vendor/autoload.php';

use Symfony\Component\HttpFoundation\Request;

use RestProxy\RestProxy;
use RestProxy\CurlWrapper;

$proxy = new RestProxy(
    Request::createFromGlobals(),
    new CurlWrapper()
    );
$proxy->register('github', 'https://api.github.com');
$proxy->run();


foreach($proxy->getHeaders() as $header) {
    header($header);
}
echo $proxy->getContent();

How to install:

Install composer:

curl -s https://getcomposer.org/installer | php

Include in your project

php composer.phar require 'demartis/rest-proxy:~1.0'

OR Create a new project:

php composer.phar create-project demartis/rest-proxy proxy

OR include the dev release

php composer.phar require 'demartis/rest-proxy:dev-master'

Run dummy server (only with PHP5.4)

cd proxy
php -S localhost:8888 -t www/

Open a web browser and type: http://localhost:8888/github/users/gonzalo123

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-06-12