From ba95bc5b2b481a4623683406ab2f77870b1397ff Mon Sep 17 00:00:00 2001 From: Latif Khalifa Date: Mon, 4 Feb 2013 03:14:42 +0100 Subject: [PATCH] Use a define instead of magic numbers for number of builds to maintain. Set number of builds to keep to 50 --- index.php | 2 +- lib/cleanup.php | 2 +- lib/init.php | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/index.php b/index.php index 999158b..835b8d2 100644 --- a/index.php +++ b/index.php @@ -155,7 +155,7 @@ if (isset($_GET["chan"]) && isset($CHANS[$_GET["chan"]])) { $chan = "SingularityAlpha"; } -$pageSize = 20; +$pageSize = KEEP_BUILDS; $builds = array(); diff --git a/lib/cleanup.php b/lib/cleanup.php index f4641fa..182c4fb 100755 --- a/lib/cleanup.php +++ b/lib/cleanup.php @@ -37,7 +37,7 @@ function get_old_builds($chan, $nrToKeep) } chdir(SITE_ROOT); -$builds = get_old_builds("SingularityAlpha", 21); +$builds = get_old_builds("SingularityAlpha", KEEP_BUILDS + 1); $nrBuilds = count($builds); for ($i=0; $i<$nrBuilds; $i++) { diff --git a/lib/init.php b/lib/init.php index 10105f9..136cd70 100644 --- a/lib/init.php +++ b/lib/init.php @@ -57,6 +57,7 @@ if (!defined('IMG_ROOT')) { // $CHANS = array("SingularityAlpha" => "HEAD", "SingularityMultiWearable" => "refs/remotes/shyotl/V2MultiWear"); $CHANS = array("SingularityAlpha" => "HEAD"); +define("KEEP_BUILDS", 50); $DB = new DBH();