Example #1
0
 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();
 }
Example #2
0
 function __construct()
 {
     parent::__construct(PATH_DATABASES . 'site.php');
     // Set timezone
     $this->setTimezone($this->timezone());
     // Set locale
     $this->setLocale($this->locale());
 }
Example #3
0
 public function count()
 {
     $count = parent::count();
     // DEBUG: Less than - 1 because the error page.
     return $count - 1;
 }
Example #4
0
 function __construct()
 {
     parent::__construct(PATH_DATABASES . 'posts.php');
     $this->numberPosts['total'] = count($this->db);
 }
Example #5
0
 function __construct()
 {
     parent::__construct(PATH_DATABASES . 'users.php');
 }
Example #6
0
 function __construct()
 {
     parent::__construct(PATH_DATABASES . 'security.php');
 }
Example #7
0
 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();
 }