File: bin/build

Recommend this page to a friend!
  Classes of Marco Cesarato  >  PHP Malware Scanner Free Tool  >  bin/build  >  Download  
File: bin/build
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 bin/build
Date: 24 days ago
Size: 955 bytes
 

Contents

Class file image Download
#!/usr/bin/env php
<?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
 */

define('ROOT', dirname(__DIR__));

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

$input = ROOT . '/src/';
$output = ROOT . '/dist/scanner.phar';
$finalOutput = ROOT . '/dist/scanner';

// clean up
if (file_exists($output)) {
   
unlink($output);
}
if (
file_exists($output . '.gz')) {
   
unlink($output . '.gz');
}
if (
file_exists($finalOutput)) {
   
unlink($finalOutput);
}
// create phar
$p = new Phar($output);

// creating our library using whole directory
$p->buildFromDirectory($input);

// pointing main file which requires all classes
$p->setDefaultStub('index.php', '/index.php');

unset(
$p);
rename($output, $finalOutput);

echo
"$output successfully created";


For more information send a message to info at phpclasses dot org.