scr34m / php-malware-scanner

Scans PHP files for malwares and known threats
GNU General Public License v3.0
556 stars 96 forks source link

composer compatibility #8

Closed code2prog closed 6 years ago

code2prog commented 6 years ago

Hey! Can you make your project compatible with Composer dependency manager?

scr34m commented 6 years ago

Maybe, but how do you imagine to use as a library, there are may commandline options to use.

code2prog commented 6 years ago

Many commandline php tools have Composer support (https://packagist.org/search/?tags=command%20line). This is very helpful in ensuring that the tools are in the newest versions.

scr34m commented 6 years ago

Okay, then i will check some of them and see what can i do.

scr34m commented 6 years ago

The linked search shows only libraries for command line application development. Basically composer purpose is the dependency management, but this tool is a complete application not just a library.

But you can always use git pull to be updated and composer will do mostly this too.

jaygilmore commented 6 years ago

for me to bring this onto a server, I am just doing git clone… and "viola" it's there to use since it's a full application.

scr34m commented 6 years ago

@code2prog got an idea take a look at the composer branch https://github.com/scr34m/php-malware-scanner/tree/composer

A small example to call as a library if needed, i know this was not your basic request, but this makes the code Composer friendly.

require_once 'scan.php';

$s = new MalwareScanner(false);
$s->setFlagHideOk(true);
$s->run('samples/_tickets/');

And of course if you call it from commandline php scan.php still works as expected.

scr34m commented 6 years ago

Merged to the master, submited to packagist.