PEAR::HTML::Progress example: Default ProgressBar Observer
Author: Laurent Laville

examples

# Default ProgressBar Observer

$Date: 2005/07/25 12:27:28 $

- Introduction
- Render options
- Output
- PHP source syntax highlight
- Play demo

## Introduction

This example requires :

- PEAR::HTML_Progress 1.2.2 or better (see source at lines 11, 12).

This example will run a ProgressBar in determinate mode that will log into a flat file ('progress_observer.log') each changes.

Here are the contents of that file : a:2:{s:3:"log";s:8:"incValue";s:5:"value";i:10;} a:2:{s:3:"log";s:8:"incValue";s:5:"value";i:20;} a:2:{s:3:"log";s:8:"incValue";s:5:"value";i:30;} a:2:{s:3:"log";s:8:"incValue";s:5:"value";i:40;} a:2:{s:3:"log";s:8:"incValue";s:5:"value";i:50;} a:2:{s:3:"log";s:8:"incValue";s:5:"value";i:60;} a:2:{s:3:"log";s:8:"incValue";s:5:"value";i:70;} a:2:{s:3:"log";s:8:"incValue";s:5:"value";i:80;} a:2:{s:3:"log";s:8:"incValue";s:5:"value";i:90;} a:2:{s:3:"log";s:8:"incValue";s:5:"value";i:100;}

A default progress bar observer is created at line 21, and attached at line 23

[Top]

## Render options

    speed = 100 is set at line 16

HTML_Progress::setAnimSpeed()

    increment = 10 is set at line 18

HTML_Progress::setIncrement()

    border painted with all default options at line 17 (color=black, shape=solid).
    Set size to 2 pixels at line 30.

HTML_Progress::setBorderPainted()
HTML_Progress_UI::setBorderAttributes()

[Top]

## Output

### Screenshot

[Top]

## PHP source syntax highlight

Open source listing in a new window.

[Top]

## Play demo

Run the script.

[Top]