PHP Classes

File: security-checker

Recommend this page to a friend!
  Classes of Paras Malhotra   PHP Security Checker   security-checker   Download  
File: security-checker
Role: Example script
Content type: text/plain
Description: Example script
Class: PHP Security Checker
Scan project packages to check for vulnerabilities
Author: By
Last change:
Date: 3 years ago
Size: 726 bytes
 

Contents

Class file image Download
#!/usr/bin/env php
<?php

function includeIfExists($file)
{
    if (
file_exists($file)) {
        return include
$file;
    }
}

if ((!
$loader = includeIfExists(__DIR__.'/vendor/autoload.php')) && (!$loader = includeIfExists(__DIR__.'/../../autoload.php'))) {
    die(
'You must have Composer installed and must run the composer install CLI command.'.PHP_EOL.
       
'Download Composer from the website: https://getcomposer.org/download/'.PHP_EOL.
       
'Then, run the "composer install" command.'.PHP_EOL);
}

use
Enlightn\SecurityChecker\SecurityCheckerCommand;
use
Symfony\Component\Console\Application;

$console = new Application('Enlightn Security Checker');
$console->add(new SecurityCheckerCommand);
$console->run();