1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-10 16:46:50 +02:00

Code speed optimization

This commit is contained in:
Cameron
2020-12-12 11:32:23 -08:00
parent d090b19c73
commit cf14705535
17 changed files with 48 additions and 45 deletions

View File

@@ -939,6 +939,7 @@ class e_library_manager
*/
public function detect($name)
{
// Re-use the statically cached value of info() to save memory.
$library = &$this->info($name);
@@ -1202,6 +1203,7 @@ class e_library_manager
public function load($name, $variant = null)
{
// Re-use the statically cached value to save memory.
static $loaded;
if(!isset($loaded[$name]))
@@ -1216,7 +1218,7 @@ class e_library_manager
$library = e107::unserialize($cached);
}
if(!varset($library, false))
if(empty($library))
{
$library = $this->detect($name);
$cacheData = e107::serialize($library, 'json');