2017 © Pedro Peláez
 

library phpio

PHP class for batch file processing. You can read, write, delete, move. All in pretty object.

image

kedrigern/phpio

PHP class for batch file processing. You can read, write, delete, move. All in pretty object.

  • Tuesday, March 14, 2017
  • by Kedrigern
  • Repository
  • 6 Watchers
  • 62 Stars
  • 21 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 2 Open issues
  • 5 Versions
  • 0 % Grown

The README.md

phpIO

Contains class for manipulation with files. It is simple wrapper over internal functions, but in pretty object form., (*1)

Build Status, (*2)

Examples

We suppose:, (*3)

$files = new \Kedrigern\phpIO\Files();

Cat all *.txt files and after delete them:, (*4)

$cat = function($file) {
    echo "Filename: $file \n";
    echo file_get_contents($file);
    echo "\n";
};

$files->dir('*.txt')->call($cat)->delete();

Write "Some data" to all *.txt files and after move them to the directory archive. If files are not writable throw exception with description of problem (exact file, privileges etc.), (*5)

$fill = function($file) {
    file_put_contents($file, "Some data.");
};

$files->dir('*.txt')->writeable()->call($fill)->move('archive', true);

Sum numbers from files (with num sufix):, (*6)

$parseIntFromFile = function($file) {
    return intval(file_get_contents($file));
};

$postSum = function($results) {
    return array_sum($results);
};

$files->dir('*.num')->call($parseIntFromFile, $postSum, $log);

// now $log['post'] contains sum

Install and tests

composer install
vendor/bin/tester -c test/ test/

Authors and contact

The Versions

14/03 2017

dev-master

9999999-dev https://github.com/Kedrigern/phpio

PHP class for batch file processing. You can read, write, delete, move. All in pretty object.

  Sources   Download

GPL-3.0 BSD-3-Clause

The Requires

  • php >=5.3.0

 

The Development Requires

file batch io

07/08 2014

v0.7.1

0.7.1.0 https://github.com/Kedrigern/phpio

PHP class for batch file processing. You can read, write, delete, move. All in pretty object.

  Sources   Download

GPL-3.0 BSD-3-Clause

The Requires

  • php >=5.3.0

 

The Development Requires

file batch io

28/07 2014

v0.7

0.7.0.0 https://github.com/Kedrigern/phpio

PHP class for batch file processing. You can read, write, delete, move. All in pretty object.

  Sources   Download

GPL-3.0 BSD-3-Clause

The Requires

  • php >=5.3.0

 

The Development Requires

file batch io

28/07 2014

v0.6

0.6.0.0 https://github.com/Kedrigern/phpio

PHP class for batch file processing. You can read, write, delete, move. All in pretty object.

  Sources   Download

GPL-3.0 BSD-3-Clause

The Requires

  • php >=5.3.0

 

The Development Requires

file io

27/07 2014

v0.5

0.5.0.0 https://github.com/Kedrigern/phpio

PHP class for batch file processing. You can read, write, delete, move. All in pretty object.

  Sources   Download

GPL-3.0 BSD-3-Clause

The Requires

  • php >=5.3.0

 

The Development Requires

file io