unreal4u/file-operations 问题修复 & 功能扩展

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

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

unreal4u/file-operations

最新稳定版本:v0.4.3

Composer 安装命令:

composer require unreal4u/file-operations

包简介

This class is a collection of functions that deals with files

README 文档

README

Latest Stable Version Build Status Scrutinizer Code Quality License

unreal4u/file-operations

This class is able to retrieve files based on several parameters and perform configurable and extendable operations on them.

Credits

This class is made by unreal4u (Camilo Sperberg). unreal4u.com/

About this class

  • This class will allow you to select files and perform operations on them.
  • A few examples are included, such as get the contents or delete them
  • Endless posibilities: just create your own and extend the abstract fileSelection class
  • Needs PHP7+

Disclaimer

Usage of this class is entirely up to you. Read all documentation before you use this class!

Detailed description

This package is a collection of functions related to file manipulation. The idea behind it is actually pretty simple: with the base class fileSelection you select files, based on several parameters, such as maximum age of the file, or based on a regex selector.

After you have made your selection, you proceed to do the action. That action are actually classes that extend the base class and implement the final action which can be whatever you want. Included are 2 examples: a fileDeleter; which as the name states, is able to delete files (it also has a test mode, I suggest you use that before you put any code on production); and a contentGetter, which reads the file out and puts together an array with data.

Basic usage

<?php

include 'vendor/autoload.php';
// Instantiate a deleter in test mode
$fileDeleter = new unreal4u\FileOperations\fileDeleter(true);
$options = [
    'pattern' => '/test\d{3}\.txt/',
];
$fileDeleter->constructFileList('testdir/', $options)->perform();
  • Congratulations! All files that comply with the requirements would have been deleted!
  • Please see examples and PHPUnit tests for more options and advanced usage

Composer

This class has support for Composer install and is the prefered method. Just add the following section to your composer.json with:

{
    "require": {
        "unreal4u/file-operations": "@stable"
    }
}

Pending

  • Change arguments in fileSelection to an array, with (optional) function callbacks
  • Better documentation
  • A first stable release

Version History

This package will be compatible with Semver once it reaches v1.0.0.

  • 0.4.0:
    • PHP7+ compatibility
  • 0.2.0:
    • BC breakage: function names changed
    • Common interface
  • 0.1.3:
    • Complete code coverage
  • 0.1.2:
    • Array can be passed on with options
    • First PHPUnit tests
  • 0.1.1:
    • More documentation
    • More examples
    • Minor improvements: assume a default of 0 seconds of maximum file age
  • 0.1.0:
    • Created basic class

Contact the author

统计信息

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

GitHub 信息

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

其他信息

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

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固