diff --git a/module/VuFind/src/VuFind/Statistics/AbstractBase.php b/module/VuFind/src/VuFind/Statistics/AbstractBase.php index db3f5b68a93c3f234190df0cad74162af7ee6d51..d157f456a05b1df177cfdbfa843bd65e186840f6 100644 --- a/module/VuFind/src/VuFind/Statistics/AbstractBase.php +++ b/module/VuFind/src/VuFind/Statistics/AbstractBase.php @@ -140,7 +140,7 @@ abstract class AbstractBase implements ServiceLocatorAwareInterface // If we got this far, we want the current option! Build the driver: $loader = $this->getServiceLocator() ->get('StatisticsDriverPluginManager'); - $newDriver = clone($loader->get($setting[0])); + $newDriver = $loader->get($setting[0]); // Set the name of the data source; we use the special value // "global" to represent global writer requests (the special null diff --git a/module/VuFind/src/VuFind/Statistics/Driver/PluginManager.php b/module/VuFind/src/VuFind/Statistics/Driver/PluginManager.php index 123a583046faf92f74cf35128df1a7b54942ff42..853b3ddec041e0fd0b0cbf1d13271a6a58dea374 100644 --- a/module/VuFind/src/VuFind/Statistics/Driver/PluginManager.php +++ b/module/VuFind/src/VuFind/Statistics/Driver/PluginManager.php @@ -38,6 +38,21 @@ namespace VuFind\Statistics\Driver; */ class PluginManager extends \VuFind\ServiceManager\AbstractPluginManager { + /** + * Constructor + * + * @param null|ConfigInterface $configuration Configuration settings (optional) + */ + public function __construct( + \Zend\ServiceManager\ConfigInterface $configuration = null + ) { + parent::__construct($configuration); + + // Stats drivers are not meant to be shared -- every time we retrieve one, + // we are building a brand new object. + $this->setShareByDefault(false); + } + /** * Return the name of the base class or interface that plug-ins must conform * to.