brunnofoggia / databoomer
Utility to keep the data of a object through requests
1.2.0
2018-03-27 15:08 UTC
Requires
- php: >=5.4.0
README
Utility to keep the data of a object through requests
By implementing this into a class, all the content stored into its "data" property will be held through the next requests
usage
Add in your class one of the following codes
// for session storage use \DataBoomer\Session; // for file storage use \DataBoomer\File;
Dont forget to implement serialize and unserialize. An basic example would be
public function __construct() { $this->unserialize(); } public function __destruct() { $this->serialize(); }
Adding content to data
$this->addData('name', 'value'); // name can be split with using '.'
Reading content to data
$this->getData('name');
advanced usage
How to change session uid where data from \DataBoomer\Session will be stored
public function generateUID() { $uid = my_uid_generator(); return $uid; }
How to customize \DataBoomer\File directory
public static function getDir() { return __DIR__ . '/my_tmp_dir/'; }