Skip to content
This repository has been archived by the owner on Feb 4, 2022. It is now read-only.

Patch bootstrapper #83

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
84 changes: 44 additions & 40 deletions code/object/bootstrapper/bootstrapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ public function bootstrap()
{
$factory = $this->getObject('object.config.factory');

$extended_components = array();
foreach($this->_manifests as $manifest)
{
if (isset($manifest['identifier']))
Expand All @@ -165,63 +166,66 @@ public function bootstrap()
$this->_namespaces[$identifier] = array($namespace => $manifest['paths']);
}
}

if (isset($manifest['extends'])) {
$extended_components[] = $manifest;
}
}

foreach($this->_manifests as $manifest)
foreach($extended_components as $manifest)
{
if (isset($manifest['extends']))
$extends = $manifest['extends'];

if (!isset($this->_components[$extends])) {
throw new \RuntimeException(sprintf('Component: %s not found', $extends));
}

if(isset($manifest['identifier']))
{
$extends = $manifest['extends'];
$identifier = $manifest['identifier'];

if (!isset($this->_components[$extends])) {
throw new \RuntimeException(sprintf('Component: %s not found', $extends));
}
//Append paths
$this->_components[$identifier] = array_merge(
$this->_components[$identifier],
$this->_components[$extends]
);

if(isset($manifest['identifier']))
//Set the namespace
if (isset($manifest['namespace']))
{
$identifier = $manifest['identifier'];
$namespace = $manifest['namespace'];
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This $namespace variable isn't used, is that intentional?


//Append paths
$this->_components[$identifier] = array_merge(
$this->_components[$identifier],
//Append the namespace
$this->_namespaces[$identifier] = array_merge(
$this->_namespaces[$identifier],
$this->_components[$extends]
);

//Set the namespace
if (isset($manifest['namespace']))
{
$namespace = $manifest['namespace'];

//Append the namespace
$this->_namespaces[$identifier] = array_merge(
$this->_namespaces[$identifier],
$this->_components[$extends]
);
}
}
else
}
else
{
//Prepend paths
$this->_components[$extends] = array_merge(
$manifest['paths'],
$this->_components[$extends]
);

//Set the namespace
if (isset($manifest['namespace']))
{
//Prepend paths
$this->_components[$extends] = array_merge(
$manifest['paths'],
$this->_components[$extends]
);
$namespace = $manifest['namespace'];

//Set the namespace
if (isset($manifest['namespace']))
{
$namespace = $manifest['namespace'];

//Prepend the namespace
$this->_namespaces[$extends] = array_merge(
array($namespace => $manifest['paths']),
$this->_namespaces[$extends]
);
}
//Prepend the namespace
$this->_namespaces[$extends] = array_merge(
array($namespace => $manifest['paths']),
$this->_namespaces[$extends]
);
}
}
}

$identifiers = array();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These variables were undefined

$aliases = array();
foreach($this->_files as $path)
{
$array = $factory->fromFile($path, false);
Expand Down