定制 jimenezmaximiliano/php-tail-file 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

jimenezmaximiliano/php-tail-file

最新稳定版本:1.1.6

Composer 安装命令:

composer require jimenezmaximiliano/php-tail-file

包简介

Efficiently reads the last lines of a file like the tail command

README 文档

README

Latest Version Maintenance Coverage

Efficiently tail a file from PHP - Reads the last x number of lines of a file (similar to Unix's tail command)

  • Great performance
  • It doesn't load the whole file to memory
  • Skips trailing new lines and empty lines
  • No dependencies
  • Tested on Linux, Windows and macOS
  • Compatible with PHP 7.4 and ^8

Usually used to read the last lines of:

  • CSV files
  • Log files
  • JSON files
  • text files

Installation

composer require jimenezmaximiliano/php-tail-file

Usage

$numberOfLines = 2;
$filePath = realpath("file.log");

$lines = Tail::tail($filePath, $numberOfLines);

// ["line 30", "line 31"]

统计信息

  • 总下载量: 7.68k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 3
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2020-09-16