Skip to content

Commit

Permalink
update loadig modules
Browse files Browse the repository at this point in the history
  • Loading branch information
nik-os committed Mar 21, 2016
1 parent 10f334d commit e9449e4
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions src/Core.php
Original file line number Diff line number Diff line change
Expand Up @@ -429,29 +429,25 @@ public function composer($dependencyFilePath = null)
)
);

$modulesToLoad = array();

// Iterate requirements
foreach ($composerModules as $requirement => $parameters) {
$modulesToLoad[__SAMSON_CWD__ . __SAMSON_VENDOR_PATH . $requirement] = array_merge(
is_array($parameters) ? $parameters : array($parameters),
array('module_id' => $requirement)
$this->load(__SAMSON_CWD__ . __SAMSON_VENDOR_PATH . $requirement,
array_merge(
is_array($parameters) ? $parameters : array($parameters),
array('module_id' => $requirement)
)
);
}

$localModulesPath = '../src';

ResourceMap::get('cache');
$resourceMap = ResourceMap::get($localModulesPath);

foreach ($resourceMap->modules as $moduleFile) {
$modulePath = str_replace(realpath($localModulesPath), '', $moduleFile[1]);
$modulePath = explode('/', $modulePath);
$modulePath = $localModulesPath.'/'.$modulePath[1];
$modulesToLoad[$modulePath] = array();
}

foreach($modulesToLoad as $path => $parameters) {
$this->load($path, $parameters);
$this->load($modulePath, $parameters);
}

// Create local module and set it as active
Expand Down

0 comments on commit e9449e4

Please sign in to comment.