PHP Classes
elePHPant
Icontem

File: distribute

Recommend this page to a friend!
  Classes of Marco Cesarato  >  PHP Malware Scanner Free Tool  >  distribute  >  Download  
File: distribute
Role: Example script
Content type: text/plain
Description: Example script
Class: PHP Malware Scanner Free Tool
Scan PHP files to find malicious code
Author: By
Last change: Update of distribute
Date: 5 days ago
Size: 1,415 bytes
 

 

Contents

Class file image Download
<?php

/**
 * Antimalware Scanner
 * @author Marco Cesarato <cesarato.developer@gmail.com>
 * @copyright Copyright (c) 2019
 * @license http://opensource.org/licenses/gpl-3.0.html GNU Public License
 * @link https://github.com/marcocesarato/PHP-Antimalware-Scanner
 */

require __DIR__ . '/vendor/autoload.php';

$input = 'src/scanner';
$output = 'dist/scanner';

$jc = new JuggleCode();
$jc->masterfile = $input;
$jc->outfile = $output;
$jc->mergeScripts = true;
$jc->run();

if(empty(
$argv[1])) {
   
$version = "0.4.0";
} else {
   
$version = $argv[1];
}

$date = date("d-m-Y");
$year = date("Y");
$comment = <<<EOD
<?php

/**
 * PHP Antimalware Scanner
 * Distribution generated on
$date
 * @version
$version
 * @author Marco Cesarato <cesarato.developer@gmail.com>
 * @copyright Copyright (c)
$year
 * @license http://opensource.org/licenses/gpl-3.0.html GNU Public License
 * @link https://github.com/marcocesarato/PHP-Antimalware-Scanner
 */

EOD;


$file = php_strip_whitespace($output);
$file = preg_replace('/namespace marcocesarato\\\\amwscan\;\s*/si', '', $file);
$file = preg_replace('/public\s*static\s*\$VERSION\s*=\s*(\"|\\\')0\.5\.0(\"|\\\')\s*\;/si', 'public static $VERSION = "'.$version.'";', $file);
$from = '/'.preg_quote("<?php", '/').'/';
$file = preg_replace($from, $comment, $file, 1);
$file = "#!/usr/bin/php" . PHP_EOL . $file;
$file = file_put_contents($output, $file);