Commit 35502940 authored by Tino Goratsch's avatar Tino Goratsch

minor fixes and improvements

parent 47f5273d
......@@ -14,7 +14,7 @@ interface BootstrapInterface extends HttpKernelInterface
/**
* Contains the current ACP3 version string
*/
const VERSION = '4.0.0-rc.13';
const VERSION = '4.0.0-rc.13.1';
/**
* Performs some startup checks
......
......@@ -34,6 +34,10 @@ class ModuleInstaller
* @var Install
*/
protected $installHelper;
/**
* @var array
*/
protected $results = [];
/**
* ModuleInstaller constructor.
......@@ -57,15 +61,22 @@ class ModuleInstaller
/**
* @param ContainerInterface $container
* @param array $modules
* @return array
* @throws \Exception
*/
public function installModules(ContainerInterface $container, array $modules = [])
{
foreach ($this->vendor->getVendors() as $vendor) {
$vendorPath = $this->applicationPath->getModulesDir() . $vendor . '/';
$modules = count($modules) > 0 ? $modules : Filesystem::scandir($vendorPath);
$vendorModules = count($modules) > 0 ? $modules : Filesystem::scandir($vendorPath);
foreach ($vendorModules as $module) {
$module = strtolower($module);
if (isset($this->results[$module])) {
continue;
}
foreach ($modules as $module) {
$modulePath = $vendorPath . ucfirst($module) . '/';
$moduleConfigPath = $modulePath . 'Resources/config/module.xml';
......@@ -79,9 +90,13 @@ class ModuleInstaller
if ($this->installHelper->installModule($module, $container) === false) {
throw new \Exception("Error while installing module {$module}.");
}
$this->results[$module] = true;
}
}
}
return $this->results;
}
/**
......
......@@ -76,9 +76,15 @@ class SchemaUpdateModel
{
foreach ($this->vendor->getVendors() as $vendor) {
$vendorPath = $this->applicationPath->getModulesDir() . $vendor . '/';
$modules = count($modules) > 0 ? $modules : Filesystem::scandir($vendorPath);
$vendorModules = count($modules) > 0 ? $modules : Filesystem::scandir($vendorPath);
foreach ($vendorModules as $module) {
$module = strtolower($module);
if (isset($this->results[$module])) {
continue;
}
foreach ($modules as $module) {
$modulePath = $vendorPath . ucfirst($module) . '/';
$moduleConfigPath = $modulePath . 'Resources/config/module.xml';
......@@ -89,7 +95,7 @@ class SchemaUpdateModel
$this->updateModules($container, $dependencies);
}
$this->results[strtolower($module)] = $this->updateModule($container, $module);
$this->results[$module] = $this->updateModule($container, $module);
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment