Download the PHP package ubcent/gump without Composer

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

Getting started

GUMP is a standalone PHP data validation and filtering class that makes validating any data easy and painless without the reliance on a framework.

There are 2 ways to install GUMP

Install Manually
  1. Download GUMP
  2. Unzip it and copy the directory into your PHP project directory.

Include it in your project:

Install with composer

Add the following to your composer.json file:

Then open your terminal in your project directory and run:

composer install

Available Methods

Example (Long format)

The following example is part of a registration form, the flow should be pretty standard

Example (Short format)

The short format is an alternative way to run the validation.

Match data-keys against rules-keys

We can check if there is a rule specified for every data-key, by adding an extra parameter to the run method.

If it doesn't match the output will be:

Return Values

run() returns one of two types:

ARRAY containing the successfully validated and filtered data when the validation is successful

BOOLEAN False when the validation has failed

validate() returns one of two types:

ARRAY containing key names and validator names when data does not pass the validation.

You can use this array along with your language helpers to determine what error message to show.

BOOLEAN value of TRUE if the validation was successful.

filter() returns the exact array structure that was parsed as the $input parameter, the only difference would be the filtered data.

Available Validators

Available Filters

Filters can be any PHP function that returns a string. You don't need to create your own if a PHP function exists that does what you want the filter to do.

Creating your own validators and filters

Adding custom validators and filters is made easy by using callback functions.

Alternately, you can simply create your own class that extends the GUMP class.

Please see examples/custom_validator.php for further information.

Remember to create a public methods with the correct parameter types and parameter counts.

Set Custom Field Names

You can easily override your form field names for improved readability in errors using the GUMP::set_field_name($field, $readable_name) method as follows:


All versions of gump with dependencies

PHP Build Version
Package Version
No informations.
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 ubcent/gump contains the following files

Loading the files please wait ....