TryAgain
, (*1)
TryAgain is a very light PHP library which permits to call a function again
when the result is not satisfying., (*2)
The main advantage is that it permits to avoid code duplication by creating reusable validators., (*3)
Server Requirements
Installation
TryAgain may be installed using Composer.
You can read more about Composer and its main repository at
http://packagist.org. To install
TryAgain using Composer, first install Composer for your project using the instructions on the
Packagist home page. You can then define your development dependency on TryAgain using the
suggested parameters below., (*4)
{
"require": {
"villfa/TryAgain": ">=1.0.0"
}
}
To install, you then may call:, (*5)
$ composer.phar install
Tests
To run the test suite, you need composer and
PHPUnit., (*6)
$ cd path/to/TryAgain
$ composer.phar install --dev
$ ./vendor/bin/phpunit
Example
Here a minimalist example:, (*7)
``` php
<?php, (*8)
require 'vendor/autoload.php';, (*9)
$handler = new \TryAgain\Handler;
$handler->execute('printf', 'Hello world');, (*10)
```, (*11)
More detailed examples are available in the examples directory., (*12)