Download the PHP package ej3dev/veritas without Composer

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

ej3dev\Veritas

Latest Stable Version Total Downloads Latest Unstable Version License

A pragmatic and concise validation library written in PHP.

The idea behind Veritas is implement a flexible easy to use validation engine so you can write validation code as easy as you can build questions in everyday language.

Requirements

Veritas requires PHP 5.3 or later.

Installation

Veritas is a one-file-project with zero dependencies available on GitHub and Packagist. You have two options to install it:

Composer

Use Composer dependency Manager for PHP. Add the following to your composer.json and run composer update.

Single file require

Download the project package, find the file Verifier.php and copy it wherever you want in your project working directory. Then use require_one to include the file in your code:

Use

Composer autoload or single file require

Veritas support PSR-4 autoloading via Composer. Import third party code to your context with Composer autoloader:

or use classic file require:

Namespace import

Veritas is namespaced, but you can write less code using a single class into your context:

How validate a variable

You can validate any $var in three simple steps:

Simple example

The Hello World example is something like this:

Chained validation

The available validators can be chained to build complex rules:

Output

All validators and rules returns the Verifier instance to support fluent interface via method chaining. verify() method is used to get the validation final result after apply all chained rules and validators. By default, verify() return true or false but you can change this behavior calling the method with one or two parameters. For example:

Parameters of verify() can be anonymous functions:

Build-in validators

Documentation is work-in-progress. Meanwhile you can take a look to the examples in the file tests/VerifierTest.php

is()

isEmail()

isUrl()

isIp()

isNull()

isNotNull()

isEmpty()

isNotEmpty()

Type validators

Documentation is work-in-progress. Meanwhile you can take a look to the examples in the file tests/VerifierTest.php

boo()

int()

dec()

num()

str()

arr()

obj()

res()

Rules

Documentation is work-in-progress. Meanwhile you can take a look to the examples in the file tests/VerifierTest.php

attr()

contain()

containAny()

date()

eq()

filter()

in()

ineq()

key()

len()

out()

regex()

value()

without()

Prefix not for validators and rules

You can prepend any rule or type validator with prefix "not" to get the logical negation of that rule or type validator:

Changelog

v0.6.0 [master][Fr.23-May-2014]

v0.5.1 [master][Tu.20-May-2014]

v0.5.0 [master][Th.8-May-2014]

License

The MIT License (MIT)

Copyright (c) 2014 Emilio José Jiménez [email protected]

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


All versions of veritas with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.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 ej3dev/veritas contains the following files

Loading the files please wait ....