PHP code example of kooba / craft-content-audit
1. Go to this page and download the library: Download kooba/craft-content-audit 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/ */
kooba / craft-content-audit example snippets
class MyNewAuditor implements AuditorInterface
{
public function handle(): string { return 'my-check'; }
public function label(): string { return 'My Check'; }
public function run(): array { /* return AuditIssue[] */ }
}
$this->auditors = [
new OrphanedAssetsAuditor(),
new MyNewAuditor(), // <- add here
];
protected array|int|bool $allowAnonymous = self::ALLOW_ANONYMOUS_NEVER;
public function actionIndex(): Response
{
$this->