bcncommerce/stream-wrapper 问题修复 & 功能扩展

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

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

bcncommerce/stream-wrapper

最新稳定版本:1.0.1

Composer 安装命令:

composer require bcncommerce/stream-wrapper

包简介

PHP stream wrapper for testing classes which interact with files

README 文档

README

This library provide a lightweight class which allows substitute PHP streams. It's very useful for Unit Testing when you need to test a class which interact with files.

Stream class create an unique stream wrapper which redirect file system calls to instance of Stream class, making the process fully controllable.

Usage

Reading

$stream = new Stream("Content");

// This code use variable instead of using actual file
$fh = fopen($stream, "r");
echo fgets($fh); // output Content
fclose($fh);

Writing

$stream = new Stream();

// This code write everything into variable
$fh = fopen($stream, "r");
fputs($fh, "Content");
fclose($fh);

// Now you can perform actions on generated content
echo $stream->getContent(); // output Content

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-03-28

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固