decodelabs/atlas 问题修复 & 功能扩展

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

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

decodelabs/atlas

最新稳定版本:v0.14.2

Composer 安装命令:

composer require decodelabs/atlas

包简介

Easy filesystem and io functions

README 文档

README

PHP from Packagist Latest Version Total Downloads GitHub Workflow Status PHPStan License

Easy filesystem and IO functions for PHP

Atlas provides an easy and accessible interface to file system interaction. Read, write, copy and move files without breaking a sweat.

Installation

This package requires PHP 8.4 or higher.

Install via Composer:

composer require decodelabs/atlas

Usage

Basic local filesystem functions

There are many standard filesystem functions represented by either File or Dir objects. See Context.php, File.php and Dir.php and Node.php for the full list.

use DecodeLabs\Atlas;

Atlas::get('/path/to/dir_or_file')
    ->copyTo('/another/path/');

Atlas::createDir('some/dir/path', 0770);

Atlas::getFile('my/file')
    ->renameTo('file.txt')
    ->setOwner('user');

Atlas::getGzFile('my/file.gz', 'w')
    ->write('hello world')
    ->close();

Dir scanning

Scan the contents of a folder with optional filtering.. Replace "scan" for "list" to return an array rather than a Generator:

use DecodeLabs\Atlas;

foreach(Atlas::scan('my/dir') as $name => $fileOrDir) {
    // All files and dirs in my/dir
}

foreach(Atlas::scanDirs('my/dir') as $name => $dir) {
    // All dirs in my/dir
}

foreach(Atlas::listFilesRecursive('my/dir', function($name, $file) {
    // Return true if you want the file to be output
    return $name !== 'BadFile.php';
}) as $name => $file) {
    // All files in all dirs in my/dir
}

See Dir/ScannerTrait.php for all scanning options.

Licensing

Atlas is licensed under the MIT License. See LICENSE for the full license text.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-10-06

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固