org_heigl/psr7wrapper

将不同框架中的请求/响应对象包装成PSR7兼容的封装

1.0.0 2016-04-01 09:34 UTC

This package is auto-updated.

Last update: 2024-09-23 09:13:33 UTC


README

一个库,用于模拟PSR7行为,以适应不同框架的请求或响应对象。

在我的工作中,我遇到了将ZendFramework1请求封装成PSR7请求的需求。由于找不到这样的库,我不得不自己编写。

安装

composer require org_heigl/psr7wrapper

使用方法

use Org_Heigl\Psr7Wrapper\Wrapper\Zf1\RequestWrapper;
use Org_Heigl\Psr7Wrapper\Wrapper\Zf1\ResponseWrapper;

class DemoController Extends Zend_Controller_Abstract
{
    public function testAction()
    {
        $request = new RequestWrapper($this->getRequest());
        $request = new ResponseWrapper($this->getResponse());
    }
}