mirko-pagliai/cakephp-entities-logger 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

mirko-pagliai/cakephp-entities-logger

Composer 安装命令:

composer require mirko-pagliai/cakephp-entities-logger

包简介

Entities Logger plugin for CakePHP

README 文档

README

Software License CI codecov Codacy Badge CodeFactor

screenshot_phpmyadmin.png

From this screenshot, which shows the table seen by PhpMyAdmin, we see the logs generated by two different entities, created, modified or deleted by different users.

Installation

You can install the plugin via composer:

composer require --prefer-dist mirko-pagliai/cakephp-entities-logger

Then you have to load the plugin. For more information on how to load the plugin, please refer to the CakePHP documentation.

Simply, you can execute the shell command to enable the plugin:

bin/cake plugin load Cake/EntitiesLogger

This would update your application's bootstrap method.

Create the table

Now you need to create the table that the plugin will use to keep changes to the entities you want.

The best way is using migrations:

bin/cake migrations migrate -p Cake/EntitiesLogger

Instead, if you want to verify that the plugin migrations have been applied correctly:

bin/cake migrations status -p Cake/EntitiesLogger

Add the behavior

Add the Cake/EntitiesLogger.EntitiesLog behavior to the tables you want.

Inside the initialize() method of your tables:

namespace App\Model\Table;

use Cake\ORM\Table;

class ArticlesTable extends Table
{
    public function initialize(array $config): void
    {
        // ...
        
        $this->addBehavior('Cake/EntitiesLogger.EntitiesLog');
        
        // ...
    }
}

统计信息

  • 总下载量: 3.02k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-06-16