prolic/humus-stream-response-sender 问题修复 & 功能扩展

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

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

prolic/humus-stream-response-sender

Composer 安装命令:

composer require prolic/humus-stream-response-sender

包简介

ZF2 module that can send stream responses with http range header, xsendfile & pecl_http support

README 文档

README

Build Status Coverage Status Total Downloads Latest Stable Version Latest Unstable Version Dependency Status

Introduction

HumusStreamResponseSender is a Zend Framework 2 module that sends stream responses with HTTP Range header, XSendFile & pecl_http support.

Requirements

Features / Goals

  • Send stream responses with Zend Framwork 2 [COMPLETE]
  • Limit download speed [COMPLETE]
  • Allow for range support (download resume) [COMPLETE]
  • Send streams with pecl_http extension [INCOMPLETE]
  • Send streams with X-SendFile [INCOMPLETE]
  • Send streams with X-Accel-Redirect [INCOMPLETE]
  • Add controller plugin for easy streaming from controllers [COMPLETE]

Installation

  1. Add "prolic/humus-stream-response-sender": "dev-master" to your composer.json
  2. Run php composer.phar install
  3. Enable the module in your config/application.config.php by adding HumusStreamResponseSender to modules

Configuration

Sample configuration:

<?php
return array(
    'HumusStreamResponseSender' => array(
        'enable_speed_limit' => true,
        'enable_range_support' => true,
        'chunk_size' => 1024 * 1024 //  = 1MB/s
    ),
);

Usage of controller plugin

The simplest way to stream a response from a controller, is the stream plugin.

class IndexController extends AbstractActionController
{
    public function fileAction()
    {
        return $this->plugin('stream')->binaryFile('/path/to/my/file');
    }
}

Additional notes

If the speed limit switch is set to true, the used chunksize will also be the download speed in bytes per second

The default configuration is:

  • enable_speed_limit = false
  • enable_range_support = false
  • chunk_size = 262144

统计信息

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

GitHub 信息

  • Stars: 12
  • Watchers: 2
  • Forks: 5
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2013-06-28

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固