diff options
author | JoshyPHP <s9e.dev@gmail.com> | 2015-03-26 04:39:36 +0100 |
---|---|---|
committer | JoshyPHP <s9e.dev@gmail.com> | 2015-04-02 19:16:04 +0200 |
commit | af4f9b860f50a562a03f55efad1da7e0854bdfda (patch) | |
tree | 58770761233846d03a7c94d45b5baf1764be1b72 /phpBB/phpbb/textformatter/s9e/renderer.php | |
parent | c89188132114b4d9ff483c5b1579c53cdeb69703 (diff) | |
download | forums-af4f9b860f50a562a03f55efad1da7e0854bdfda.tar forums-af4f9b860f50a562a03f55efad1da7e0854bdfda.tar.gz forums-af4f9b860f50a562a03f55efad1da7e0854bdfda.tar.bz2 forums-af4f9b860f50a562a03f55efad1da7e0854bdfda.tar.xz forums-af4f9b860f50a562a03f55efad1da7e0854bdfda.zip |
[ticket/11768] Added core.text_formatter_s9e_renderer_setup event
PHPBB3-11768
Diffstat (limited to 'phpBB/phpbb/textformatter/s9e/renderer.php')
-rw-r--r-- | phpBB/phpbb/textformatter/s9e/renderer.php | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/phpBB/phpbb/textformatter/s9e/renderer.php b/phpBB/phpbb/textformatter/s9e/renderer.php index b68c9dd9be..7b8b382074 100644 --- a/phpBB/phpbb/textformatter/s9e/renderer.php +++ b/phpBB/phpbb/textformatter/s9e/renderer.php @@ -24,6 +24,11 @@ class renderer implements \phpbb\textformatter\renderer_interface protected $censor; /** + * @var \phpbb\event\dispatcher_interface + */ + protected $dispatcher; + + /** * @var \s9e\TextFormatter\Renderer */ protected $renderer; @@ -55,8 +60,9 @@ class renderer implements \phpbb\textformatter\renderer_interface * @param string $cache_dir Path to the cache dir * @param string $key Cache key * @param factory $factory + * @param \phpbb\event\dispatcher_interface $dispatcher */ - public function __construct(\phpbb\cache\driver\driver_interface $cache, $cache_dir, $key, factory $factory) + public function __construct(\phpbb\cache\driver\driver_interface $cache, $cache_dir, $key, factory $factory, \phpbb\event\dispatcher_interface $dispatcher) { $renderer_data = $cache->get($key); if ($renderer_data) @@ -81,18 +87,29 @@ class renderer implements \phpbb\textformatter\renderer_interface $censor = $renderer_data['censor']; } } - if (!isset($renderer)) { $objects = $factory->regenerate(); $renderer = $objects['renderer']; } + $self = $this; + + /** + * Configure the renderer service + * + * @event core.text_formatter_s9e_renderer_setup + * @var \s9e\TextFormatter\Renderer renderer s9e\TextFormatter renderer instance + * @var \phpbb\textformatter\s9e\renderer self This renderer service + * @since 3.2.0-a1 + */ + $vars = array('renderer', 'self'); + extract($dispatcher->trigger_event('core.text_formatter_s9e_renderer_setup', compact($vars))); if (isset($censor)) { $this->censor = $censor; } - + $this->dispatcher = $dispatcher; $this->renderer = $renderer; } |