From: Edward Date: Tue, 13 May 2014 11:26:21 +0000 (+0800) Subject: Import/Core_geoip.php X-Git-Url: http://git.roojs.org/?p=Pman.Core;a=commitdiff_plain;h=37050b8c030d70fde77e34eaa31154818057ba4d Import/Core_geoip.php --- diff --git a/Import/Core_geoip.php b/Import/Core_geoip.php index 9dac3088..567e0002 100644 --- a/Import/Core_geoip.php +++ b/Import/Core_geoip.php @@ -314,6 +314,21 @@ class Pman_Core_Import_Core_geoip extends Pman_Roo function processStatus() { - echo "$str \n"; + echo "\033[K"; // Erase to end of line: + + if (strlen($this->echo)) { + echo "\033[".strlen($this->echo)."D"; // Move $length characters backward + } + + $this->echo = str_pad(ROUND(($this->processed / $this->total),2) * 100, 3, ' ', STR_PAD_LEFT) . + " % (" . str_pad(($this->processed), strlen($this->total), ' ', STR_PAD_LEFT) . + " / {$this->total})"; + + + echo $this->echo; + + if($this->processed == $this->total){ + echo "\n"; + } } }