Commit c6747411 authored by Fabien Potencier's avatar Fabien Potencier

added an extension system

parent 8a7b4321
...@@ -68,6 +68,15 @@ class Application extends \Pimple implements HttpKernelInterface, EventSubscribe ...@@ -68,6 +68,15 @@ class Application extends \Pimple implements HttpKernelInterface, EventSubscribe
}); });
} }
public function register(ExtensionInterface $extension, array $values)
{
foreach ($values as $key => $value) {
$this[$key] = $value;
}
$extension->register($this);
}
/** /**
* Maps a pattern to a callable. * Maps a pattern to a callable.
* *
......
<?php
/*
* This file is part of the Silex framework.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Silex;
interface ExtensionInterface
{
function register(Application $app);
}
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