2017 © Pedro Peláez
 

library liner

Liner is a simple file reader

image

mobileka/liner

Liner is a simple file reader

  • Thursday, November 3, 2016
  • by mobileka
  • Repository
  • 0 Watchers
  • 7 Stars
  • 854 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 5 Versions
  • 0 % Grown

The README.md

Build Status Code Climate Coverage Status, (*1)

Liner is a fast and dead simple file reader which allows reading files line by line., (*2)

It has been tested with a number of huge files including those with more than 5 million rows and proved itself as a fast and efficient file reader., (*3)

Requires PHP 5.4 or newer., (*4)

Installation

composer require mobileka/liner:1.1.*, (*5)

And sometimes I find myself looking for this line in installation section:, (*6)

"mobileka/liner": "1.1.*", (*7)

Usage


$liner = new Liner('path/to/a/file'); // or SplFileObject instance // Read the whole file $liner->read(); // Only the first line $liner->read(1); // Only the second line $liner->read(1, 1); // Read 100 lines starting with the 6th line $liner->read(100, 5); // You can also pass a closure as a third argument to mutate the result without iterating over it // Here's how you can read a CSV file: $csvAsArray = $liner->read(0, 0, function($file, $line) { $line = trim($line); return explode(',', $line); }); // A line will be ignored if modifier returns null $anEmptyArray = $liner->read(0, 0, function($file, $line) { return null; }); // almost forgot to mention that you can get the number of lines $liner->getNumberOfLines(); // and that you can also delegate methods to SplFileObject (is it a good idea though?) $liner->eof(); $liner->rewind();

License

Liner is an open-source software and licensed under the MIT License., (*8)

The Versions

03/11 2016

dev-master

9999999-dev

Liner is a simple file reader

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

file reader limit offset

03/11 2016

1.1.0

1.1.0.0

Liner is a simple file reader

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

file reader limit offset

03/11 2016

1.0.3

1.0.3.0

Liner is a simple file reader

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

file reader limit offset

01/10 2015

1.0.2

1.0.2.0

Liner is a simple file reader

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

file reader limit offset

01/10 2015

1.0.1

1.0.1.0

Liner is a simple file reader

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

file reader limit offset