PHPackages                             ali-eltaweel/tail - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. ali-eltaweel/tail

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

ali-eltaweel/tail
=================

Reads text files from the end

1.0.0(6mo ago)00PHPPHP ^8.1

Since Nov 17Pushed 6mo agoCompare

[ Source](https://github.com/ali-eltaweel/tail)[ Packagist](https://packagist.org/packages/ali-eltaweel/tail)[ RSS](/packages/ali-eltaweel-tail/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (2)Versions (2)Used By (0)

Tail
====

[](#tail)

- [Tail](#tail)
    - [Installation](#installation)
    - [Usage](#usage)
        - [Starting line](#starting-line)
        - [N lines from the end](#n-lines-from-the-end)
        - [Following new lines](#following-new-lines)
            - [Sleep duration](#sleep-duration)
            - [Follow timeout](#follow-timeout)
            - [Follow until a process dies](#follow-until-a-process-dies)

---

Installation
------------

[](#installation)

Install *tail* via Composer:

```
composer require ali-eltaweel/tail
```

Usage
-----

[](#usage)

```
$tail = new Files\Tail();

foreach ($tail->tail('path/to/file.txt') as $line) {

  echo $line;
}
```

The previous loop will iterate over all lines in the specified file.

### Starting line

[](#starting-line)

```
foreach ($tail->tail('path/to/file.txt', startLine: 3) as $line) {

  echo $line;
}
```

> note: You can either specify $startLine or $line not both.

### N lines from the end

[](#n-lines-from-the-end)

```
foreach ($tail->tail('path/to/file.txt', lines: 5) as $line) {

  echo $line;
}
```

> note: You can either specify $startLine or $line not both.

### Following new lines

[](#following-new-lines)

```
foreach ($tail->tail('path/to/file.txt', follow: true) as $line) {

  echo $line;
}
```

#### Sleep duration

[](#sleep-duration)

```
foreach ($tail->tail('path/to/file.txt', follow: true, sleepMicros: 1_000_000) as $line) {

  echo $line;
}
```

#### Follow timeout

[](#follow-timeout)

```
foreach ($tail->tail('path/to/file.txt', follow: true, timeoutMicros: 60_000_000) as $line) {

  echo $line;
}
```

#### Follow until a process dies

[](#follow-until-a-process-dies)

```
foreach ($tail->tail('path/to/file.txt', follow: true, pid: 123) as $line) {

  echo $line;
}
```

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance69

Regular maintenance activity

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

183d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7564e10ba11b25d8700726a92f669e38be2ff9191e8f6ccdfafc36678ffab2b8?d=identicon)[ali-eltaweel](/maintainers/ali-eltaweel)

---

Top Contributors

[![ali-eltaweel](https://avatars.githubusercontent.com/u/45892756?v=4)](https://github.com/ali-eltaweel "ali-eltaweel (1 commits)")

### Embed Badge

![Health badge](/badges/ali-eltaweel-tail/health.svg)

```
[![Health](https://phpackages.com/badges/ali-eltaweel-tail/health.svg)](https://phpackages.com/packages/ali-eltaweel-tail)
```

###  Alternatives

[justcoded/wordpress-theme-boilerplate

WordPress theme boilerplate with better code structure and OOP support.

563.9k1](/packages/justcoded-wordpress-theme-boilerplate)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
