1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
<?php
if (!defined('ABSPATH')) exit; if (!class_exists('BVLogger')) : class BVLogger { public $db; public $table; const MAXROWCOUNT = 100000;
function __construct($db, $table) { $this->db = $db; $this->table = $table; }
public function log($data) { if (is_array($data)) { $tablename = $this->db->getBVTable($this->table); if ($this->db->rowsCount($tablename) > BVLogger::MAXROWCOUNT) $this->db->deleteRowsFromtable($this->table, 1); $this->db->replaceIntoBVTable($this->table, $data); } } } endif;
|