PHPackages                             trendandrew/file-security-sdk - 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. [Security](/categories/security)
4. /
5. trendandrew/file-security-sdk

ActiveLibrary[Security](/categories/security)

trendandrew/file-security-sdk
=============================

Trend Micro Vision One File Security SDK for PHP - File scanning using AMaaS (Anti-Malware as a Service) via embedded Node.js gRPC service

1.0.0-beta1(4mo ago)01MITPHPPHP &gt;=8.0

Since Dec 12Pushed 4mo agoCompare

[ Source](https://github.com/TrendAndrew/tm-v1-fs-php-sdk)[ Packagist](https://packagist.org/packages/trendandrew/file-security-sdk)[ Docs](https://github.com/trendandrew/tm-v1-fs-php-sdk)[ RSS](/packages/trendandrew-file-security-sdk/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (3)Versions (3)Used By (0)

Trend Vision One File Security PHP SDK
======================================

[](#trend-vision-one-file-security-php-sdk)

[![PHP Version](https://camo.githubusercontent.com/f32695bd6f65b12545162e869707d33dac6bcb5f6e5dc0d48b6d1f8162b6c247/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344382e302d626c75652e737667)](https://www.php.net/)[![Node.js Version](https://camo.githubusercontent.com/04ad7f3f63b054c9af1b9b964209bbb23c541e24fa2ad50dedf6d0460401afba/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6e6f64652d25334525334431362e302d677265656e2e737667)](https://nodejs.org/)[![License](https://camo.githubusercontent.com/074b89bca64d3edc93a1db6c7e3b1636b874540ba91d66367c0e5e354c56d0ea/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e737667)](LICENSE)

Trend Vision One File Security PHP SDK provides malware scanning capabilities for files using the Trend Micro Vision One File Security service (AMaaS - Anti-Malware as a Service). This SDK enables PHP applications to detect malware, viruses, and other threats in uploaded files before they are processed or stored.

This SDK uses a hybrid PHP/Node.js architecture that wraps the official [file-security-sdk](https://www.npmjs.com/package/file-security-sdk) npm package, providing PHP applications with access to Trend Micro's gRPC-based scanning service without requiring the PHP gRPC extension.

Table of Contents
-----------------

[](#table-of-contents)

- [Features](#features)
- [Prerequisites](#prerequisites)
- [Installation](#installation)
- [Quick Start](#quick-start)
- [Trend Vision One Setup](#trend-vision-one-setup)
- [Configuration](#configuration)
- [API Reference](#api-reference)
- [Code Examples](#code-examples)
- [Error Handling](#error-handling)
- [Logging](#logging)
- [Security](#security)
- [Troubleshooting](#troubleshooting)
- [Architecture](#architecture)
- [License](#license)

Features
--------

[](#features)

- **File scanning** for malware, viruses, trojans, and other threats
- **Multiple region support** - US, EU, Japan, Singapore, Australia, India, Middle East
- **Comprehensive error handling** with specific exception types
- **PSR-4 autoloading** compatible
- **No PHP gRPC extension required** - uses embedded Node.js service
- **No external ports** - IPC via stdin/stdout (no firewall configuration needed)
- **PHP 8.0+ support**
- **Detailed scan results** including SHA256 hashes and threat information

Prerequisites
-------------

[](#prerequisites)

### System Requirements

[](#system-requirements)

RequirementVersionNotesPHP8.0 or laterWith `proc_open` enabledNode.js16.0 or laterFor gRPC communicationnpm8.0 or laterFor package management### Trend Vision One Requirements

[](#trend-vision-one-requirements)

Before using this SDK, you need:

1. An active **Trend Vision One** account
2. API key with **Run file scan via SDK** permission
3. Account associated with the correct regional deployment

See [Trend Vision One Setup](#trend-vision-one-setup) for detailed instructions.

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

[](#installation)

### Using Composer (Recommended)

[](#using-composer-recommended)

```
composer require trendandrew/file-security-sdk
```

After installing the Composer package, install the Node.js dependencies:

```
cd vendor/trendandrew/file-security-sdk/service
npm install
```

### Manual Installation

[](#manual-installation)

1. **Download the SDK** to your project:

```
git clone https://github.com/trendandrew/tm-v1-fs-php-sdk.git
cd tm-v1-fs-php-sdk
```

2. **Install Node.js dependencies:**

```
cd service
npm install
```

3. **Include the SDK in your PHP code:**

```
require_once '/path/to/tm-v1-fs-php-sdk/src/TrendMicroScanner.php';
```

### Verify Installation

[](#verify-installation)

Test that the scanner service is working:

```
node service/scanner.js --test
```

Expected output:

```
{
  "success": true,
  "status": "test",
  "message": "Scanner service is working",
  "version": "1.0.0",
  "nodeVersion": "v20.0.0",
  "regions": ["us", "eu", "jp", "sg", "au", "in", "me"]
}
```

Quick Start
-----------

[](#quick-start)

```
