PHPackages                             ndrstmr/icap-flow - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. ndrstmr/icap-flow

ActiveLibrary

ndrstmr/icap-flow
=================

State-of-the-art, async-ready ICAP client for PHP.

v1.0.0(11mo ago)01EUPL-1.2PHPPHP &gt;=8.3CI passing

Since Jun 18Pushed 10mo agoCompare

[ Source](https://github.com/ndrstmr/icap-flow)[ Packagist](https://packagist.org/packages/ndrstmr/icap-flow)[ RSS](/packages/ndrstmr-icap-flow/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (6)Versions (3)Used By (0)

 [![IcapFlow Logo](docs/assets/IcapFlow-logo.svg)](docs/assets/IcapFlow-logo.svg)

[![Latest Stable Version](https://camo.githubusercontent.com/a52cc0855218f2ec890b1250784eac2dcab81c9cdba1057ae6b1dd75f5f534e4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6e647273746d722f696361702d666c6f77)](https://packagist.org/packages/ndrstmr/icap-flow)[![Total Downloads](https://camo.githubusercontent.com/c3d75895ed3fb878e50fe8aad44413cb528cfd6950c6a98a61c3029ede666347/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6e647273746d722f696361702d666c6f77)](https://packagist.org/packages/ndrstmr/icap-flow)[![GitHub Actions Workflow Status](https://camo.githubusercontent.com/71886b2add425bf94bde9d9640d719d7bb4b9edffc2797174868d52a22f8a9ef/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6e647273746d722f696361702d666c6f772f63692e796d6c3f6272616e63683d6d61696e)](https://github.com/ndrstmr/icap-flow/actions)[![Code Coverage](https://camo.githubusercontent.com/493217a03a22730326e5f71e8d8933eb40fb3e2f3a51b5e68a54b0d707aa5b9c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f436f6465253230436f7665726167652d566965772532305265706f72742d626c75652e737667)](https://ndrstmr.github.io/icap-flow/)[![PHPStan Level](https://camo.githubusercontent.com/b72adb1f27170ecf486459c4b07e920bb3db2b464444bce8277e018270665646/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048505374616e2d6c6576656c253230392d627269676874677265656e)](https://phpstan.org/)[![License](https://camo.githubusercontent.com/d392af71f92381cf5295c0ca95d205df21c9a056111959fb69a4d397e6b5325f/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6e647273746d722f696361702d666c6f77)](https://github.com/ndrstmr/icap-flow/blob/main/LICENSE)

icap-flow
=========

[](#icap-flow)

A modern, robust, and async-ready ICAP (Internet Content Adaptation Protocol) client for PHP 8.3+.

Project Vision
--------------

[](#project-vision)

This library aims to be the de-facto standard solution for PHP developers needing ICAP connectivity, focusing on quality, performance, and an excellent developer experience. For more details, see our [mission charter](docs/agent.md).

Installation
------------

[](#installation)

```
composer require ndrstmr/icap-flow
```

Basic Usage
-----------

[](#basic-usage)

For most projects, the `SynchronousIcapClient` offers a very simple, blocking API.

```
$icap = SynchronousIcapClient::create();

$result = $icap->scanFile('/service', '/path/to/your/file.txt');

echo $result->isInfected()
    ? 'Virus found: ' . $result->getVirusName()
    : 'File is clean';
```

Advanced Usage: Asynchronous Requests
-------------------------------------

[](#advanced-usage-asynchronous-requests)

To take advantage of non-blocking I/O, interact with the `IcapClient` directly within an event loop:

```
use Revolt\EventLoop;

$icap = IcapClient::create();

EventLoop::run(function () use ($icap) {
    $future = $icap->scanFile('/service', '/path/to/your/file.txt');
    $result = $future->await();

    echo $result->isInfected()
        ? 'Virus: ' . $result->getVirusName() . PHP_EOL
        : 'File is clean' . PHP_EOL;
});
```

Configuration
-------------

[](#configuration)

Adjust the connection settings using the `Config` DTO:

```
use Ndrstmr\Icap\Config;

$config = new Config(
    host: 'icap.example.com',
    port: 1344,
    socketTimeout: 5.0,
    streamTimeout: 30.0,
    // Header used by the ICAP server to report infections
    virusFoundHeader: 'X-Virus-Name',
);
```

This object can be passed to the client factory methods.

Extensibility (Cookbook)
------------------------

[](#extensibility-cookbook)

Preview handling uses the Strategy pattern. Custom strategies implement `PreviewStrategyInterface` and can be registered on the client. Detailed examples can be found in the [`examples/cookbook/`](examples/cookbook/) directory.

For Developers
--------------

[](#for-developers)

Run the test suite with the following command:

```
composer test
```

Further details about the pull request workflow can be found in [CONTRIBUTING.md](CONTRIBUTING.md).

License
-------

[](#license)

This project is licensed under the EUPL-1.2 License. See the LICENSE file for details.

Changelog
---------

[](#changelog)

A list of all changes can be found in [CHANGELOG.md](CHANGELOG.md).

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance53

Moderate activity, may be stable

Popularity1

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

332d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ec966b63930eb41af981e8daf965073bc19f42bc18f489d80ff420050a7a624e?d=identicon)[ndrstmr](/maintainers/ndrstmr)

---

Top Contributors

[![ndrstmr](https://avatars.githubusercontent.com/u/153233004?v=4)](https://github.com/ndrstmr "ndrstmr (20 commits)")

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/ndrstmr-icap-flow/health.svg)

```
[![Health](https://phpackages.com/badges/ndrstmr-icap-flow/health.svg)](https://phpackages.com/packages/ndrstmr-icap-flow)
```

###  Alternatives

[danog/madelineproto

Async PHP client API for the telegram MTProto protocol.

3.4k855.0k18](/packages/danog-madelineproto)[amphp/parallel

Parallel processing component for Amp.

84746.2M74](/packages/amphp-parallel)[amphp/http-server

A non-blocking HTTP application server for PHP based on Amp.

1.3k4.5M81](/packages/amphp-http-server)[amphp/http-client

An advanced async HTTP client library for PHP, enabling efficient, non-blocking, and concurrent requests and responses.

7286.8M137](/packages/amphp-http-client)[amphp/mysql

Asynchronous MySQL client for PHP based on Amp.

3761.1M27](/packages/amphp-mysql)[amphp/redis

Efficient asynchronous communication with Redis servers, enabling scalable and responsive data storage and retrieval.

165634.7k44](/packages/amphp-redis)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
