Download the PHP package habemus/vacuum-cleaner without Composer

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

Vacuum: Data validation library

Vacuum is a light-weight standalone library for data validation, heavily based on Laravel Validation.

Installation

Basic Usage: The Cleaner Object

Instantiate Cleaner::class with input data and validate with built in filters. Cleaner::class accepts only arrays of data as input. Data can be of any native data type and objects. Native PHP file arrays will be converted to FileUpload::class objects.

Results

To check if input has validated use isValid() method. The validate() method returns data that has validated succesfully, even if not all of the input data has not been validated.

Filters

Filters must be enclosed in an array or separated by |. Filter parameters must be specified after : and separated by commas ,.

Available filters

Custom Filter

It's possible to write your own filter using CustomFilter::class. The class constructor accepts a Closure as parameter. The Closure must have one $value parameter and must return either true on validation or false on failure.

Custom Filters also has the capability of running sanitize function on data being evaluated. Just pass the sanitizing function (Closure) as second parameter to the constructor.

The third optional parameter (true or false) is to instruct Cleaner::class instance to execute the sanitizing function after filter validation. Otherwise sanitizing functions are always executed first.

The Request Object

The Request::class is a small wrapper around the Cleaner::class validator instance that speeds up the process of validating HTTP requests data from forms.

FileUpload

This class has some handy methods to help you deal with files uploaded via forms. When FileUpload::class constructor is called, it can raise RuntimeException when attempting to guess file extension or while renaming it. When a FileUpload instance is succesfully created, the uploaded file is automatically renamed with it's upload name, avoiding duplications and overwriting. If you intend to keep the uploaded file it's mandatory to call the method store($destination_path), because the class destructor will delete the file automatically on exit.

class methods

Now File and FileUpload are separate entities. tmp_path no longer exists, use getPath() instead.

Error Messages

To retrieve messages use errors().

This way you can check if field is present and which error has occurred. It's also possibile to specify a custom error message for a specific field by passing an array with custom messages as third parameter to Cleaner::class constructor.

Other options

It's possible to sanitize all fields by passing a Closure as third parameter on Cleaner init.

Package developed by Habemus Agency in 2021.

https://habemus.agency/it/


All versions of vacuum-cleaner with dependencies

PHP Build Version
Package Version
Requires symfony/mime Version ^5.2
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 habemus/vacuum-cleaner contains the following files

Loading the files please wait ....