cleentfaar/tissue-clamav-adapter
Laravel adapter for Tissue that integrates ClamAV scanning into your file upload/validation flow. Provides a simple bridge to run antivirus checks on uploaded files and handle infected results within your application.
tissue-clamav-adapter package is a Tissue adapter, meaning it integrates with the Tissue library—a PHP file system abstraction layer—to enable ClamAV-based virus scanning for uploaded files. This is a niche but critical feature for applications handling user uploads (e.g., CMS, SaaS platforms, file-sharing services).FileSystem, File, Directory), this adapter extends its functionality without requiring a full rewrite. Ideal for monolithic or modular PHP apps already using Tissue.php-clamav) may be simpler for non-Tissue apps.| Risk Area | Severity | Mitigation Strategy |
|---|---|---|
| ClamAV Daemon Failure | High | Implement health checks + fallback (e.g., local scans). |
| Performance Bottleneck | Medium | Benchmark scan times; optimize with caching (e.g., cache clean results). |
| False Positives/Negatives | Medium | Test with known malware samples; tune ClamAV signatures. |
| Tissue Version Lock | Low | Pin Tissue version in composer.json to avoid breaking changes. |
| Windows Support | Medium | ClamAV on Windows is less stable; document limitations. |
php-clamav).composer require cleentfaar/tissue-clamav-adapter tissue/ti
clamd) is running and accessible.use Cleentfaar\TissueClamavAdapter\ClamavAdapter;
$filesystem = new \Tissue\FileSystem(
new ClamavAdapter('/path/to/clamav/socket')
);
FileUploaded event listener).$file = $filesystem->file('uploaded/file.pdf');
if (!$file->scan()) {
throw new \RuntimeException('Virus detected!');
}
try-catch for ClamavException or socket timeouts.composer.json for constraints.HandleUploadedFile).cron or a config management tool (e.g., Ansible).socket timeout) may require server-level troubleshooting.clamd.MaxConnectionQueue for high concurrency.| Failure Scenario | Impact | Mitigation |
|---|---|---|
| ClamAV daemon crashes | No scans possible | Health checks + auto-restart (e.g., systemd). |
| Network issues (socket) | Timeouts for remote scans | Fallback to local scan or queue for retry. |
| False positives | Legitimate files quarantined | Whitelist known-safe file types. |
| Resource exhaustion | Slow scans or OOM kills | Limit concurrent scans; monitor memory. |
| ClamAV signature lag | Misses new malware | Automate signature updates. |
CLEAN, VIRUS, ERROR).clamd during tests).FreshClam updates).How can I help you explore Laravel packages today?