Download the PHP package elstc/cakephp-activity-logger without Composer

On this page you can find all versions of the php package elstc/cakephp-activity-logger. 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 cakephp-activity-logger

ActivityLogger plugin for CakePHP 5.x

ActivityLogger plugin automatically logs database operations (create, update, delete) in CakePHP applications. It tracks who, when, and what was changed.

Software License Build Status Codecov Latest Stable Version

Requirements

Installation

You can install this plugin into your CakePHP application using composer.

The recommended way to install composer packages is:

Load plugin

Load the plugin by adding the following statement in your project's src/Application.php:

Create the activity_logs table

Run migration command:

Usage

Attach to Table

Attach the ActivityLogger plugin to your table to enable automatic logging:

Basic Activity Logging

Logging on create

Logging on update

Logging on delete

Activity Logging with Issuer

You can log information about the user who performed the operation:

AutoIssuerMiddleware (Recommended for CakePHP 4.x+)

AutoIssuerMiddleware is a PSR-15 compliant middleware that provides automatic issuer setting for applications using the Authorization plugin. This middleware operates at the application level and processes authentication information early in the request lifecycle.

Installation and Configuration
Important Notes

AutoIssuerComponent (Legacy Approach)

If you're using Authorization plugin or AuthComponent, the AutoIssuerComponent will automatically set the issuer to Tables:

Activity Logging with Scope

You can log operations related to multiple models:

Activity Logging with Custom Messages

You can use the setLogMessageBuilder method to generate custom messages for each log action:

Alternatively, you can use setLogMessage before save/delete operations to set a log message:

Save Custom Log

You can also record your own activity logs:

Find Activity Logs

You can search recorded activity logs:

Advanced Usage Examples

Conditional Logging

When you want to log only under certain conditions:

Batch Processing with Logging

During large data processing, you can temporarily disable logging:

Troubleshooting

Common Issues

Q: Logs are not being recorded

A: Please check the following:

Q: Issuer information is not being recorded

A: Please check the following:

Q: AutoIssuerMiddleware vs AutoIssuerComponent - Which should I use?

A:

Q: Is there any performance impact?

A:

Q: The issuer is not set for dynamically loaded Tables

A: The AutoIssuerMiddleware hooks into Model.initialize events. Ensure:

License

MIT License. See LICENSE.txt for details.

Contributing

Bug reports and feature requests are welcome at GitHub Issues.

Pull requests are also welcome. We recommend discussing large changes in an Issue first.


All versions of cakephp-activity-logger with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
ext-json Version *
ext-pdo Version *
cakephp/cakephp Version ^5.0
psr/log Version ^3.0
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 elstc/cakephp-activity-logger contains the following files

Loading the files please wait ....