PHPackages                             dexen/pv-php - 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. [CLI &amp; Console](/categories/cli)
4. /
5. dexen/pv-php

ActiveLibrary[CLI &amp; Console](/categories/cli)

dexen/pv-php
============

Drop in replacement for pv, the veritable pipe viewer.

1.2.0(6y ago)28MITPHP

Since Dec 23Pushed 3y ago1 watchersCompare

[ Source](https://github.com/dexen/pv-php)[ Packagist](https://packagist.org/packages/dexen/pv-php)[ Docs](https://github.com/dexen/pv-php)[ RSS](/packages/dexen-pv-php/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependenciesVersions (13)Used By (0)

pv - monitor the progress of data through a pipeline
====================================================

[](#pv---monitor-the-progress-of-data-through-a-pipeline)

Description
-----------

[](#description)

Monitor progress of transfer of large archives, DB backup/restore, etc.

A pure PHP implementation of the `pv` CLI tool. Useful in case of shared web hostings when you have SSH access, but cannot install packages.

Quoting original `pv`'s manual:

> pv shows the progress of data through a pipeline by giving information such as time elapsed, percentage completed (with progress bar), current throughput rate, total data transferred, and ETA.

> To use it, insert it in a pipeline between two processes, with the appropriate options. Its standard input will be passed through to its standard output and progress will be shown on standard error.

> pv will copy each supplied FILE in turn to standard output (- means standard input), or if no FILEs are specified just standard input is copied. This is the same behaviour as cat(1).

Usage
-----

[](#usage)

A subset of options of original `pv` is supported. The aim is to eventually become fully compatible.

`-s SIZE` / `--size SIZE` - assume SIZE bytes to be transferred, for purposes of ETA and completion percentage calculation. Supports 'K' / 'M' / 'G' / 'T' suffix to specify larger units (IEC standard - multiplies of 1024).

`-i INTERVAL` / `--interval INTERVAL` - udate display at about INTERVAL seconds. Decimal values are supported. Default: 0.2 seconds.

Environment
-----------

[](#environment)

Environment variables influencing the script

`$TERM` - terminal type, influences method of line erase. Supported: `xterm` / `linux` - use `CR`; `dumb`/any other: use multiple ASCII `BS`.

`$COLUMNS` - width of terminal in colums influences output width. Used in case `tput cols` does not return usable information. Fallback value: 80.

Examples
--------

[](#examples)

Restore MySQL backup from a dump file, monitor progress.

```
pv
