juliangut / gulp-iniscan

Gulp plugin for running iniscan

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Latest Version License

Total Downloads Monthly Downloads

iniscan Gulp plugin

Gulp plugin for running iniscan

Getting Started

If you haven't used Gulp before, be sure to check out the Getting Started guide, as it explains how to create a gulpfile. Once you're familiar with that process, you may install this plugin

npm install gulp-iniscan --save-dev

Make sure you have iniscan installed

composer require psecio/iniscan

Usage

Task

var iniscan = require('iniscan');

gulp.task('iniscan', function() {
  return gulp.src('path_to/php.ini')
    .pipe(iniscan({
      bin: 'vendor/bin/iniscan',
      threshold: 'ERROR'
    }));
});

If no path to a php.ini file is selected on the stream global PHP ini file will be used. To find your global PHP ini file run:

php -i | grep 'Loaded Configuration File' | sed 's/Loaded Configuration File *=> *//g'

API

bin

Type: String Default value: 'iniscan'

iniscan executable binary.

In case you do not provide iniscan binary path you need to have it on PATH environment variable otherwise plugin will raise an error

threshold

Type: String Default value: WARNING

Minimum rule threshold to scan upon. One of WARNING, ERROR or FATAL

format

Type: String Default value: 'console'

Output report format. One of console, html, json or xml

In case a format other than console is selected the resulting formatted report will be added to the stream so it can be saved elsewhere

var iniscan = require('iniscan');

gulp.task('iniscan', function() {
  return gulp.src('')
    .pipe(iniscan({
      bin: 'vendor/bin/iniscan',
      format: 'json'
    }))
    .pipe(gulp.dest('output_path'));
});

context

Type: String Default value: 'prod'

Context to scan rules against, rules out of the specified context won't be checked.

php

Type: String Default value: undefined

PHP version to scan upon. If none provided current php-cli PHP_VERSIONis used.

Contributing

Found a bug or have a feature request? Please open a new issue. Have a look at existing issues before.

See file CONTRIBUTING.md

License

See file LICENSE included with the source code for a copy of the license terms.

About

Gulp plugin for running iniscan

License:BSD 3-Clause "New" or "Revised" License


Languages

Language:JavaScript 100.0%