diff options
author | Simon Rettberg | 2018-01-11 11:19:14 +0100 |
---|---|---|
committer | Simon Rettberg | 2018-01-11 11:19:14 +0100 |
commit | 4537b9b7c9eb63bf3b2d5066d6c50e68f7de4956 (patch) | |
tree | 454c72e456ca01d5ab4a39114851737c9d7fc57c /modules-available/statistics/page.inc.php | |
parent | [translations] Focus first untranslated tag (diff) | |
download | slx-admin-4537b9b7c9eb63bf3b2d5066d6c50e68f7de4956.tar.gz slx-admin-4537b9b7c9eb63bf3b2d5066d6c50e68f7de4956.tar.xz slx-admin-4537b9b7c9eb63bf3b2d5066d6c50e68f7de4956.zip |
[statistics] Add "replace machines" feature (not linked to anywhere yet)
Diffstat (limited to 'modules-available/statistics/page.inc.php')
-rw-r--r-- | modules-available/statistics/page.inc.php | 6 |
1 files changed, 5 insertions, 1 deletions
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)); } |