2017 © Pedro Peláez
 

library dir

Recursive directory scanner to locate directories and/or files in a file system

image

crysalead/dir

Recursive directory scanner to locate directories and/or files in a file system

  • Thursday, June 22, 2017
  • by jails
  • Repository
  • 4 Watchers
  • 7 Stars
  • 18,346 Installations
  • PHP
  • 6 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 7 Versions
  • 0 % Grown

The README.md

Dir - Directory Scanner

Build Status Code Coverage, (*1)

Dir is a small library which allows to perform some recursive operations on directories., (*2)

Dir::scan()

Gets all nested directories and/or files present inside a directory., (*3)

$files = Dir::scan('my/dir',       // Can be a string path of an array of string paths
    [
        'include' => '*.txt',      // Can be an array of includes
        'exclude' => '*.save.txt', // Can be an array of excludes
        'type'    => 'file'        // Can be an array of types, possible values:
                                   // `'file'`, `'dir'`, `'executable'`, `'link'`, `'readable'`, `'writable'`
        'skipDots'       => true,  // Keeps '.' and '..' directories in result
        'leavesOnly'     => true,  // Keeps only leaves
        'followSymlinks' => true,  // Follows Symlinks
        'recursive'      => true   // Scans recursively,
        'copyHandler'    => function($path, $target) { // The copy handler
            copy($path, $target);
        }
    ]
);

Dir::copy()

Copies a directory with files recursively into a destination folder., (*4)

$files = Dir::copy('my/dir',       // A string path of an array of string paths
    'my/destination',              // A destination path (string only)
    [
        'mode'           => 0755,  // Mode used for directory creation
        'childrenOnly'   => false, // Copies the file inside 'my/dir' if `true`, otherwise `dir` will be
                                   // added as the root directory.
        'followSymlinks' => true,  // Follows Symlinks
        'recursive'      => true   // Scans recursively
    ]
);

Dir::remove()

Removes a directory and all its content recursively., (*5)

Dir::remove('my/dir',     // Can be a string path of an array of string paths
    [
        'followSymlinks' => false,        // Follows Symlinks
        'recursive'      => true,         // Scans recursively
        'include'        => '*.txt',      // Can be an array of includes
        'exclude'        => '*.save.txt', // Can be an array of excludes
    ]
);

Dir::make()

Makes nested directories., (*6)

$success = Dir::make('my/dir',  // Can be a string path of an array of string paths
    [
        'mode'      => 0755,         // Mode used for directory creation
        'recursive' => true,         // Scans recursively
        'include'   => '*.txt',      // Can be an array of includes
        'exclude'   => '*.save.txt', // Can be an array of excludes
    ]
);

Dir::tempnam()

Creates a temporary folder (like the tempnam() function but for directories)., (*7)

$dir = Dir::tempnam(sys_get_temp_dir(), 'mytmp');

The Versions

22/06 2017

dev-master

9999999-dev

Recursive directory scanner to locate directories and/or files in a file system

  Sources   Download

MIT

The Requires

  • php >=5.4

 

The Development Requires

file directory file system directory scanner

15/10 2016

2.0.3

2.0.3.0

Recursive directory scanner to locate directories and/or files in a file system

  Sources   Download

MIT

The Requires

  • php >=5.4

 

The Development Requires

file directory file system directory scanner

01/05 2016

2.0.2

2.0.2.0

Recursive directory scanner to locate directories and/or files in a file system

  Sources   Download

MIT

The Requires

  • php >=5.4

 

The Development Requires

file directory file system directory scanner

01/05 2016

2.0.1

2.0.1.0

Recursive directory scanner to locate directories and/or files in a file system

  Sources   Download

MIT

The Requires

  • php >=5.4

 

The Development Requires

file directory file system directory scanner

06/12 2015

2.0.0

2.0.0.0

Recursive directory scanner to locate directories and/or files in a file system

  Sources   Download

MIT

The Requires

  • php >=5.4

 

The Development Requires

file directory file system directory scanner

24/11 2015

1.0.1

1.0.1.0

Recursive directory scanner to locate directories and/or files in a file system

  Sources   Download

MIT

The Requires

  • php >=5.4

 

The Development Requires

file directory file system directory scanner

19/03 2015

1.0.0

1.0.0.0

Recursive directory scanner to locate directories and/or files in a file system

  Sources   Download

MIT

The Requires

  • php >=5.4

 

The Development Requires

file directory file system directory scanner