Skip to content

Commit

Permalink
implemented twin-elements/crud-logger
Browse files Browse the repository at this point in the history
  • Loading branch information
twin-elements committed Jun 10, 2022
1 parent 1df8331 commit eed6fcd
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 55 deletions.
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
"twin-elements/message": "^1.3",
"symfonycasts/reset-password-bundle": "^1.13",
"twin-elements/response-parameter-builder": "^1.0",
"twin-elements/admin-translator": "^1.0"
"twin-elements/admin-translator": "^1.0",
"twin-elements/crud-logger": "^1.0"
},
"autoload": {
"psr-4": {
Expand Down
1 change: 0 additions & 1 deletion src/Controller/AdminUserController.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Security\Core\Encoder\UserPasswordEncoderInterface;
use TwinElements\AdminBundle\Model\CrudControllerTrait;
use TwinElements\AdminBundle\Repository\AdminUserRepository;
use TwinElements\AdminBundle\Role\AdminUserRole;
Expand Down
34 changes: 0 additions & 34 deletions src/Helper/CrudLoggerMessage.php

This file was deleted.

9 changes: 3 additions & 6 deletions src/Model/CrudControllerTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
namespace TwinElements\AdminBundle\Model;

use TwinElements\AdminBundle\Helper\Breadcrumbs;
use TwinElements\AdminBundle\Helper\CrudLoggerMessage;
use TwinElements\Component\AdminTranslator\AdminTranslator;
use TwinElements\Component\CrudLogger\CrudLoggerInterface;
use TwinElements\Component\Flashes\Flashes;

trait CrudControllerTrait
Expand All @@ -13,17 +13,14 @@ trait CrudControllerTrait

protected Flashes $flashes;

protected CrudLoggerMessage $crudLogger;
protected CrudLoggerInterface $crudLogger;

protected AdminTranslator $adminTranslator;

/**
* @param $breadcrumbs
*/
public function __construct(
Breadcrumbs $breadcrumbs,
Flashes $flashes,
CrudLoggerMessage $crudLogger,
CrudLoggerInterface $crudLogger,
AdminTranslator $translator
)
{
Expand Down
9 changes: 9 additions & 0 deletions src/config/config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
symfonycasts_reset_password:
request_password_repository: TwinElements\AdminBundle\Repository\ResetPasswordRequestRepository

monolog:
channels: ['crud']
handlers:
crud:
type: stream
level: info
path: '%kernel.logs_dir%/crud.log'
channels: ['crud']

twin_elements_admin:
admin_locale: '%admin_locale%'
42 changes: 29 additions & 13 deletions src/config/services.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,31 @@
<tag name="form.type"/>
</prototype>

<service id="TwinElements\AdminBundle\Helper\Breadcrumbs" autowire="true">
<bind key="$adminLocale">%admin_locale%</bind>
</service>

<service id="TwinElements\Component\Flashes\Flashes"/>

<service id="TwinElements\Component\CrudLogger\CrudLogger">
<argument id="security.token_storage"/>
<argument id="logger"/>
<tag name="monolog.logger" channel="crud"/>
</service>

<service id="TwinElements\Component\CrudLogger\CrudLoggerInterface" alias="TwinElements\Component\CrudLogger\CrudLogger"/>

<service id="TwinElements\Component\AdminTranslator\AdminTranslator">
<bind key="$adminLocale">%admin_locale%</bind>
</service>

<service id="TwinElements\AdminBundle\Model\CrudControllerTrait">
<argument id="TwinElements\AdminBundle\Helper\Breadcrumbs"/>
<argument id="TwinElements\Component\Flashes\Flashes"/>
<argument id="TwinElements\Component\CrudLogger\CrudLogger"/>
<argument id="TwinElements\Component\AdminTranslator\AdminTranslator"/>
</service>

<service id="TwinElements\AdminBundle\Role\AdminUserRole">
<tag name="twin_elements.role" priority="99"/>
</service>
Expand All @@ -31,26 +56,17 @@
</service>

<service id="TwinElements\AdminBundle\Menu\AdminMenuCollector">
<argument type="tagged" tag="twin_elements.admin_menu" />
<argument type="tagged" tag="twin_elements.admin_menu"/>
</service>

<service id="TwinElements\AdminBundle\Menu\Builder" autowire="true">
<tag name="knp_menu.menu_builder" method="mainMenu" alias="cms_main" />
<tag name="knp_menu.menu_builder" method="mainMenu" alias="cms_main"/>
<bind key="$adminLocale">%admin_locale%</bind>
</service>

<service id="TwinElements\AdminBundle\Helper\Breadcrumbs" autowire="true">
<bind key="$adminLocale">%admin_locale%</bind>
</service>
<service id="TwinElements\Component\Message\MessageBuilderFactory"/>

<service id="TwinElements\Component\Message\MessageBuilderFactory" />
<service id="TwinElements\Component\ResponseParameterBuilder\ResponseParameterBuilder"/>

<service id="TwinElements\Component\Flashes\Flashes" />

<service id="TwinElements\Component\ResponseParameterBuilder\ResponseParameterBuilder" />

<service id="TwinElements\Component\AdminTranslator\AdminTranslator">
<bind key="$adminLocale">%admin_locale%</bind>
</service>
</services>
</container>

0 comments on commit eed6fcd

Please sign in to comment.