Skip to content

Latest commit

 

History

History
42 lines (26 loc) · 957 Bytes

readme.md

File metadata and controls

42 lines (26 loc) · 957 Bytes

FileMatcher

Build Status

Installation

Download a latest package or use Composer:

composer require czproject/file-matcher

CzProject\FileMatcher requires PHP 5.4.0 or later.

Usage

<?php

use CzProject\FileMatcher\FileMatcher;

FileMatcher::matchMask($path, $masks[, $isPathDirectory]);

$masks = array(
	'temp/*',
	'.git*',
	'!.gitignore',
);

FileMatcher::matchMask('.git', $masks, TRUE); // returns TRUE
FileMatcher::matchMask('.gitignore', $masks); // return FALSE
FileMatcher::matchMask('temp/cache', $masks, TRUE); // returns TRUE
FileMatcher::matchMask('log/2016', $masks, TRUE); // returns FALSE

License: New BSD License
Author: Jan Pecha, https://www.janpecha.cz/