// Installer can work with 18MO (under 32MO sub ajax queries are triggered)

This commit is contained in:
rMalie
2012-02-09 15:37:48 +00:00
parent f55c4bace4
commit 7969d242e9
9 changed files with 207 additions and 142 deletions

View File

@@ -144,10 +144,7 @@ class InstallXmlLoader
$this->ids = $ids;
}
/**
* Read all XML files from data folder and populate tables
*/
public function populateFromXmlFiles()
public function getSortedEntities()
{
// Browse all XML files from data/xml directory
$entities = array();
@@ -201,14 +198,19 @@ class InstallXmlLoader
}
while ($current != $sort_entities);
return $sort_entities;
}
/**
* Read all XML files from data folder and populate tables
*/
public function populateFromXmlFiles()
{
$entities = $this->getSortedEntities();
// Populate entities
foreach ($sort_entities as $entity)
{
if (method_exists($this, 'populateEntity'.Tools::toCamelCase($entity)))
$this->{'populateEntity'.Tools::toCamelCase($entity)}();
else
$this->populateEntity($entity);
}
foreach ($entities as $entity)
$this->populateEntity($entity);
}
/**
@@ -218,6 +220,12 @@ class InstallXmlLoader
*/
public function populateEntity($entity)
{
if (method_exists($this, 'populateEntity'.Tools::toCamelCase($entity)))
{
$this->{'populateEntity'.Tools::toCamelCase($entity)}();
return;
}
$xml = $this->loadEntity($entity);
// Read list of fields