| 1 |
<?php |
| 2 |
if (!defined('ABSPATH') && !defined('MCDATAPATH')) exit; |
| 3 |
|
| 4 |
if (!class_exists('WPRProtectLogger_V648')) : |
| 5 |
require_once dirname( __FILE__ ) . '/logger/fs.php'; |
| 6 |
require_once dirname( __FILE__ ) . '/logger/db.php'; |
| 7 |
|
| 8 |
class WPRProtectLogger_V648 { |
| 9 |
private $log_destination; |
| 10 |
|
| 11 |
const TYPE_FS = 0; |
| 12 |
const TYPE_DB = 1; |
| 13 |
|
| 14 |
function __construct($name, $type = WPRProtectLogger_V648::TYPE_DB) { |
| 15 |
if ($type == WPRProtectLogger_V648::TYPE_FS) { |
| 16 |
$this->log_destination = new WPRProtectLoggerFS_V648($name); |
| 17 |
} else { |
| 18 |
$this->log_destination = new WPRProtectLoggerDB_V648($name); |
| 19 |
} |
| 20 |
} |
| 21 |
|
| 22 |
public function log($data) { |
| 23 |
$this->log_destination->log($data); |
| 24 |
} |
| 25 |
} |
| 26 |
endif; |