Joomla CMS  4.2.2
Documentation des API du CMS Joomla en version 4.2.2
Tout Structures de données Espaces de nommage Fichiers Fonctions Variables Pages
Référence de la classe ProgressBar

Fonctions membres publiques

 __construct (OutputInterface $output, int $max=0, float $minSecondsBetweenRedraws=1/25)
 
 setMessage (string $message, string $name='message')
 
 getMessage (string $name='message')
 
 getStartTime ()
 
 getMaxSteps ()
 
 getProgress ()
 
 getProgressPercent ()
 
 getBarOffset ()
 
 getEstimated ()
 
 getRemaining ()
 
 setBarWidth (int $size)
 
 getBarWidth ()
 
 setBarCharacter (string $char)
 
 getBarCharacter ()
 
 setEmptyBarCharacter (string $char)
 
 getEmptyBarCharacter ()
 
 setProgressCharacter (string $char)
 
 getProgressCharacter ()
 
 setFormat (string $format)
 
 setRedrawFrequency (?int $freq)
 
 minSecondsBetweenRedraws (float $seconds)
 
 maxSecondsBetweenRedraws (float $seconds)
 
 iterate (iterable $iterable, int $max=null)
 
 start (int $max=null)
 
 advance (int $step=1)
 
 setOverwrite (bool $overwrite)
 
 setProgress (int $step)
 
 setMaxSteps (int $max)
 
 finish ()
 
 display ()
 
 clear ()
 

Fonctions membres publiques statiques

static setPlaceholderFormatterDefinition (string $name, callable $callable)
 
static getPlaceholderFormatterDefinition (string $name)
 
static setFormatDefinition (string $name, string $format)
 
static getFormatDefinition (string $name)
 

Champs de données

const FORMAT_VERBOSE = 'verbose'
 
const FORMAT_VERY_VERBOSE = 'very_verbose'
 
const FORMAT_DEBUG = 'debug'
 
const FORMAT_NORMAL = 'normal'
 

Fonctions membres privées

 getStepWidth ()
 
 setRealFormat (string $format)
 
 overwrite (string $message)
 
 determineBestFormat ()
 
 buildLine ()
 

Fonctions membres privées statiques

static initPlaceholderFormatters ()
 
static initFormats ()
 

Attributs privés

const FORMAT_VERBOSE_NOMAX = 'verbose_nomax'
 
const FORMAT_VERY_VERBOSE_NOMAX = 'very_verbose_nomax'
 
const FORMAT_DEBUG_NOMAX = 'debug_nomax'
 
const FORMAT_NORMAL_NOMAX = 'normal_nomax'
 
 $barWidth = 28
 
 $barChar
 
 $emptyBarChar = '-'
 
 $progressChar = '>'
 
 $format
 
 $internalFormat
 
 $redrawFreq = 1
 
 $writeCount
 
 $lastWriteTime
 
 $minSecondsBetweenRedraws = 0
 
 $maxSecondsBetweenRedraws = 1
 
 $output
 
 $step = 0
 
 $max
 
 $startTime
 
 $stepWidth
 
 $percent = 0.0
 
 $formatLineCount
 
 $messages = []
 
 $overwrite = true
 
 $terminal
 
 $previousMessage
 
 $cursor
 

Attributs privés statiques

static $formatters
 
static $formats
 

Description détaillée

The ProgressBar provides helpers to display progress output.

Auteur
Fabien Potencier fabie.nosp@m.n@sy.nosp@m.mfony.nosp@m..com
Chris Jones leeke.nosp@m.d@gm.nosp@m.ail.c.nosp@m.om

Documentation des constructeurs et destructeur

◆ __construct()

__construct ( OutputInterface  $output,
int  $max = 0,
float  $minSecondsBetweenRedraws = 1 / 25 
)

Documentation des fonctions membres

◆ advance()

advance ( int  $step = 1)

Advances the progress output X steps.

Paramètres
int$stepNumber of steps to advance

Références ProgressBar\$step, et ProgressBar\setProgress().

Référencé par ProgressBar\iterate().

◆ buildLine()

buildLine ( )
private

◆ clear()

clear ( )

Removes the progress bar from the current line.

This is useful if you wish to write some output while a progress bar is running. Call display() to show the progress bar again.

Références ProgressBar\determineBestFormat(), null, ProgressBar\overwrite(), et ProgressBar\setRealFormat().

◆ determineBestFormat()

◆ display()

◆ finish()

finish ( )

Finishes the progress output.

Références ProgressBar\$step, ProgressBar\overwrite(), et ProgressBar\setProgress().

Référencé par ProgressBar\iterate().

◆ getBarCharacter()

getBarCharacter ( )

◆ getBarOffset()

getBarOffset ( )

Références null.

◆ getBarWidth()

getBarWidth ( )

◆ getEmptyBarCharacter()

getEmptyBarCharacter ( )

◆ getEstimated()

getEstimated ( )

◆ getFormatDefinition()

static getFormatDefinition ( string  $name)
static

Gets the format for a given name.

Paramètres
string$nameThe format name

Références $name, et null.

◆ getMaxSteps()

getMaxSteps ( )

Références ProgressBar\$max.

◆ getMessage()

getMessage ( string  $name = 'message')

Références $name.

◆ getPlaceholderFormatterDefinition()

static getPlaceholderFormatterDefinition ( string  $name)
static

Gets the placeholder formatter for a given name.

Paramètres
string$nameThe placeholder name (including the delimiter char like %)

Références $name, et null.

◆ getProgress()

getProgress ( )

Références ProgressBar\$step.

◆ getProgressCharacter()

getProgressCharacter ( )

◆ getProgressPercent()

getProgressPercent ( )

Références ProgressBar\$percent.

◆ getRemaining()

getRemaining ( )

◆ getStartTime()

getStartTime ( )

Références ProgressBar\$startTime.

◆ getStepWidth()

getStepWidth ( )
private

Références ProgressBar\$stepWidth.

◆ initFormats()

static initFormats ( )
staticprivate

◆ initPlaceholderFormatters()

◆ iterate()

iterate ( iterable  $iterable,
int  $max = null 
)

Returns an iterator that will automatically update the progress bar when iterated.

Paramètres
int | null$maxNumber of steps to complete the bar (0 if indeterminate), if null it will be inferred from $iterable

Références $key, ProgressBar\$max, $value, ProgressBar\advance(), ProgressBar\finish(), et ProgressBar\start().

◆ maxSecondsBetweenRedraws()

maxSecondsBetweenRedraws ( float  $seconds)

Référencé par ProgressBar\setProgress().

◆ minSecondsBetweenRedraws()

minSecondsBetweenRedraws ( float  $seconds)

◆ overwrite()

◆ setBarCharacter()

setBarCharacter ( string  $char)

◆ setBarWidth()

setBarWidth ( int  $size)

Références $size.

Référencé par ProgressBar\buildLine().

◆ setEmptyBarCharacter()

setEmptyBarCharacter ( string  $char)

◆ setFormat()

setFormat ( string  $format)

Références ProgressBar\$format, et null.

◆ setFormatDefinition()

static setFormatDefinition ( string  $name,
string  $format 
)
static

Sets a format for a given name.

This method also allow you to override an existing format.

Paramètres
string$nameThe format name
string$formatA format string

Références ProgressBar\$format, et $name.

Référencé par UpdateCoreCommand\configureIO().

◆ setMaxSteps()

setMaxSteps ( int  $max)

◆ setMessage()

setMessage ( string  $message,
string  $name = 'message' 
)

Associates a text with a named placeholder.

The text is displayed when the progress bar is rendered but only when the corresponding placeholder is part of the custom format line (by wrapping the name with %).

Paramètres
string$messageThe text to associate with the placeholder
string$nameThe name of the placeholder

Références $message, et $name.

◆ setOverwrite()

setOverwrite ( bool  $overwrite)

Sets whether to overwrite the progressbar, false for new line.

Références ProgressBar\$overwrite, et ProgressBar\overwrite().

◆ setPlaceholderFormatterDefinition()

static setPlaceholderFormatterDefinition ( string  $name,
callable  $callable 
)
static

Sets a placeholder formatter for a given name.

This method also allow you to override an existing placeholder.

Paramètres
string$nameThe placeholder name (including the delimiter char like %)
callable$callableA PHP callable

Références $name.

◆ setProgress()

◆ setProgressCharacter()

setProgressCharacter ( string  $char)

◆ setRealFormat()

setRealFormat ( string  $format)
private

Références ProgressBar\$format, elseif, et null.

Référencé par ProgressBar\clear(), et ProgressBar\display().

◆ setRedrawFrequency()

setRedrawFrequency ( ?int  $freq)

Sets the redraw frequency.

Paramètres
int | null$freqThe frequency in steps

Références null.

◆ start()

start ( int  $max = null)

Starts the progress output.

Paramètres
int | null$maxNumber of steps to complete the bar (0 if indeterminate), null to leave unchanged

Références ProgressBar\$max, ProgressBar\display(), null, et ProgressBar\setMaxSteps().

Référencé par ProgressBar\iterate().

Documentation des champs

◆ $barChar

$barChar
private

◆ $barWidth

$barWidth = 28
private

Référencé par ProgressBar\getBarWidth().

◆ $cursor

$cursor
private

◆ $emptyBarChar

$emptyBarChar = '-'
private

◆ $format

◆ $formatLineCount

$formatLineCount
private

Référencé par ProgressBar\overwrite().

◆ $formats

$formats
staticprivate

◆ $formatters

$formatters
staticprivate

◆ $internalFormat

$internalFormat
private

◆ $lastWriteTime

$lastWriteTime
private

Référencé par ProgressBar\setProgress().

◆ $max

◆ $maxSecondsBetweenRedraws

◆ $messages

$messages = []
private

◆ $minSecondsBetweenRedraws

Référencé par ProgressBar\__construct().

◆ $output

◆ $overwrite

$overwrite = true
private

Référencé par ProgressBar\setOverwrite().

◆ $percent

$percent = 0.0
private

◆ $previousMessage

$previousMessage
private

◆ $progressChar

$progressChar = '>'
private

◆ $redrawFreq

$redrawFreq = 1
private

Référencé par ProgressBar\setProgress().

◆ $startTime

$startTime
private

Référencé par ProgressBar\getStartTime().

◆ $step

◆ $stepWidth

$stepWidth
private

Référencé par ProgressBar\getStepWidth().

◆ $terminal

$terminal
private

◆ $writeCount

$writeCount
private

Référencé par ProgressBar\overwrite().

◆ FORMAT_DEBUG

const FORMAT_DEBUG = 'debug'

◆ FORMAT_DEBUG_NOMAX

const FORMAT_DEBUG_NOMAX = 'debug_nomax'
private

◆ FORMAT_NORMAL

const FORMAT_NORMAL = 'normal'

◆ FORMAT_NORMAL_NOMAX

const FORMAT_NORMAL_NOMAX = 'normal_nomax'
private

◆ FORMAT_VERBOSE

const FORMAT_VERBOSE = 'verbose'

◆ FORMAT_VERBOSE_NOMAX

const FORMAT_VERBOSE_NOMAX = 'verbose_nomax'
private

◆ FORMAT_VERY_VERBOSE

const FORMAT_VERY_VERBOSE = 'very_verbose'

◆ FORMAT_VERY_VERBOSE_NOMAX

const FORMAT_VERY_VERBOSE_NOMAX = 'very_verbose_nomax'
private

La documentation de cette classe a été générée à partir du fichier suivant :