atk14/string-buffer
最新稳定版本:v1.2.4
Composer 安装命令:
composer require atk14/string-buffer
包简介
StringBuffer is a PHP class providing operations for efficient string buffering
README 文档
README
StringBuffer is a PHP class providing operations for efficient string buffering
Basic usage
$sb = new StringBuffer();
$sb->addString("Hello World!\n");
$sb->addFile("path/to/file");
$length = $sb->getLength();
$sb->printOut();
Converting StringBuffer into a string:
$string = (string)$sb;
// or
$string = "$sb";
// or
$string = $sb->toString();
Temporary buffer
You can use StringBuffer to store and manipulate large chunks of data without consuming excessive memory.
$buffer = new StringBufferTemporary();
// read something big in chunks
$buffer->add($megabyte);
$buffer->add($megabyte);
$buffer->add($megabyte);
$buffer->add($megabyte);
$buffer->add($megabyte);
// and so on... :)
$buffer->printOut();
// or
$buffer->writeToFile($target_filename);
Constant TEMP can be defined in order to specify the desired temporary directory for storing string buffer items.
define("TEMP","/path/to/temp/");
Installation
Use the Composer to install StringBuffer.
cd path/to/your/project/
composer require atk14/string-buffer
Licence
StringBuffer is free software distributed under the terms of the MIT license
统计信息
- 总下载量: 27.82k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 1
- 依赖项目数: 5
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-01-24