1
0
mirror of https://github.com/e107inc/e107.git synced 2025-01-18 05:09:05 +01:00

Cache library.

This commit is contained in:
Lóna Lore 2016-02-13 22:52:58 +01:00
parent aee9a06a90
commit f9f16511b4

View File

@ -345,8 +345,21 @@ class e_library_manager
if(!isset($loaded[$name]))
{
// TODO: cache result from libraryDetect() !!!!!!
$library = $this->libraryDetect($name);
$cache = e107::getCache();
$cacheID = 'library_manager_' . md5($name);
$cached = $cache->retrieve($cacheID, false, true, true);
if($cached)
{
$library = unserialize($cached);
}
if(!varset($library, false))
{
$library = $this->libraryDetect($name);
$cacheData = serialize($library);
$cache->set($cacheID, $cacheData, true, false, true);
}
// Exit early if the library was not found.
if($library === false)