phellow/filesystem 问题修复 & 功能扩展

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

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

phellow/filesystem

最新稳定版本:1.0.0

Composer 安装命令:

composer require phellow/filesystem

包简介

Handles filesystem operations

README 文档

README

Add the following dependency to your project's composer.json file:

{
    "require": {
        "phellow/filesystem": "1.*"
    }
}

Usage

The FilesystemOperator is the main class to work with files and directories. You can add an object of this class to your Dependency Injection Container.

$fs = new \Phellow\Filesystem\FilesystemOperator();

// create a directory if not exists
$fs->ensureDir('some/dir');

// copy file or directory
$fs->copy('someFile', 'newFile');
$fs->copy('some/dir', 'new/dir');

// get all files/directories of a directory
$files = $fs->getFiles('some/dir');
foreach ($files as $file) {
    if ($file->isFile()) {
        echo $file->path . ' is a file';
    } elseif ($file->isDirectory()) {
        echo $file->path . ' is a dir';
    } elseif ($file->isSymlink()) {
        echo $file->path . ' is a symlink';
    }
}

To see all the possibilities, you can check out the Unit Tests under tests/.

License

The MIT license.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-12-20