Download the PHP package stilliard/generic-loading-bar without Composer
On this page you can find all versions of the php package stilliard/generic-loading-bar. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download stilliard/generic-loading-bar
More information about stilliard/generic-loading-bar
Files in stilliard/generic-loading-bar
Package generic-loading-bar
Short Description Generic loading bar PHP component
License MIT
Informations about the package generic-loading-bar
Generic Loading Bar
A generic PHP loader/progress bar utility package to help with applications that need to display a loading bar during a long running process.
Install with composer:
Basic usage
or with options:
Display the loading bar
or
Ranged loading calculations
Ranged calculations are the original reason for this package. Want to split your loading into 4 parts, each with 25% but then have maybe thousands of records to process inside? This handles this for you.
Demo
Check out the demo
folder for a basic CLI demo in cli.php
, or a full web and background process demo using the Redis data handler in the html
folder, there's a README.md
file in there with more information.
Data Handlers
- Process
ProcessDataHandler
runs just in process and doesn't save anywhere - Redis
RedisDataHandler
uses redis to store the current loading % - PDO
PDODataHandler
uses a database with a PDO instance, lets you pass a DB PDO instance/object in via the construct options to then query an assumedloading_bars
table withname
andvalue
columns. - DB
DBDataHandler
like above PDO one but instead of passing apdo
instance, it assumes you have aDB
global class
Build your own by extending the abstract BaseDataHandler
class, see how the above ones work as an example in the src/DataHandler
folders.
Display Handlers
- Echo
EchoDisplayHandler
simply echos/outputs the current % at the point of->display()
called - Console
ConsoleDisplayHandler
a CLI/Console ascii loading/progress bar e.g.[===> ] 50%
- HTML
HTMLDisplayHandler
shows a<progress>
element at point of display, could then be auto refreshed from there through ajax
Build your own by extending the abstract BaseDisplayHandler
class, see how the above ones work as an example in the src/DisplayHandler
folders.
License
This project is open-sourced software licensed under the MIT license.