Download the PHP package shiftpi/metascan-api without Composer
On this page you can find all versions of the php package shiftpi/metascan-api. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package metascan-api
ShiftpiMetascanApi
Client for Metascan Online Public API.
Installation
Using Composer
Enable module by adding
after you have required shiftpi/metascan-api
in your composer.json
.
Features
What is supported?
- Scanning files by upload
- Looking up stored reports for single hashes
What is not supported?
- Looking up stored reports for multiple hashes
- Looking up IP addresses or URIs
Configuration
Add
to your application's config.
You may want to use another HTTP client adapter. By default CURL is used.
To use your own adapter, register ShiftpiMetascanApi\Http\Adapter
and make sure it is an instance of Zend\Http\Client\Adapter\AdapterInterface
.
Usage
Scan data
If you want to scan the whole content of a file, you should use the ScanService class. Retrieve an instance from the
service manager by using the key ShiftpiMetascanApi\Service\Scan
.
The second and third parameters are optional. If you upload an encrypted archive, Metascan Online can decrypt it if you provide the password as third parameter.
Lookup hash
A faster way checking files is looking up its hash. For that you can use the HashLookupService by retrieving ShiftpiMetascanApi\Service\HashLookup
from the service manager.
The parameter should be a SHA256, SHA1 or MD5 hash. If the parameter has an other string length, than a supported algorithm produces, an exception will be thrown. Please note: If you lookup a hash Metascan does not know, a "Not Found" state will be returned. This does not mean, that the file is probably not malicious.
Testing
There are some test files for the services present. You have to copy the file test/config/config.local.php.dist
to test/config/config.local.php
and paste your API key in order to run those.
These are tests against the real API, which will produce real API requests (no mocks!). Therefore be careful running them and keep yor API limits in mind. ;-)
License
Licensed under the MIT license. See license file.