From d5e76d4975f450256df6d687174d445fccb50da8 Mon Sep 17 00:00:00 2001 From: sparkyx Date: Tue, 10 Mar 2026 23:34:09 +0100 Subject: [PATCH] Source code documentation --- include/lib/progress_bar.class.php | 42 +++++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/include/lib/progress_bar.class.php b/include/lib/progress_bar.class.php index 1d1c2151f..4e4fb3938 100644 --- a/include/lib/progress_bar.class.php +++ b/include/lib/progress_bar.class.php @@ -35,10 +35,50 @@ * progress in the db. * The ajax parameter for following the task is task_id * + * How to use it + * + * a) in the javascript , can an ajax to perform your task + * + * @code + + * @endcode + * + * b) in ajax function in PHP + // create the progress back with the task id + if ($op=='upgradeCore') +{ + $task_id=$http->request("task_id"); + $progress=new Progress_Bar($task_id); + // with set_value you increment the progress bar + $progress->set_value(2); + + * + * + * + * + * + * *@note you have to use session_write_close(); in the ajax file , otherwise, * the function progress_bar_check will be blocked and won't update the progress * bar * + * + * *@see progress_bar_start *@see progress_bar_check * @@ -47,7 +87,7 @@ class Progress_Bar { private $db ; //!< database connexion - private $task_id ; //! task id (progress_bar.p_id) + private $task_id ; //! task id must be unique (progress_bar.p_id) private $value; //!< value of progress (between 0 & 100) /** * @example progress-bar.test.php test of this class