PHP Classes

File: tools/random_audit.php

Recommend this page to a friend!
  Classes of Scott Arciszewski   CMS Airship   tools/random_audit.php   Download  
File: tools/random_audit.php
Role: Auxiliary script
Content type: text/plain
Description: Auxiliary script
Class: CMS Airship
Content management system with security features
Author: By
Last change: Universal mbstring.func_overload resistance
Date: 7 years ago
Size: 634 bytes
 

Contents

Class file image Download
<?php
declare(strict_types=1);

use
ParagonIE\ConstantTime\Binary;

require_once \
dirname(__DIR__).'/src/bootstrap.php';

/**
 * Grabs a random file and tells you to audit it.
 */

if ($argc > 1) {
   
$extensions = \array_slice($argv, 1);
} else {
   
$extensions = ['php', 'twig'];
}
$fileList = [];
foreach (
$extensions as $ex) {
    foreach (\
Airship\list_all_files(\dirname(__DIR__) . '/src/', $ex) as $file) {
       
$fileList []= $file;
    }
}

$choice = \random_int(0, \count($fileList) - 1);

echo
"Audit this file:\n\t";

$l = Binary::safeStrlen(\dirname(__DIR__));

echo
Binary::safeSubstr($fileList[$choice], $l), "\n";