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