DamienHarper / auditor-bundle

The missing audit log library
MIT License
398 stars 121 forks source link

Symfony 7 compatibility #382

Closed b1rdex closed 10 months ago

b1rdex commented 11 months ago

\DH\AuditorBundle\Routing\RoutingAnnotationLoader is unusable @ Symfony 7

Cannot autowire service "DH\AuditorBundle\Routing\RoutingAnnotationLoader":
argument "$annotatedRouteController" of method "__construct()"
references class "Symfony\Bundle\FrameworkBundle\Routing\AnnotatedRouteControllerLoader"
but no such service exists.

Temporal workaround:

  1. add to services.yaml (to services section):
    DH\AuditorBundle\Controller\ViewerController:
        tags: ['controller.service_arguments']
  2. replace config/routes/dh_auditor.yaml contents with the following:
    
    dh_auditor_list_audits:
    path: /admin/audit
    controller: DH\AuditorBundle\Controller\ViewerController::listAuditsAction

dh_auditor_show_transaction: path: /admin/audit/transaction/{hash} controller: DH\AuditorBundle\Controller\ViewerController::showTransactionAction

dh_auditor_show_entity_history: path: /admin/audit/{entity}/{id?} controller: DH\AuditorBundle\Controller\ViewerController::showEntityHistoryAction


(adjust `/admin` prefix for your needs)
ppoz21 commented 11 months ago

Also works with Symfony 6.4 after removing deprecations, thx @b1rdex

FluffyDiscord commented 10 months ago

Which package version are you using? The 5.2.5 composer refuses to install and on dev-master your workaround does not work for me

b1rdex commented 10 months ago

php v8.2

damienharper/auditor 2.4.8 The missing audit log library. damienharper/auditor-bundle 5.2.5 Integrate auditor library in your Symfony projects.

Full composer info output ❯ composer info behat/transliterator v1.5.0 String transliterator composer/semver 3.4.0 Semver library that offers utilities, version constraint parsing and validation. damienharper/auditor 2.4.8 The missing audit log library. damienharper/auditor-bundle 5.2.5 Integrate auditor library in your Symfony projects. datana-gmbh/sendgrid-dynamic-template-mailer 1.5.0 Symfony Sendgrid Mailer Bridge for Dynamic Templates doctrine/annotations 2.0.1 Docblock Annotations Parser doctrine/cache 2.2.0 PHP Doctrine Cache library is a popular cache implementation that supports many different drivers such as redis, memcache, apc, mongod... doctrine/collections 2.1.4 PHP Doctrine Collections library that adds additional functionality on top of PHP arrays. doctrine/common 3.4.3 PHP Doctrine Common project is a library that provides additional functionality that other Doctrine projects depend on such as better ... doctrine/data-fixtures 1.7.0 Data Fixtures for all Doctrine Object Managers doctrine/dbal 3.7.2 Powerful PHP database abstraction layer (DBAL) with many features for database schema introspection and management. doctrine/deprecations 1.1.2 A small layer on top of trigger_error(E_USER_DEPRECATED) or PSR-3 logging with options to disable all deprecations or selectively for ... doctrine/doctrine-bundle 2.11.1 Symfony DoctrineBundle doctrine/doctrine-fixtures-bundle 3.5.1 Symfony DoctrineFixturesBundle doctrine/doctrine-migrations-bundle 3.3.0 Symfony DoctrineMigrationsBundle doctrine/event-manager 2.0.0 The Doctrine Event Manager is a simple PHP event system that was built to be used with the various Doctrine projects. doctrine/inflector 2.0.8 PHP Doctrine Inflector is a small library that can perform string manipulations with regard to upper/lowercase and singular/plural for... doctrine/instantiator 2.0.0 A small, lightweight utility to instantiate objects in PHP without invoking their constructors doctrine/lexer 2.1.0 PHP Doctrine Lexer parser library that can be used in Top-Down, Recursive Descent Parsers. doctrine/migrations 3.7.2 PHP Doctrine Migrations project offer additional functionality on top of the database abstraction layer (DBAL) for versioning your dat... doctrine/orm 2.17.2 Object-Relational-Mapper for PHP doctrine/persistence 3.2.0 The Doctrine Persistence project is a set of shared interfaces and functionality that the different Doctrine object mappers share. doctrine/sql-formatter 1.1.3 a PHP SQL highlighting library easycorp/easyadmin-bundle v4.8.7 Admin generator for Symfony applications egulias/email-validator 4.0.2 A library for validating emails against several RFCs ezyang/htmlpurifier v4.17.0 Standards compliant HTML filter written in PHP friendsofphp/proxy-manager-lts v1.0.16 Adding support for a wider range of PHP versions to ocramius/proxy-manager gedmo/doctrine-extensions v3.14.0 Doctrine behavioral extensions jsvrcek/ics 0.8.5 abstraction layer for creating multi-byte safe RFC 5545 compliant .ics files laminas/laminas-code 4.13.0 Extensions to the PHP Reflection API, static code scanning, and code generation maennchen/zipstream-php 3.1.0 ZipStream is a library for dynamically streaming dynamic zip files from PHP without writing to the disk at all on the server. markbaker/complex 3.0.2 PHP Class for working with complex numbers markbaker/matrix 3.0.1 PHP Class for working with matrices monolog/monolog 3.5.0 Sends your logs to files, sockets, inboxes, databases and various web services nikic/php-parser v4.18.0 A PHP parser written in PHP phpdocumentor/reflection-common 2.2.0 Common reflection classes used by phpdocumentor to reflect the code structure phpdocumentor/reflection-docblock 5.3.0 With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in... phpdocumentor/type-resolver 1.7.3 A PSR-5 based resolver of Class names, Types and Structural Element Names phpoffice/phpspreadsheet 1.29.0 PHPSpreadsheet - Read, Create and Write Spreadsheet documents in PHP - Spreadsheet engine phpstan/phpdoc-parser 1.24.5 PHPDoc parser with support for nullable, intersection and generic types phpstan/phpstan 1.10.50 PHPStan - PHP Static Analysis Tool phpstan/phpstan-doctrine 1.3.53 Doctrine extensions for PHPStan phpstan/phpstan-symfony 1.3.6 Symfony Framework extensions and rules for PHPStan psr/cache 3.0.0 Common interface for caching libraries psr/clock 1.0.0 Common interface for reading the clock. psr/container 2.0.2 Common Container Interface (PHP FIG PSR-11) psr/event-dispatcher 1.0.0 Standard interfaces for event handling. psr/http-client 1.0.3 Common interface for HTTP clients psr/http-factory 1.0.2 Common interfaces for PSR-7 HTTP message factories psr/http-message 2.0 Common interface for HTTP messages psr/log 3.0.0 Common interface for logging libraries psr/simple-cache 3.0.0 Common interfaces for simple caching roave/security-advisories dev-latest cbce831 Prevents installation of composer packages with known security vulnerabilities: no API, simply require it stof/doctrine-extensions-bundle v1.10.1 Integration of the gedmo/doctrine-extensions with Symfony symfony/asset v6.4.0 Manages URL generation and versioning of web assets such as CSS stylesheets, JavaScript files and image files symfony/asset-mapper v6.4.2 Maps directories of assets & makes them available in a public directory with versioned filenames. symfony/cache v6.4.2 Provides extended PSR-6, PSR-16 (and tags) implementations symfony/cache-contracts v3.4.0 Generic abstractions related to caching symfony/clock v7.0.2 Decouples applications from the system clock symfony/config v7.0.0 Helps you find, load, combine, autofill and validate configuration values of any kind symfony/console v6.4.2 Eases the creation of beautiful and testable command line interfaces symfony/debug-bundle v6.4.0 Provides a tight integration of the Symfony VarDumper component and the ServerLogCommand from MonologBridge into the Symfony full-stac... symfony/dependency-injection v7.0.2 Allows you to standardize and centralize the way objects are constructed in your application symfony/deprecation-contracts v3.4.0 A generic function and convention to trigger deprecation notices symfony/doctrine-bridge v6.4.2 Provides integration for Doctrine with various Symfony components symfony/doctrine-messenger v6.4.2 Symfony Doctrine Messenger Bridge symfony/dotenv v6.4.2 Registers environment variables from a .env file symfony/error-handler v7.0.0 Provides tools to manage errors and ease debugging PHP code symfony/event-dispatcher v6.4.2 Provides tools that allow your application components to communicate with each other by dispatching events and listening to them symfony/event-dispatcher-contracts v3.4.0 Generic abstractions related to dispatching event symfony/expression-language v6.4.2 Provides an engine that can compile and evaluate expressions symfony/filesystem v7.0.0 Provides basic utilities for the filesystem symfony/finder v7.0.0 Finds files and directories via an intuitive fluent interface symfony/flex v2.4.3 Composer plugin for Symfony symfony/form v7.0.1 Allows to easily create, process and reuse HTML forms symfony/framework-bundle v6.4.2 Provides a tight integration between Symfony components and the Symfony full-stack framework symfony/http-client v6.4.2 Provides powerful methods to fetch HTTP resources synchronously or asynchronously symfony/http-client-contracts v3.4.0 Generic abstractions related to HTTP clients symfony/http-foundation v7.0.0 Defines an object-oriented layer for the HTTP specification symfony/http-kernel v6.4.2 Provides a structured process for converting a Request into a Response symfony/intl v7.0.2 Provides access to the localization data of the ICU library symfony/lock v6.4.2 Creates and manages locks, a mechanism to provide exclusive access to a shared resource symfony/mailer v6.4.2 Helps sending emails symfony/maker-bundle v1.52.0 Symfony Maker helps you create empty commands, controllers, form classes, tests and more so you can forget about writing boilerplate c... symfony/messenger v7.0.1 Helps applications send and receive messages to/from other applications or via message queues symfony/mime v7.0.0 Allows manipulating MIME messages symfony/monolog-bridge v7.0.0 Provides integration for Monolog with various Symfony components symfony/monolog-bundle v3.10.0 Symfony MonologBundle symfony/options-resolver v6.4.0 Provides an improved replacement for the array_replace PHP function symfony/password-hasher v7.0.0 Provides password hashing utilities symfony/polyfill-intl-grapheme v1.28.0 Symfony polyfill for intl's grapheme_* functions symfony/polyfill-intl-icu v1.28.0 Symfony polyfill for intl's ICU-related data and classes symfony/polyfill-intl-idn v1.28.0 Symfony polyfill for intl's idn_to_ascii and idn_to_utf8 functions symfony/polyfill-intl-normalizer v1.28.0 Symfony polyfill for intl's Normalizer class and related functions symfony/polyfill-mbstring v1.28.0 Symfony polyfill for the Mbstring extension symfony/polyfill-php83 v1.28.0 Symfony polyfill backporting some PHP 8.3+ features to lower PHP versions symfony/polyfill-uuid v1.28.0 Symfony polyfill for uuid functions symfony/process v7.0.2 Executes commands in sub-processes symfony/property-access v6.4.0 Provides functions to read and write from/to an object or array using a simple string notation symfony/property-info v6.4.0 Extracts information about PHP class' properties using metadata of popular sources symfony/proxy-manager-bridge v6.4.0 Provides integration for ProxyManager with various Symfony components symfony/routing v7.0.2 Maps an HTTP request to a set of configuration variables symfony/runtime v6.4.0 Enables decoupling PHP applications from global state symfony/security-bundle v6.4.2 Provides a tight integration of the Security component into the Symfony full-stack framework symfony/security-core v7.0.1 Symfony Security Component - Core Library symfony/security-csrf v7.0.1 Symfony Security Component - CSRF Library symfony/security-http v7.0.1 Symfony Security Component - HTTP Integration symfony/sendgrid-mailer v6.4.0 Symfony Sendgrid Mailer Bridge symfony/serializer v6.4.2 Handles serializing and deserializing data structures, including object graphs, into array structures or other formats like XML and JSON. symfony/service-contracts v3.4.1 Generic abstractions related to writing services symfony/stimulus-bundle v2.13.3 Integration with your Symfony app & Stimulus! symfony/stopwatch v6.4.0 Provides a way to profile code symfony/string v7.0.2 Provides an object-oriented API to strings and deals with bytes, UTF-8 code points and grapheme clusters in a unified way symfony/translation v6.4.2 Provides tools to internationalize your application symfony/translation-contracts v3.4.1 Generic abstractions related to translation symfony/twig-bridge v6.4.2 Provides integration for Twig with various Symfony components symfony/twig-bundle v6.4.0 Provides a tight integration of Twig into the Symfony full-stack framework symfony/uid v7.0.0 Provides an object-oriented API to generate and represent UIDs symfony/ux-autocomplete v2.13.3 JavaScript Autocomplete functionality for Symfony symfony/ux-live-component v2.13.3 Live components for Symfony symfony/ux-twig-component v2.13.3 Twig components for Symfony symfony/validator v6.4.2 Provides tools to validate values symfony/var-dumper v7.0.2 Provides mechanisms for walking through any arbitrary PHP variable symfony/var-exporter v7.0.2 Allows exporting any serializable PHP data structure to plain PHP code symfony/web-profiler-bundle v6.4.2 Provides a development tool that gives detailed information about the execution of any request symfony/yaml v6.4.0 Loads and dumps YAML files symfonycasts/dynamic-forms v0.1.1 Add dynamic/dependent fields to Symfony forms symplify/easy-coding-standard 12.0.13 Use Coding Standard with 0-knowledge of PHP-CS-Fixer and PHP_CodeSniffer thecodingmachine/safe v2.5.0 PHP core functions that throw exceptions instead of returning FALSE on error twig/extra-bundle v3.8.0 A Symfony bundle for extra Twig extensions twig/intl-extra v3.8.0 A Twig extension for Intl twig/twig v3.8.0 Twig, the flexible, fast, and secure template language for PHP webmozart/assert 1.11.0 Assertions to validate method input/output with nice error messages.
FluffyDiscord commented 10 months ago

Your symfony/asset is at 6.4, that's why you were able to install it. I have it on 7.0

Problem 1
    - damienharper/auditor-bundle[5.0.0, ..., 5.x-dev] require symfony/asset ^4.0|^5.0|^6.0 -> found symfony/asset[v4.0.0-BETA1, ..., 4.4.x-dev, v5.0.0-BETA1, ..., 5.4.x-dev, v6.0.0-BETA1, ..., 6.4.x-dev] but it conflicts with your root composer.json require (7.0.*).
b1rdex commented 10 months ago

You may try downgrading some Symfony packages. Or just keep waiting for v6 bundle release with full Symfony v7 compatibility :)

FluffyDiscord commented 10 months ago

I forked this package, removed the route loader and applied your workaround for now.

DamienHarper commented 10 months ago

I close this issue since this should be fixed in master branch (PR #399). Feel free to reopen if needed.