decodelabs / atlas
Easy filesystem and io functions
Installs: 20 371
Dependents: 14
Suggesters: 2
Security: 0
Stars: 2
Watchers: 2
Forks: 1
Open Issues: 0
Requires
- php: ^8.4
- decodelabs/coercion: ^0.3
- decodelabs/deliverance: ^0.2.14
- decodelabs/enumerable: ^0.2
- decodelabs/exceptional: ^0.5.2
- decodelabs/glitch-support: ^0.5.1
- decodelabs/veneer: ^0.12.2
Requires (Dev)
- dev-develop / 0.12.x-dev
- v0.12.4
- v0.12.3
- v0.12.2
- v0.12.1
- v0.12.0
- v0.11.4
- v0.11.3
- v0.11.2
- v0.11.1
- v0.11.0
- v0.10.7
- v0.10.6
- v0.10.5
- v0.10.4
- v0.10.3
- v0.10.2
- v0.10.1
- v0.10.0
- v0.9.4
- v0.9.3
- v0.9.2
- v0.9.1
- v0.9.0
- v0.8.1
- v0.8.0
- v0.7.9
- v0.7.8
- v0.7.7
- v0.7.6
- v0.7.5
- v0.7.4
- v0.7.3
- v0.7.2
- v0.7.1
- v0.7.0
- v0.6.1
- v0.6.0
- v0.5.0
- dev-main
This package is auto-updated.
Last update: 2025-04-14 08:43:50 UTC
README
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
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::file('my/file') ->renameTo('file.txt') ->setOwner('user'); Atlas::gzFile('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.