sikessem/ignorant

πŸ™ˆ Ignore files by names or paths

0.0.0 2022-09-09 02:11 UTC

This package is auto-updated.

Last update: 2024-12-09 07:01:00 UTC


README

SIKessEm logo

πŸ™ˆ Ignore files by names or paths

The Ignorant library allows you to check if a path or name is ignored in a pattern list or in a pattern dot (.) file.

Installation

Using composer, you can install Ignorant with the following command:

composer require sikessem/ignorant

Usage

Explore our .gitignore file:

<?php

use Sikessem\Ignorant\Ignorefile;

require_once "$VENDOR_DIR/autoload.php";

$gitignore = new Ignorefile(__DIR__.'/.gitignore');

$gitignore->contains('/vendor/'); // Returns true
$gitignore->contains('/.phpunit*'); // Returns true

$gitignore->includes('/vendor/autoload.php'); // Returns true
$gitignore->includes('/.phpunit.result.cache'); // Returns true

$gitignore->excludes('src'); // Return true
$gitignore->excludes('/tests/Unit'); // Return true

License

This library is distributed under the License

Security Reports

Please send any sensitive issue to ske@sikessem.com. Thanks!