mirror of
https://github.com/e107inc/e107.git
synced 2025-08-02 12:48:26 +02:00
Cache library.
This commit is contained in:
@@ -345,8 +345,21 @@ class e_library_manager
|
|||||||
|
|
||||||
if(!isset($loaded[$name]))
|
if(!isset($loaded[$name]))
|
||||||
{
|
{
|
||||||
// TODO: cache result from libraryDetect() !!!!!!
|
$cache = e107::getCache();
|
||||||
$library = $this->libraryDetect($name);
|
$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.
|
// Exit early if the library was not found.
|
||||||
if($library === false)
|
if($library === false)
|
||||||
|
Reference in New Issue
Block a user