diff --git a/install-dev/classes/xmlLoader.php b/install-dev/classes/xmlLoader.php index d120c2f6b..00cb3875b 100644 --- a/install-dev/classes/xmlLoader.php +++ b/install-dev/classes/xmlLoader.php @@ -307,6 +307,7 @@ class InstallXmlLoader } $this->flushDelayedInserts(); + unset($this->cache_xml_entity[$this->path_type][$entity]); } /** @@ -350,11 +351,7 @@ class InstallXmlLoader */ protected function loadEntity($entity, $iso = null) { - $cache_id = $entity; - if ($iso) - $cache_id .= ':'.$iso; - - if (!isset($this->cache_xml_entity[$this->path_type][$cache_id])) + if (!isset($this->cache_xml_entity[$this->path_type][$entity][$iso])) { $path = $this->data_path.$entity.'.xml'; if ($iso) @@ -363,11 +360,11 @@ class InstallXmlLoader if (!file_exists($path)) throw new PrestashopInstallerException('XML data file '.$entity.'.xml not found'); - if (!$this->cache_xml_entity[$this->path_type][$cache_id] = @simplexml_load_file($path, 'InstallSimplexmlElement')) + if (!$this->cache_xml_entity[$this->path_type][$entity][$iso] = @simplexml_load_file($path, 'InstallSimplexmlElement')) throw new PrestashopInstallerException('XML data file '.$entity.'.xml invalid'); } - return $this->cache_xml_entity[$this->path_type][$cache_id]; + return $this->cache_xml_entity[$this->path_type][$entity][$iso]; } /** @@ -426,6 +423,7 @@ class InstallXmlLoader $object->hydrate($data_lang); $object->add(true, (isset($xml->fields['null'])) ? true : false); $entity_id = $object->id; + unset($object); } else { @@ -436,6 +434,7 @@ class InstallXmlLoader $primary = 'id_'.$entity; else if (strpos((string)$xml->fields['primary'], ',') === false) $primary = (string)$xml->fields['primary']; + unset($xml); if ($primary) { diff --git a/install-dev/models/install.php b/install-dev/models/install.php index 6497fcb3b..a3757e908 100644 --- a/install-dev/models/install.php +++ b/install-dev/models/install.php @@ -176,6 +176,7 @@ class InstallModelInstall extends InstallAbstractModel // IDS from xmlLoader are stored in order to use them for fixtures $this->xml_loader_ids = $xml_loader->getIds(); + unset($xml_loader); // Install custom SQL data (db_data.sql file) if (file_exists(_PS_INSTALL_DATA_PATH_.'db_data.sql'))