| @@ 163-177 (lines=15) @@ | ||
| 160 | * |
|
| 161 | * @param int $timeStamp the unix timestamp before which to remove all log entries |
|
| 162 | */ |
|
| 163 | public function housekeeping($timeStamp) |
|
| 164 | { |
|
| 165 | $stmt = $this->db->prepare( |
|
| 166 | sprintf( |
|
| 167 | 'DELETE FROM %s |
|
| 168 | WHERE disconnect_time_unix < :time_stamp', |
|
| 169 | $this->prefix.'connections' |
|
| 170 | ) |
|
| 171 | ); |
|
| 172 | ||
| 173 | $stmt->bindValue(':time_stamp', $timeStamp, PDO::PARAM_INT); |
|
| 174 | $stmt->execute(); |
|
| 175 | ||
| 176 | return $stmt->rowCount(); |
|
| 177 | } |
|
| 178 | ||
| 179 | public function initDatabase() |
|
| 180 | { |
|
| @@ 71-83 (lines=13) @@ | ||
| 68 | return true; |
|
| 69 | } |
|
| 70 | ||
| 71 | public function housekeeping($timeUnix) |
|
| 72 | { |
|
| 73 | $stmt = $this->db->prepare( |
|
| 74 | sprintf( |
|
| 75 | 'DELETE FROM %s |
|
| 76 | WHERE time_unix < :time_unix', |
|
| 77 | $this->prefix.'otp_log' |
|
| 78 | ) |
|
| 79 | ); |
|
| 80 | ||
| 81 | $stmt->bindValue(':time_unix', $timeUnix, PDO::PARAM_INT); |
|
| 82 | $stmt->execute(); |
|
| 83 | } |
|
| 84 | ||
| 85 | public static function createTableQueries($prefix) |
|
| 86 | { |
|