This commit is contained in:
2018-09-05 00:26:26 -07:00
parent bae448657b
commit ca7a7a8a58
4 changed files with 147 additions and 42 deletions

View File

@@ -9,7 +9,7 @@ class ProgressBar {
protected static $total = 0;
public static function display($message = null) {
$string = "PROGRESS:".round((self::$done/self::$total)*100,2);
$string = "PROGRESS:".floor((self::$done/self::$total)*100);
if ($message) {
return "\n".$string."\n".$message;
} elseif (!strpos(__FILE__,".app")) {
@@ -50,6 +50,10 @@ function getParents($zpath, $pathname) {
}
*/
function stringPrint($string) {
echo $string.@str_repeat(" ", (10-strlen($string)));
}
function shortlabel($pathname, $max = 99, $pad = false) {
$basename = basename($pathname);
$suffix = "(...).".pathinfo($basename,PATHINFO_EXTENSION);
@@ -58,6 +62,9 @@ function shortlabel($pathname, $max = 99, $pad = false) {
} else {
$return = $basename;
}
if ($pad) {
$return = $return.@str_repeat(" ", ($max-strlen($return)));
}
return $return;
}