2017 © Pedro Peláez
 

library filesystem

Handles filesystem operations

image

phellow/filesystem

Handles filesystem operations

  • Saturday, December 20, 2014
  • by christianblos
  • Repository
  • 1 Watchers
  • 0 Stars
  • 19 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Install via Composer

Add the following dependency to your project's composer.json file:, (*1)

{
    "require": {
        "phellow/filesystem": "1.*"
    }
}

Usage

The FilesystemOperator is the main class to work with files and directories. You can add an object of this class to your Dependency Injection Container., (*2)

$fs = new \Phellow\Filesystem\FilesystemOperator();

// create a directory if not exists
$fs->ensureDir('some/dir');

// copy file or directory
$fs->copy('someFile', 'newFile');
$fs->copy('some/dir', 'new/dir');

// get all files/directories of a directory
$files = $fs->getFiles('some/dir');
foreach ($files as $file) {
    if ($file->isFile()) {
        echo $file->path . ' is a file';
    } elseif ($file->isDirectory()) {
        echo $file->path . ' is a dir';
    } elseif ($file->isSymlink()) {
        echo $file->path . ' is a symlink';
    }
}

To see all the possibilities, you can check out the Unit Tests under tests/., (*3)

License

The MIT license., (*4)

The Versions

20/12 2014

dev-master

9999999-dev

Handles filesystem operations

  Sources   Download

MIT

The Development Requires

by Christian Blos

20/12 2014

1.0.0

1.0.0.0

Handles filesystem operations

  Sources   Download

MIT

The Development Requires

by Christian Blos