PHP code example of decodelabs / atlas

1. Go to this page and download the library: Download decodelabs/atlas library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

decodelabs / atlas example snippets


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();

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
}