From 599647f71db1eaa37ea7f458e658469912208845 Mon Sep 17 00:00:00 2001 From: lonalore Date: Thu, 20 Oct 2016 09:12:11 +0200 Subject: [PATCH] Fix for Library Manager's variant handler. --- e107_handlers/library_manager.php | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/e107_handlers/library_manager.php b/e107_handlers/library_manager.php index 69053aeab..a07ea1864 100644 --- a/e107_handlers/library_manager.php +++ b/e107_handlers/library_manager.php @@ -204,7 +204,7 @@ class e_library_manager foreach($library['variants'] as $variant_name => &$variant) { // If no variant callback has been set, assume the variant to be installed. - if(!isset($variant['variant callback'])) + if(!isset($variant['variant_callback'])) { $variant['installed'] = true; } @@ -231,12 +231,12 @@ class e_library_manager // We support both a single parameter, which is an associative array, and an indexed array of // multiple parameters. - if(isset($variant['variant arguments'][0])) + if(isset($variant['variant_arguments'][0])) { if($class) { - $params = array_merge(array($library, $variant_name), $variant['variant arguments']); - $variant['installed'] = e107::callMethod($class, $library['variant callback'], $params); + $params = array_merge(array($library, $variant_name), $variant['variant_arguments']); + $variant['installed'] = e107::callMethod($class, $library['variant_callback'], $params); } } else @@ -244,11 +244,11 @@ class e_library_manager if($class) { // Can't use e107::callMethod(), because it only supports 2 params. - if(method_exists($class, $variant['variant callback'])) + if(method_exists($class, $variant['variant_callback'])) { // Call PLUGIN/THEME_library::VARIANT_CALLBACK(). - $method = $variant['variant callback']; - $variant['installed'] = $class->$method($library, $variant_name, $variant['variant arguments']); + $method = $variant['variant_callback']; + $variant['installed'] = $class->$method($library, $variant_name, $variant['variant_arguments']); } } } @@ -283,7 +283,7 @@ class e_library_manager * request. The variant that has been passed first is used; different variant names in subsequent calls are * ignored. * - * @return + * @return mixed * An associative array of the library information as returned from config(). The top-level properties * contain the effective definition of the library (variant) that has been loaded. Additionally: * - installed: Whether the library is installed, as determined by detect(). @@ -974,7 +974,7 @@ class e_library_manager * minified or compressed files, this prevents reading the entire file into memory. * * @return mixed - * A string containing the version of the library. + * A string containing the version of the library. Or null. */ private function getVersion($library, $options) { @@ -1037,6 +1037,8 @@ class e_library_manager { unlink($tmpFile); } + + return; } /** @@ -1111,7 +1113,7 @@ class e_library_manager * @param $current_version * The version to check against (like 4.2). * - * @return + * @return mixed * NULL if compatible, otherwise the original dependency version string that caused the incompatibility. * * @see parseDependency()