承接 kedrigern/phpio 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

kedrigern/phpio

Composer 安装命令:

composer require kedrigern/phpio

包简介

PHP class for batch file processing. You can read, write, delete, move. All in pretty object.

README 文档

README

Contains class for manipulation with files. It is simple wrapper over internal functions, but in pretty object form.

Build Status

Examples

We suppose:

$files = new \Kedrigern\phpIO\Files();

Cat all *.txt files and after delete them:

$cat = function($file) {
	echo "Filename: $file \n";
	echo file_get_contents($file);
	echo "\n";
};

$files->dir('*.txt')->call($cat)->delete();

Write "Some data" to all *.txt files and after move them to the directory archive. If files are not writable throw exception with description of problem (exact file, privileges etc.)

$fill = function($file) {
	file_put_contents($file, "Some data.");
};

$files->dir('*.txt')->writeable()->call($fill)->move('archive', true);

Sum numbers from files (with num sufix):

$parseIntFromFile = function($file) {
	return intval(file_get_contents($file));
};

$postSum = function($results) {
	return array_sum($results);
};

$files->dir('*.num')->call($parseIntFromFile, $postSum, $log);

// now $log['post'] contains sum

Install and tests

composer install
vendor/bin/tester -c test/ test/

Authors and contact

统计信息

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

GitHub 信息

  • Stars: 54
  • Watchers: 4
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2014-07-27

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固