Exemplo n.º 1
0
 protected function _cleanUser($user)
 {
     $r = $this->_db->exec('DELETE FROM syncml_data WHERE syncml_uid = ' . $this->_db->quote($user, 'text'));
     $this->_checkForError($r);
     $r = $this->_db->exec('DELETE FROM syncml_map WHERE syncml_uid = ' . $this->_db->quote($user, 'text'));
     $this->_checkForError($r);
     $r = $this->_db->exec('DELETE FROM syncml_anchors WHERE syncml_uid = ' . $this->_db->quote($user, 'text'));
     $this->_checkForError($r);
     $r = $this->_db->exec('DELETE FROM syncml_uids WHERE syncml_uid = ' . $this->_db->quote($user, 'text'));
     $this->_checkForError($r);
     $r = $this->_db->exec('DELETE FROM syncml_suidlist WHERE syncml_uid = ' . $this->_db->quote($user, 'text'));
     $this->_checkForError($r);
 }
Exemplo n.º 2
0
 /**
  * (non-PHPdoc)
  * @see debugObject::msg()
  * @throws exceptions
  */
 public function msg($msg, $level = DEBUG_INFO)
 {
     $msg = filter_var(trim($msg), FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_LOW);
     if (!empty($msg) && $_level & $level) {
         $t = microtime(true);
         $micro = round(($t - floor($t)) * 1000000);
         $d = new DateTime(date('Y-m-d H:i:s.' . $micro, $t));
         $results = $this->_mdb2->exec('INSERT INTO ' . $this->_table . '
         (level, message, time)
         VALUES (' . $this->_mdb2->quote($level, 'integer') . ', ' . $this->_mdb2->quote($msg, 'text') . ', ' . $this->_mdb2->quote($d->format('Y-m-d H:i:s.u'), 'text') . ')');
         // error date with microtime ex. 2010-02-14 14:52:05.611046
         if (PEAR::isError($results)) {
             throw new exceptions($results->getMessage(), $results->getCode());
         }
     }
 }