ibrows/loggable-bundle

扩展的Loggable Bundle

3.0.0-beta2 2022-05-25 13:35 UTC

README

Symfony2 Bundle,能够跟踪项目中每个实体变化并保存到日志表中。这个Bundle可以让你的项目获得某种程度的确认性。

它还提供了一些方法来将实体恢复到早期版本。

安装 & 配置Bundle

  1. 在composer.json中添加IbrowsLoggableBundle

    {
        "require": {
            "ibrows/loggable-bundle": "~1.0",
        }
    }
  2. 现在运行以下命令让composer下载Bundle

    $ php composer.phar update ibrows/loggable-bundle

    Composer会将Bundle安装到项目的ibrows/loggable-bundle目录中。(PSR-4)

  3. 将Bundle添加到你的AppKernel类中

    // app/AppKernerl.php
    public function registerBundles()
    {
        $bundles = array(
            // ...
            new Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle(),
            new Ibrows\LoggableBundle\IbrowsLoggableBundle(),
            // ...
        );
        // ...
    }
  4. 推荐配置stof_doctrine_extensions

    stof_doctrine_extensions:
        orm:
            default:
              softdeleteable: true
              loggable: true
        class:
            loggable: Ibrows\LoggableBundle\Listener\LoggableListener