| @@ 148-162 (lines=15) @@ | ||
| 145 | * |
|
| 146 | * @param int $timeStamp the unix timestamp before which to remove all log entries |
|
| 147 | */ |
|
| 148 | public function housekeeping($timeStamp) |
|
| 149 | { |
|
| 150 | $stmt = $this->db->prepare( |
|
| 151 | sprintf( |
|
| 152 | 'DELETE FROM %s |
|
| 153 | WHERE disconnect_time_unix < :time_stamp', |
|
| 154 | $this->prefix.'connections' |
|
| 155 | ) |
|
| 156 | ); |
|
| 157 | ||
| 158 | $stmt->bindValue(':time_stamp', $timeStamp, PDO::PARAM_INT); |
|
| 159 | $stmt->execute(); |
|
| 160 | ||
| 161 | return $stmt->rowCount(); |
|
| 162 | } |
|
| 163 | ||
| 164 | public function initDatabase() |
|
| 165 | { |
|
| @@ 56-68 (lines=13) @@ | ||
| 53 | return true; |
|
| 54 | } |
|
| 55 | ||
| 56 | public function housekeeping($timeUnix) |
|
| 57 | { |
|
| 58 | $stmt = $this->db->prepare( |
|
| 59 | sprintf( |
|
| 60 | 'DELETE FROM %s |
|
| 61 | WHERE time_unix < :time_unix', |
|
| 62 | $this->prefix.'otp_log' |
|
| 63 | ) |
|
| 64 | ); |
|
| 65 | ||
| 66 | $stmt->bindValue(':time_unix', $timeUnix, PDO::PARAM_INT); |
|
| 67 | $stmt->execute(); |
|
| 68 | } |
|
| 69 | ||
| 70 | public static function createTableQueries($prefix) |
|
| 71 | { |
|