From 4537b9b7c9eb63bf3b2d5066d6c50e68f7de4956 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Thu, 11 Jan 2018 11:19:14 +0100 Subject: [statistics] Add "replace machines" feature (not linked to anywhere yet) --- modules-available/statistics/page.inc.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'modules-available/statistics/page.inc.php') diff --git a/modules-available/statistics/page.inc.php b/modules-available/statistics/page.inc.php index 09359342..877a90f2 100644 --- a/modules-available/statistics/page.inc.php +++ b/modules-available/statistics/page.inc.php @@ -1062,7 +1062,11 @@ class Page_Statistics extends Page public static function getPciId($cat, $id) { - return Database::queryFirst('SELECT value, dateline FROM pciid WHERE category = :cat AND id = :id LIMIT 1', + static $cache = []; + $key = $cat . '-' . $id; + if (isset($cache[$key])) + return $cache[$key]; + return $cache[$key] = Database::queryFirst('SELECT value, dateline FROM pciid WHERE category = :cat AND id = :id LIMIT 1', array('cat' => $cat, 'id' => $id)); } -- cgit v1.2.3-55-g7522