Coding standards
Security in ResourceSpace
Developer reference
Database
User api session functions
Geolocation functions
Storage test functions
Cli functions
Lang translation functions

cli_progress_frame()

Description

Get the spinner and filled and empty segments of a progress bar.

Parameters

ColumnTypeDefaultDescription
$finished int Completed work items.
$total int Total work items.
$frame: int ['⠋'
'⠙'
'⠹'
'⠸'
'⠼'
'⠴'
'⠦'
'⠧'
'⠇'
$total;
min12
floor12 int
str_repeat'━'
$filled
str_repeat'─'
- 12
$detail string
$frame int 0: void { if !cli_is_interactive Animation frame index.

Return

array{string, string, string} Spinner, completed segment and remaining segment.

Location

include/cli_functions.php lines 80 to 85

Definition

 
function cli_progress_frame(int $finished, int $total, int $frame): array
{
    
$spinner = ['⠋', '⠙', '⠹', '⠸', '⠼', '⠴', '⠦', '⠧', '⠇', '⠏'];
    
$filled = max(0, min(12, (int) floor(12 * $finished / max(1, $total))));
    return [
$spinner[$frame % count($spinner)], str_repeat('━', $filled), str_repeat('─', 12 - $filled)];
}

This article was last updated 27th November 2026 18:35 Europe/London time based on the source file dated 27th November 2026 17:15 Europe/London time.