Skip to content

Commit

Permalink
Add REAMDE
Browse files Browse the repository at this point in the history
  • Loading branch information
mbfisher committed Apr 26, 2014
1 parent 9f8f9c5 commit 6453ebe
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
task/filesystem
===============

Example
=======
```php
use Task\Plugin\FilesystemPlugin;
use Symfony\Component\Finder\Finder;

$project->inject(function ($container) {
$container['fs'] = new FilesystemPlugin;
});

$project->addTask('write', ['fs', function ($fs) {
$fs->open('/tmp/foo')->write('wow');
}]);

$project->addTask('read', ['fs', function ($fs) {
$fs->read('/tmp/foo')->pipe($this->getOutput());
}]);

$project->addTask('copy', ['fs', function ($fs) {
$fs->copy('/tmp/foo', '/tmp/bar');
# OR
$fs->read('/tmp/foo')->pipe($fs->touch('/tmp/bar'));
}]);

$project->addTask('copyTree', ['fs', function ($fs) {
$finder = new Finder;
$finder->name('foo')->in('/tmp/source');
$fs->copyTree('/tmp'source', '/tmp/target', $finder);
}]);
```

Installation
============

Add to `composer.json`:
```json
...
"require-dev": {
"task/filesystem": "~0.2"
}
...
```

Usage
=====

0 comments on commit 6453ebe

Please sign in to comment.