mirror of
https://github.com/xivapi/ffxiv-datamining.git
synced 2026-07-25 03:19:10 +00:00
Libra info
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Libra Database
|
||||
*
|
||||
* @version 1.0
|
||||
* @author Josh Freeman <josh@viion.co.uk>
|
||||
*/
|
||||
|
||||
use \PDO;
|
||||
|
||||
class LiteDatabase
|
||||
{
|
||||
protected $connection;
|
||||
|
||||
function __construct($sqlite)
|
||||
{
|
||||
if (!file_exists($sqlite)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// create connection
|
||||
$this->connection = new PDO('sqlite:'. $sqlite);
|
||||
if (!$this->connection) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private function track($type)
|
||||
{
|
||||
global $tracking;
|
||||
$tracking->update($type);
|
||||
}
|
||||
|
||||
public function sql($sql)
|
||||
{
|
||||
if (!$this->connection) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$query = $this->connection->prepare($sql);
|
||||
$query->execute();
|
||||
return $query->fetchAll();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user