PHP code example of shiftpi / metascan-api

1. Go to this page and download the library: Download shiftpi/metascan-api 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/ */

    

shiftpi / metascan-api example snippets


// ...
'modules' => [
    // ...
    'ShiftpiMetascanApi',
    // ...
],
// ...

'metascan' => [
    'key' => 'yourapikey'
]

$service = $sm->get(\ShiftpiMetascanApi\Service\Scan::class);
$result = $service->scan(file_get_contents('/path/to/myfile.zip', 'myfile.zip', 'secretpassword'));

$service = $sm->get(\ShiftpiMetascanApi\Service\HashLookup::class);
$result = $service->lookup(hash('sha256', file_get_contents('/path/to/myfile.zip')));