Skip to content

Commit

Permalink
extensions: updated for recent nette/di
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Feb 6, 2015
1 parent 48efc61 commit 3f30cee
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
9 changes: 4 additions & 5 deletions src/Bridges/ApplicationDI/ApplicationExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,14 @@ public function beforeCompile()
$container = $this->getContainerBuilder();
$all = array();

foreach ($container->findByType('Nette\Application\IPresenter', FALSE) as $name) {
$def = $container->getDefinition($name);
$all[strtolower($def->getClass())] = $def;
foreach ($container->findByType('Nette\Application\IPresenter') as $def) {
$all[$def->getClass()] = $def;
}

$counter = 0;
foreach ($this->findPresenters() as $class) {
if (empty($all[$tmp = strtolower($class)])) {
$all[$tmp] = $container->addDefinition($this->prefix(++$counter))->setClass($class);
if (empty($all[$class])) {
$all[$class] = $container->addDefinition($this->prefix(++$counter))->setClass($class);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/Bridges/ApplicationDI/RoutingExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public function beforeCompile()
public function afterCompile(Nette\PhpGenerator\ClassType $class)
{
if (!empty($this->config['cache'])) {
$method = $class->methods[Nette\DI\Container::getMethodName($this->prefix('router'))];
$method = $class->getMethod(Nette\DI\Container::getMethodName($this->prefix('router')));
try {
$router = serialize(eval($method->getBody()));
} catch (\Exception $e) {
Expand Down
2 changes: 1 addition & 1 deletion tests/Application/MicroPresenter.response.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class MicroContainer extends Nette\DI\Container

protected $meta = array(
'types' => array(
'nette\\bridges\\applicationlatte\\ilattefactory' => array(1 => array('latte.latteFactory')),
'Nette\\Bridges\\ApplicationLatte\\ILatteFactory' => array(1 => array('latte.latteFactory')),
),
);

Expand Down

0 comments on commit 3f30cee

Please sign in to comment.