Skip to content

Commit

Permalink
Enable event dispatcher (#6)
Browse files Browse the repository at this point in the history
* enable symfony event dispatcher component

* finetune

Co-authored-by: Konstantin Vanderer <konstantin.vanderer@dalee.ru>
  • Loading branch information
erroric and kvanderer authored Nov 25, 2020
1 parent ec1dd9b commit 95c0695
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
/auth.json
composer.lock
*.iml
.idea
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Change log

## [2.4.5] 2020-11-19
- Включен symfony EventDispatcher Component

## [2.4.4] 2020-11-19
- Исправлен баг с фильтрацией unicode имен файлов

Expand Down
4 changes: 4 additions & 0 deletions etc/services/event_dispatcher.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
services:
event_dispatcher:
class: Symfony\Component\EventDispatcher\EventDispatcher
public: true
2 changes: 1 addition & 1 deletion lib/common.version.inc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<?php

define('PP_VERSION', 'v2.4.4');
define('PP_VERSION', 'v2.4.5');
3 changes: 3 additions & 0 deletions src/DependencyInjection/CoreExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ public function load(array $configs, ContainerBuilder $container) {
$container->setParameter('core.cache_dir', CACHE_PATH);
$container->setParameter('core.runtime_dir', RUNTIME_PATH);

// register event dispatcher configuration
$loader->load('event_dispatcher.yml');

$this->registerLoggerConfiguration($config['application'], $container, $loader);
}

Expand Down
5 changes: 4 additions & 1 deletion src/Lib/Engine/AbstractEngine.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
use PP\Lib\Html\Layout\LayoutInterface;
use PP\ApplicationFactory;
use Symfony\Component\Config\ConfigCache;
use Symfony\Component\EventDispatcher\DependencyInjection\RegisterListenersPass;

abstract class AbstractEngine implements EngineInterface
{
Expand Down Expand Up @@ -109,7 +110,9 @@ protected function initContainer($klass)
/** @var ContainerBuilder $container */
$container = new $klass();
$container->registerExtension(new CoreExtension());
$container->addCompilerPass(new AddLoggingHandlersPass());
$container
->addCompilerPass(new AddLoggingHandlersPass())
->addCompilerPass(new RegisterListenersPass());

$loader = new YamlFileLoader($container, new FileLocator($path));

Expand Down

0 comments on commit 95c0695

Please sign in to comment.