Quantcast
Channel: phpBB.com
Viewing all articles
Browse latest Browse all 2528

Extension Writers Discussion • Re: Utilizing the cache for extension-specific data

$
0
0
Example from the Trackers extension:

Code:

$trackers = $this->cache->get('_trackers');if (!$trackers){$sql = 'SELECT *FROM ' . $this->table_prefix . 'trackers_trackers';$result = $this->db->sql_query($sql);$trackers = [];while ($row = $this->db->sql_fetchrow($result)){$trackers[$row['tracker_id']] = $row;}$this->db->sql_freeresult($result);$this->cache->put('_trackers', $trackers);}

Statistics: Posted by Kailey — Thu Jan 09, 2025 2:00 am



Viewing all articles
Browse latest Browse all 2528

Trending Articles