Flatterizor is a PHP library developed in order to issue a very specific problem.
Sometimes you have a complex object and you need to store it into your database. Most cases the serialize function does work. Unfortunately sometimes it does not ( not because serialize is broken/bugged ).
The Library is useful only if the followings are true:
- You want to store your object inside a database
- Your object is not “Flat” ( meaning you’ve at least a value in your object that is an array or an object itself )
- You want to use your Database SQL to Search & filter objects with a particular value.
The last sentence is actually the most appealing. Lets take, for example, the following objects:
<?php $bob = new stdClass(); $bob->name = 'Bob'; $bob->permissions = array( ); $bob->permissions['can_write'] = true; $bob->permissions['can_read'] = true;
$mat = new stdClass(); $mat->name = 'Mat'; $mat->permissions = array( ); $mat->permissions['can_write'] = false; $mat->permissions['can_read'] = true;![terminale-password[1]](http://www.andreabaccega.com/blog/files/2012/04/terminale-password1.png)
If you’re a web developer you confronted by this at least once. If you don’t own a development webserver you’ll need to make your developments in the production webserver. This means that everyone could see your work-in-progress easily.![xss[1]](http://www.andreabaccega.com/blog/files/2012/03/xss1.png)