This package is abandoned and no longer maintained. No replacement package was suggested.

Tac and tail library.

1.0 2013-11-08 12:18 UTC

This package is not auto-updated.

Last update: 2020-07-16 12:26:16 UTC


README

Tac is a tac and a tail php implementation for text files.

Build Status

Usage

If /path/to/file contains contains this :

abc
def
ghi

tac() will return

$tac = new \Tac\Tac( '/path/to/file' );
var_dump($tac->tac(2));
/*
array(2) {
  [0] =>
  string(3) "ghi"
  [1] =>
  string(3) "def"
}
*/

tail() will return

$tac = new \Tac\Tac( '/path/to/file' );
var_dump($tac->tail(2));
/*
array(2) {
  [0] =>
  string(3) "def"
  [1] =>
  string(3) "ghi"
}
*/

Unit Tests

phpunit

Thanks

Files structure inspired by Geocoder from William Durand