承接 yalesov/file-system-manager 相关项目开发

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

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

yalesov/file-system-manager

Composer 安装命令:

composer require yalesov/file-system-manager

包简介

A collection of file and directory management functions.

README 文档

README

Build Status

A collection of often-used file and directory management functions not present in PHP core.

Installation

Composer:

{
  "require": {
    "yalesov/file-system-manager": "2.*"
  }
}

Usage

Recursively iterate the directory foo, listing all files (child-last):

use \Yalesov\FileSystemManager\FileSystemManager;
foreach (FileSystemManager::fileIterator('foo') as $file) {
  echo $file; // /path/to/file
}

Recursively iterate the directory foo, listing all directories (child-first):

use \Yalesov\FileSystemManager\FileSystemManager;
foreach (FileSystemManager::dirIterator('foo') as $dir) {
  echo $dir; // /path/to/child/dir
}

Recursive rmdir: remove the directory foo along with all child directories and files

use \Yalesov\FileSystemManager\FileSystemManager;
FileSystemManager::rrmdir('foo');

Recursive copy: copy the directory foo to bar along with all child directories and files

Warning: this function overwrites existing files

use \Yalesov\FileSystemManager\FileSystemManager;
FileSystemManager::rcopy('foo', 'bar');

rcopy will copy into existing directories if they already exist. By default, it will create non-existent directories with permission 0755. You can change this by specifying the third parameter:

FileSystemManager::rcopy('foo', 'bar', 0777);

Recursive chmod: chmod the directory foo to 0755, along with all child directories and files

use \Yalesov\FileSystemManager\FileSystemManager;
FileSystemManager::rchmod('foo', 0755);

Recursive chown: chown the directory foo to www-data, along with all child directories and files

use \Yalesov\FileSystemManager\FileSystemManager;
FileSystemManager::rchown('foo', 'www-data');

Recursive chgrp: chgrp the directory foo to www-data, along with all child directories and files

use \Yalesov\FileSystemManager\FileSystemManager;
FileSystemManager::rchown('foo', 'www-data');

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: ISC
  • 更新时间: 2016-07-05