Download the PHP package verseles/progressable without Composer

On this page you can find all versions of the php package verseles/progressable. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package progressable

Progressable

A Laravel (not only) package to track and manage progress for different tasks or processes.

CI Codecov PHP Version

Installation

Install the package via Composer:

Optionally, you can publish the config file with:

Configuration

The published config file provides the following options:

Usage

This package provides a main trait: Progressable.

With Laravel

The Progressable trait can be used in any class that needs to track progress.

"Local" refers to the progress of your class/model/etc, while "Overall" represents the average of all Progressable instances using the same unique name.

For parallel jobs, use one stable overall key for the parent operation and one stable local key per worker. The default cache-backed store updates each local entry independently under a cache lock when the cache driver supports atomic locks. Under heavy contention, Laravel may throw Illuminate\Contracts\Cache\LockTimeoutException if the lock cannot be acquired before the wait timeout.

Custom setCustomSaveData() / setCustomGetData() callbacks still receive the full progress snapshot, so custom storage should implement its own concurrency control for parallel writers.

Basic Example

Available Methods

Progress Management

Method Description
setOverallUniqueName(string $name) Set the progress group identifier
setLocalProgress(float $progress) Set progress for this instance (0-100)
getLocalProgress(?int $precision) Get current progress (default precision from config)
incrementLocalProgress(float $amount = 1) Increment progress by amount (can be negative)
resetLocalProgress() Reset instance progress to 0
getOverallProgress(?int $precision) Get average progress of all instances
resetOverallProgress() Clear all progress data for the group
removeLocalFromOverall() Remove this instance from overall calculation
getEstimatedTimeRemaining() Get estimated time remaining in seconds for this instance
getOverallEstimatedTimeRemaining() Get estimated time remaining in seconds for the overall progress

Status Checks

Method Description
isComplete() Check if local progress is 100%
isOverallComplete() Check if overall progress is 100%

Metadata & Status Messages

Method Description
setStatusMessage(?string $message) Set a status message for this instance
getStatusMessage() Get the current status message
setMetadata(array $metadata) Set metadata array for this instance
getMetadata() Get all metadata
addMetadata(string $key, mixed $value) Add/update a single metadata value
getMetadataValue(string $key, mixed $default) Get a single metadata value

Event Callbacks

Method Description
onProgressChange(callable $callback) Called when progress changes: fn($new, $old, $instance)
onComplete(callable $callback) Called when progress reaches 100%: fn($instance)

Configuration

Method Description
setTTL(int $minutes) Set cache time-to-live
getTTL() Get current TTL
setPrecision(int $decimals) Set decimal precision for progress values
getPrecision() Get current precision
setPrefixStorageKey(string $prefix) Set custom cache key prefix (before setting unique name)
setLocalKey(string $key) Set custom identifier for this instance
getLocalKey() Get current instance identifier

Custom Storage (for non-Laravel usage)

Method Description
setCustomSaveData(callable $callback) Set custom save callback
setCustomGetData(callable $callback) Set custom get callback

Example with Callbacks and Metadata

Without Laravel

You can use the Progressable trait without Laravel by providing custom save and get data callbacks:

Testing

Contributing

Please see CONTRIBUTING.md for details.

Changelog

Please see CHANGELOG.md for recent changes.

License

The Progressable package is open-sourced software licensed under the MIT license.


All versions of progressable with dependencies

PHP Build Version
Package Version
Requires php Version >=8.4
illuminate/support Version ^v11|^v12|^v13
illuminate/cache Version ^11|^v12|^v13
illuminate/contracts Version ^11|^v12|^v13
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package verseles/progressable contains the following files

Loading the files please wait ...