2017 © Pedro Peláez
 

library filtration

Data filtration library

image

siriusphp/filtration

Data filtration library

  • Sunday, November 22, 2015
  • by adrianmiu
  • Repository
  • 2 Watchers
  • 6 Stars
  • 1,476 Installations
  • PHP
  • 5 Dependents
  • 0 Suggesters
  • 0 Forks
  • 1 Open issues
  • 9 Versions
  • 3 % Grown

The README.md

Sirius\Filtration

Source Code Latest Version Software License Build Status Coverage Status Quality Score, (*1)

PHP library for array filtering/sanitization, (*2)

Sometimes you want to make sure the values pushed by a source (eg: a user when submits a form) follow some restrictions like, (*3)

  • no space at the beginning or the end for the title of a page
  • no HTML code in a comment sent by a user
  • no spaces in the field which represents the URL
  • remove XSS attacks
  • etc...

Other times you want to make sure that the data you send to the user is parsed before displaying. For example you may want to:, (*4)

  • convert markdown into HTML
  • convert URLs into links
  • apply a localized format to dates
  • etc ()

To achieve this end result you need to filter the values. This is where SiriusFiltration comes into place, (*5)

Elevator pitch

use Sirius\Filtration\Filtrator;

$filtrator = new Filtrator();

// add filters for title
$filtrator->add('title', 'trim');
$filtrator->add('title', 'strip_tags');
$filtrator->add('title', 'nullify');

// add filters for content in one go
$filtrator->add('content', [
    'trim'
]);

$result = $filtrator->filter(array(
    'title' => '   

My title has tags and is awesome

', 'content' => ' My content was trimmed' )); /* $result is array( 'title' => NULL , 'content' => 'My content was trimmed' ) */

The Versions

22/11 2015

dev-master

9999999-dev

Data filtration library

  Sources   Download

MIT

The Requires

  • php >=5.4

 

by Adrian Miu

form security input sanitization filtration

15/04 2014

1.2.5

1.2.5.0

Data filtration library

  Sources   Download

MIT

The Requires

  • php >=5.4

 

The Development Requires

by Adrian Miu

form input sanitization filtration

12/04 2014

1.2.4

1.2.4.0

Data filtration library

  Sources   Download

MIT

The Requires

  • php >=5.4

 

The Development Requires

by Adrian Miu

form input sanitization filtration

05/04 2014

1.2.3

1.2.3.0

Data filtration library

  Sources   Download

MIT

The Requires

  • php >=5.4

 

The Development Requires

by Adrian Miu

form input sanitization filtration

29/03 2014

1.2.2

1.2.2.0

Data filtration library

  Sources   Download

MIT

The Requires

  • php >=5.4

 

The Development Requires

by Adrian Miu

form input sanitization filtration

29/03 2014

1.2.1

1.2.1.0

Data filtration library

  Sources   Download

MIT

The Requires

  • php >=5.4

 

The Development Requires

by Adrian Miu

form input sanitization filtration

27/03 2014

1.2.0

1.2.0.0

Data filtration library

  Sources   Download

MIT

The Requires

  • php >=5.4

 

The Development Requires

by Adrian Miu

form input sanitization filtration

23/03 2014

1.1.0

1.1.0.0

Data filtration library

  Sources   Download

MIT

The Requires

  • php >=5.4

 

The Development Requires

by Adrian Miu

form input sanitization filtration

22/03 2014

1.0.0

1.0.0.0

Data filtration library

  Sources   Download

MIT

The Requires

  • php >=5.4

 

The Development Requires

by Adrian Miu

form validation