1. Go to this page and download the library: Download rasuvaeff/yii3-audit-log-db library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
use Rasuvaeff\Yii3AuditLog\AuditActor;
use Rasuvaeff\Yii3AuditLog\AuditChangeSet;
use Rasuvaeff\Yii3AuditLog\AuditLogger;
use Rasuvaeff\Yii3AuditLog\AuditSubject;
// Injected via DI:
/** @var AuditLogger $logger */
$logger->logChange(
actor: AuditActor::user(id: (string) $user->id, name: $user->name),
subject: AuditSubject::of(type: 'order', id: (string) $order->id),
changes: AuditChangeSet::fromArrays(old: $before, new: $after),
);
use Rasuvaeff\Yii3AuditLogDb\DbAuditWriter;
$writer = new DbAuditWriter(db: $db, table: 'audit_log');
$writer->write(event: $auditEvent);
use ShipMonk\ComposerDependencyAnalyser\Config\Configuration;
use ShipMonk\ComposerDependencyAnalyser\Config\ErrorType;
return (new Configuration())->ignoreErrorsOnPackage(
'rasuvaeff/yii3-audit-log-db',
[ErrorType::UNUSED_DEPENDENCY],
);
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.