Download the PHP package kurothing/kurovalidator without Composer

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

KuroValidator

A simple, and easy to use Validation Library for PHP.

Define Rules to check user input automatically based on a simple to use configuration.

Installing

Only composer is directly supported.

or run the command composer require "kurothing/kurovalidator" 0.1.*

Usage

KuroValidator was designed with ease of use in mind, as such it takes 2 Parameters, Input Data and Configuration Data.

The Input Data is simple and easy to understand, just pass your information source. The Configuration Data is slightly more complex, but easy to understand once you get the gist of what is going on. Lets look at a basic example of validating the $_GET.

Most of the code is self-explaining, but lets look over the second parameter of the validate() function.

The top level value, "field" is what we are validating against in the $_GET super global. So if we wanted to validate the id query parameter, then we would replace "field" with "id".

The value of "field" is an array, which defines the rules, the name and allows you to override the canSkip and message values of a rule. We'll look into overriding those later and setting the name later, lets focus on explaining how the rules are defined.

As you can see, the "rules" element is an array containing all the rules we will use. Each rule is defined by "name" => "settings", and rules with no settings do not require any value. Single Setting and Multi-Setting rules are both supported, and shown. With multi-setting rules, they require an associate array, with the key being the name of the setting, and the value being the value of the setting.

Preexisting Rules

Rule Class Name Options Option Names Description
AlphaNumericDashRule alphanumericdash 0 Ensures only A-Z (ci), 0-9, and -/_ is in the string
AlphaNumericRule alphanumeric 0 Ensures only A-Z (ci) and 0-9 is in the string
AlphaRule alpha 0 Ensures only A-Z (ci) is in the string
ArrayRule array 0 Ensures that the value is an Array
BetweenRule between 2 lower, higher Checks to make sure the number is between the provided values
BooleanRule bool 0 Checks to make sure the value is a Boolean. Does not work on strings, which Forms provide by default.
CheckedRule checked 0 Checks to see if the value is "true", "1", "yes", or "on".
DateRule date 0 Checks to see if a value is a valid date.
EmailRule email 0 Checks to see if the email is a valid RFC 822 email address
IpRule ip 0 Ensures the value is an ip
MatchesRule matches 2 field, fieldName Checks to see if the current Field matches Another
MaxRule max 1 max Checks to see if the string is longer than the setting, or if a number is larger.
MinRule min 1 min Checks to see if the string is shorter than the setting, or if a number is smaller.
NumericRule number 0 Ensures that the value is a number.
RegexRule regex 1 pattern Checks the value against the supplied pattern
RequiredRule required 0 Ensures the value is provided.
UrlRule url 0 Ensures the value is a valid RFC 2396 uri.

More Information

I'll provide more examples and documentation (such as creating new rules) at a later date.

Credits

Copyrights

Copyright (c) 2015 [Nikey646] (https://github.com/Nikey646) 2015 [Alex Garrett] (https://github.com/alexgarrett)


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

Loading the files please wait ....