Download the PHP package psecio/validation without Composer

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

Psecio/Validation

This library seeks to be a simple and reusable validation library for input based on rules.

Example

Messages

You can also define custom messages for the failures using the third $messages parameter on the execute method. The key names on the array match to the value name + check type. For example:

In the example above, we define a custom message for the alpha check on the foo value. If that check were to fail, the error message output would be the new custom message instead of the default.

Getting Errors

There are two method available to get the errors when the result of the execute method is false:

Checks

Here is a listing of the check types that Validation supports:

alpha

Checks for only alpha characters

alphanum

Checks for only alpha-numeric characters

numeric

Checks to ensure the value provided is numeric (integer, float, etc)

integer

Checks for integer-only values. Can also include minimum and maximum values:

boolean

Checks for boolean values (true, false, 0, 1 and strings '0', '1')

array

Checks to ensure the value provided is an array

length

Checks the value to ensure the (string) length matches requirements. You must provide a minimum value, but a maximum can also be defined

date

Checks to be sure the value given is a date (as parsed by strtotime)

before

Checks to see if the value (a parseable date) is before the date provided (as parsed by strtotime)

after

Checks to see if the value (a parseable date) is after the date provided (as parsed by strtotime)

in

Checks to ensure the value provided is in a set of values

json

Checks to be sure the value is a valid JSON formatted string (using json_decode)

required

Checks to be sure the value exists

ip

Checks to ensure the value provided is a valid IPv4 or IPv6 formatted address

email

Check to ensure the value provided is a validly formatted email address

regex

Check to ensure the value matches a certain regular expression at least once

equals

This check can be used to see if the values of two fields match exactly.

callback

This check can be used to call custom logic via a static class method. For example, if your class is:

Then your rule would look something like this:

And the check method should return a boolean result.


All versions of validation 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 psecio/validation contains the following files

Loading the files please wait ....