Download the PHP package manasbala/doctrine-log-bundle without Composer

On this page you can find all versions of the php package manasbala/doctrine-log-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package doctrine-log-bundle

DoctrineLogBundle

Symfony bundle to enable auto logging data changes. Works with doctrine entities only. This bundle will save developer's ass to determine how data has been changed :)

Often projects need to log change to see the complete history of changes are made on an object. It's mainly for superadmin who needs to know these information. To control it from a central place and log automatically this bundle is developed. Using this bundle in your symfony project you can choose which entities you want to autolog. This bundle will automatically insert a record each time the data is changed. You can configure which property you want to track with 2 strategy.

This bundle is tested on symfony 4

Prerequisities

This bundle use stof/doctrine-extensions-bundle to use blameable and timestampable. Install the bundle first and configure to use blamable and timestampable. Read the installation guide here https://symfony.com/doc/master/bundles/StofDoctrineExtensionsBundle/index.html

Installation

Make sure Composer is installed globally, as explained in the installation chapter of the Composer documentation.

Applications that use Symfony Flex

Open a command console, enter your project directory and execute:

Applications that don't use Symfony Flex

Step 1: Download the Bundle

Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:

Step 2: Enable the Bundle

Then, enable the bundle by adding it to the list of registered bundles in the config/bundles.php file of your project:

Step 3: Update database

It'll create the mb_entity_log table in your database

Step 4: Configure entities you need to log

Add @Loggable annotation in the entity you want to log changes. By default strategy will be include_all, all properties changes will be logged.

Strategy

There are two strategies. exclude_all & include_all. Exclude all will automatically skip all properties. And icclude all will automatically log all properties.

Strategies are used only for update. Create and Delete actions always logged.

If you want to exclude all properties and only log one property then use strategy exclude_all and use @Log annotation only in the property you want to log.

Above example will only log for the $name property.

If you want to log all but skip one property. Then use strategy include_all and in the property use annotation @Exclude to skip that property.

That's it now it'll start auto logging entity changes and store inside the mb_entity_log table.

Configuration

If you are using blameable trait or timestampable trait then you must want to log changes of those properties. Or you may have some common properties that is added in many entries and you don't want to log the changes of those properties then add this configuration. A different entity manager can be configured to support multiple entity managers. The listener service could be extended to make any required changes.

Any property name you configure here, if the Loggable entity has that property will be ignored.

How data will be saved

In the mb_entity_log table there are 9 columns

  1. id (primary key)
  2. object_class (the class being changed)
  3. foreign_key (the id of the object)
  4. action (create|update|delete)
  5. changes (serialized changes, keys are property name, and value is an array, 1st element prev val, 2nd element new val)
  6. created_by (the user to blame)
  7. updated_by (the user to blame)
  8. created_at (timestamp)
  9. updated_at

Now you can choose how to display this data to super admin.


All versions of doctrine-log-bundle with dependencies

PHP Build Version
Package Version
Requires php Version ^7.1.3
jms/serializer-bundle Version ^3.4 || ^4.0
symfony/orm-pack Version *
stof/doctrine-extensions-bundle Version ^1.3
symfony/monolog-bundle Version ^3.5
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package manasbala/doctrine-log-bundle contains the following files

Loading the files please wait ....