Skip to content

Commit

Permalink
Pass request object to injectors
Browse files Browse the repository at this point in the history
  • Loading branch information
bergie committed Oct 8, 2010
1 parent 4276632 commit fc49901
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions providers/component/midgardmvc.php
Expand Up @@ -48,10 +48,6 @@ public function get($component)
if (!isset($this->manifests[$component]))
{
$manifest_path = $this->get_manifest_path($component);
if (!file_exists($manifest_path))
{
throw new OutOfRangeException("Component {$component} is not installed");
}
$this->manifests[$component] = $this->load_manifest_file($manifest_path);
}
$this->components[$component] = new midgardmvc_core_providers_component_component_midgardmvc($component, $this->manifests[$component]);
Expand Down Expand Up @@ -99,7 +95,7 @@ public function inject(midgardmvc_core_request $request, $injector_type)
foreach ($this->injectors[$injector_type] as $key => $injector_class)
{
$injector = new $injector_class();
$injector->$inject_method();
$injector->$inject_method($request);
}
}

Expand All @@ -115,6 +111,10 @@ private function get_manifest_path($component)
*/
private function load_manifest_file($manifest_file)
{
if (!file_exists($manifest_file))
{
throw new OutOfRangeException("Component manifest {$manifest_file} is not installed");
}
$manifest_yaml = file_get_contents($manifest_file);
$manifest = midgardmvc_core::read_yaml($manifest_yaml);

Expand Down

0 comments on commit fc49901

Please sign in to comment.