Download the PHP package dilneiss/purify without Composer

On this page you can find all versions of the php package dilneiss/purify. 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 purify

Purify

GitHub Actions Scrutinizer Code Quality Latest Stable Version Total Downloads License

Purify is a Laravel wrapper around HTMLPurifier by ezyang.

Requirements

Installation

To install Purify, run the following in the root of your project:

Then, publish the configuration file using:

If you are using Lumen, you should copy the config file purify.php by hand, and add this line to your bootstrap/app.php:

Usage

Cleaning a String

To clean a users input, simply use the clean method:

Cleaning an Array

Need to purify an array of user input? Just pass in an array:

Dynamic Configuration

Need a different configuration for a single input? Pass in a configuration array into the second parameter:

Note: Configuration passed into the second parameter is not merged with your current configuration.

Replacing the HTML Purifier instance

Need to replace the HTML Purifier instance with your own? Call the setPurifier() method:

Practices

If you're looking into sanitization, you're likely wanting to sanitize inputted user HTML content that is then stored in your database to be rendered onto your application.

In this scenario, it's likely best practice to sanitize on the way out instead of the on the way in. Remember, the database doesn't care what text it contains.

This way you can allow anything to be inserted in the database, and have strong sanization rules on the way out.

This helps tremendously if you change your sanization requirements later down the line, then all rendered content will follow these sanization rules.

Configuration

Inside the configuration file, the entire settings array is passed directly to the HTML Purifier configuration, so feel free to customize it however you wish. For the configuration documentation, please visit the HTML Purifier Website:

http://htmlpurifier.org/live/configdoc/plain.html

Custom Configuration Rules

There's multiple ways of creating custom rules on the HTML Purifier instance.

Below is an example service provider you can use as a starting point to add rules to the instance. This provider gives compatibility with Basecamp's Trix WYSIWYG editor:

Credit to Antonio Primera for resolving some HTML Purifier configuration issues with trix.

After this service provider is created, make sure you insert it into your providers array in the config/app.php file, and update your HTML.Allowed string in the config/purify.php file.

Note: Remember that after this definition is created, and you have ran Purify::clean(), the definition will be cached, and you will have to clear it from your storage/app/purify folder if you want to make changes to the definition.

Otherwise, you will have to change the definition version number or ID for it to be re-cached.


All versions of purify with dependencies

PHP Build Version
Package Version
Requires php Version >=7.1
ezyang/htmlpurifier Version ^4.9.0
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 dilneiss/purify contains the following files

Loading the files please wait ....