From 1a7538265f7a2748e8864c002e75e55cb8a270ba Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Fri, 27 Jul 2018 08:27:37 +0200 Subject: lib/converter.php -> lib/helper.php --- buildmaster/status.php | 2 +- lib/converter.php | 86 -------------------------------------------------- lib/helper.php | 86 ++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 87 insertions(+), 87 deletions(-) delete mode 100644 lib/converter.php create mode 100644 lib/helper.php diff --git a/buildmaster/status.php b/buildmaster/status.php index 45ae6c3..3776d81 100644 --- a/buildmaster/status.php +++ b/buildmaster/status.php @@ -2,7 +2,7 @@ require_once "../init.php"; include BASE . "/lib/mysql.php"; include BASE . "/lib/style.php"; -include BASE . "/lib/converter.php"; +include BASE . "/lib/helper.php"; $result = mysql_run_query( "SELECT MAX(`package_sources`.`commit_time`) AS `last_commit`" . diff --git a/lib/converter.php b/lib/converter.php deleted file mode 100644 index 41951c7..0000000 --- a/lib/converter.php +++ /dev/null @@ -1,86 +0,0 @@ - 1) - $result = - sprintf( - "%d days and %s", - $tmp, - $result - ); - elseif ($tmp == 1) - $result = - sprintf( - "%d day and %s", - $tmp, - $result - ); - else - $printed_conjunction = false; - $val = floor($val / 7); - if ($val == 0) - return $result; - if ($printed_conjunction) - $result = - sprintf( - ", %s", - $result - ); - else - $result = - sprintf( - " and %s", - $result - ); - if ($val>1) - $result = - sprintf( - "%d weeks%s", - $val, - $result - ); - else - $result = - sprintf( - "%d week%s", - $val, - $result - ); - return $result; -} diff --git a/lib/helper.php b/lib/helper.php new file mode 100644 index 0000000..41951c7 --- /dev/null +++ b/lib/helper.php @@ -0,0 +1,86 @@ + 1) + $result = + sprintf( + "%d days and %s", + $tmp, + $result + ); + elseif ($tmp == 1) + $result = + sprintf( + "%d day and %s", + $tmp, + $result + ); + else + $printed_conjunction = false; + $val = floor($val / 7); + if ($val == 0) + return $result; + if ($printed_conjunction) + $result = + sprintf( + ", %s", + $result + ); + else + $result = + sprintf( + " and %s", + $result + ); + if ($val>1) + $result = + sprintf( + "%d weeks%s", + $val, + $result + ); + else + $result = + sprintf( + "%d week%s", + $val, + $result + ); + return $result; +} -- cgit v1.2.3-70-g09d2