public function setDb($array) { $tmp = array(); // All fields will be sanitize before save. foreach ($array as $key => $value) { $tmp[$key] = Sanitize::html($value); } $this->db = $tmp; // Save db on file $Tmp = new dbJSON($this->filenameDb); $Tmp->db = $tmp; $Tmp->save(); }
function __construct() { parent::__construct(PATH_DATABASES . 'site.php'); // Set timezone $this->setTimezone($this->timezone()); // Set locale $this->setLocale($this->locale()); }
public function count() { $count = parent::count(); // DEBUG: Less than - 1 because the error page. return $count - 1; }
function __construct() { parent::__construct(PATH_DATABASES . 'posts.php'); $this->numberPosts['total'] = count($this->db); }
function __construct() { parent::__construct(PATH_DATABASES . 'users.php'); }
function __construct() { parent::__construct(PATH_DATABASES . 'security.php'); }
public function setDb($args) { $tmp = array(); foreach ($this->dbFields as $key => $value) { if (isset($args[$key])) { // Sanitize value $tmpValue = Sanitize::html($args[$key]); // Set type settype($tmpValue, gettype($value)); // Set value $tmp[$key] = $tmpValue; } else { $tmp[$key] = false; } } $this->db = $tmp; // Save db on file $Tmp = new dbJSON($this->filenameDb); $Tmp->db = $tmp; $Tmp->save(); }