Command line progress bar in PHP -


I am currently trying to add a progress bar in a command line script and I have tried various solutions ( Including Zend and Console_ProgressBar). The problem that is similar to both of them is that the progress bar does not stick under the window, because during the script, new lines and other information are output.

Is there any way to keep progress under the bar terminal, but still the script is running, while being able to produce other information?

[edit]

I thought it:

Instead of the output of STDOUT, I'm actually holding the output in one variable, Erase with echo chr (27). '[2J'] and then add the output to the variable STDOUT and my progress bar after that.

Hope this makes sense :)

<

& lt ;? Php / * Copyright C) 2010, dealnews.com, Inc. All rights reserved and binary forms are redistributed and used with modification, with or without modification, that the following conditions have been fulfilled: redistribution of source code above to maintain copyright notice, this list of conditions and the following disclaimer needed. * Redistribution in binary form, the above disclaimer must be reproduced in the above copyright notice, list of conditions and documentation and / or other materials provided with the distribution. * Dealnews.com, Inc. The name of and not the names of its contributors may be used to support or promote products obtained from this software without specific prior written permission. This software is provided by copyright holders and partners "as is" and with no express or implied warranties, but not limited to, implied warranties of merchandise and suitability for any particular purpose are denied in any event in which copyright owner or contributor Also not responsible for direct, indirect, incidental, special, exemplary, or consequential damages (Dep The loss, use, data, or benefits of goods or services; or business interruptions) may be, but if the possibility of such damage is advised, then arising out of the use of this software Due to contractual obligations, strict liability, or loss (including ingest or other), or any kind of responsibilities. * / ** ** console * * & lt; Code & gt; Show a status bar in * ($ x = 1; $ x


Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -