10 defined(
'JPATH_PLATFORM') or die;
29 protected $driver =
'mysqli';
35 protected $host =
'127.0.0.1';
41 protected $user =
'root';
47 protected $password =
'';
53 protected $database =
'logging';
59 protected $table =
'jos_';
74 public function __construct(array &$options)
77 parent::__construct($options);
80 if (empty($this->options[
'db_driver']))
86 $this->password = null;
87 $this->database = null;
93 $this->driver = (empty($this->options[
'db_driver'])) ?
'mysqli' : $this->options[
'db_driver'];
94 $this->host = (empty($this->options[
'db_host'])) ?
'127.0.0.1' : $this->options[
'db_host'];
95 $this->user = (empty($this->options[
'db_user'])) ?
'root' : $this->options[
'db_user'];
96 $this->password = (empty($this->options[
'db_pass'])) ?
'' : $this->options[
'db_pass'];
97 $this->database = (empty($this->options[
'db_database'])) ?
'logging' : $this->options[
'db_database'];
98 $this->prefix = (empty($this->options[
'db_prefix'])) ?
'jos_' : $this->options[
'db_prefix'];
102 $this->table = (empty($this->options[
'db_table'])) ?
'#__log_entries' : $this->options[
'db_table'];
117 if (empty($this->db))
123 $entry->date = $entry->date->toSql(
false, $this->db);
125 $this->db->insertObject($this->table, $entry);
136 protected function connect()
140 'driver' => $this->driver,
141 'host' => $this->host,
142 'user' => $this->user,
143 'password' => $this->password,
144 'database' => $this->database,
145 'prefix' => $this->prefix);