Download the PHP package juststeveking/masking-engine without Composer

On this page you can find all versions of the php package juststeveking/masking-engine. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package masking-engine

Masking Engine

Latest Version PHP Version run-testsTotal Downloads

A PHP masking engine, that allows you to quickly and easily mask data based on configured formats.

Installation

You can install this package using composer

Configuration

You can publish the configuration for this package using the php artisan vendor:publish --tag=masking-config

This will publish the default config to config/masking.php, and will look like the following by default:

Usage

Let's walk through the usage. We have a values array, that hold how we want to mask data in our application.

You will see that we are using a StringMatcher here, what this can do is obfuscate any string to a series of *.

For example test will turn into ****. By default, this package comes with a selection of maskers/matchers that you can use - but you are also free to create your own.

Please note, these classes will not validate that the data is correct - for example it will not validate it is a correct credit card number or social security number.

The Masking Engine uses Regex to define a pattern both mask or match the input passed in. All Matching classes needs to either implement the MasksInput interface, or extend the StringMatcher class itself.

Let's look at the Email matcher as an example:

We define a pattern as a property for the class, which is a simple Regex to make sure that the input is formatted correctly. The masking method, will do a preg replace callback to take certain parts from the input and mask a specific part of the input.

In theory, you don't have to use Regex at all. You could implement something really simple such as:

The only important part of the class, is that the mask method will return a string.

Testing

This package comes will a full test suite, as well as static analysis checks:

or

Contributing

Feel free to use this package as suits your needs, if you would like to contribute please make sure that you are following the coding standards in place for this library, and test coverage is kept to a high standard.

Security

If you find any security related issues with this package, please feel free to reach out to me directly.


All versions of masking-engine with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package juststeveking/masking-engine contains the following files

Loading the files please wait ....