128 $file = dirname(__FILE__) .
'/' . basename(__FILE__,
'php') .
'sqlite';
130 $file = dirname(__FILE__) .
'/.ht.' . basename(__FILE__,
'php') .
'sqlite';
132 $this->db =
new SQLite3(
$file);
136 $sql = $this->version_check;
137 $stmt =
$db->prepare($sql);
145 return parent::__construct();
165 $sql = $this->delete_cache;
167 $sql = $this->set_version;
168 $stmt =
$db->prepare($sql);
173 return $stmt->execute();
194 $sql = $this->get_id3_data;
195 $stmt =
$db->prepare($sql);
196 $stmt->bindValue(
':filename',
$filename, SQLITE3_TEXT);
197 $stmt->bindValue(
':filesize', $filesize, SQLITE3_INTEGER);
198 $stmt->bindValue(
':filetime', $filetime, SQLITE3_INTEGER);
199 $res = $stmt->execute();
202 return unserialize(base64_decode(
$result));
207 $sql = $this->cache_file;
208 $stmt =
$db->prepare($sql);
209 $stmt->bindValue(
':filename',
$filename, SQLITE3_TEXT);
210 $stmt->bindValue(
':dirname', $dirname, SQLITE3_TEXT);
211 $stmt->bindValue(
':filesize', $filesize, SQLITE3_INTEGER);
212 $stmt->bindValue(
':filetime', $filetime, SQLITE3_INTEGER);
213 $stmt->bindValue(
':atime',
time(), SQLITE3_INTEGER);
214 $stmt->bindValue(
':val', base64_encode(serialize($analysis)),
216 $res = $stmt->execute();
229 $sql = $this->make_table;
231 return $db->exec($sql);
248 $sql = $this->get_cached_dir;
249 $stmt =
$db->prepare($sql);
250 $stmt->bindValue(
':dirname', $dir, SQLITE3_TEXT);
251 $res = $stmt->execute();
253 $rows[] = unserialize(base64_decode(
$row));
267 case 'version_check':
268 return "SELECT val FROM $this->table WHERE filename = :filename AND filesize = '-1' AND filetime = '-1' AND analyzetime = '-1'";
271 return "DELETE FROM $this->table";
274 return "INSERT INTO $this->table (filename, dirname, filesize, filetime, analyzetime, val) VALUES (:filename, :dirname, -1, -1, -1, :val)";
277 return "SELECT val FROM $this->table WHERE filename = :filename AND filesize = :filesize AND filetime = :filetime";
280 return "INSERT INTO $this->table (filename, dirname, filesize, filetime, analyzetime, val) VALUES (:filename, :dirname, :filesize, :filetime, :atime, :val)";
283 return "CREATE TABLE IF NOT EXISTS $this->table (filename VARCHAR(255) NOT NULL DEFAULT '', dirname VARCHAR(255) NOT NULL DEFAULT '', filesize INT(11) NOT NULL DEFAULT '0', filetime INT(11) NOT NULL DEFAULT '0', analyzetime INT(11) NOT NULL DEFAULT '0', val text not null, PRIMARY KEY (filename, filesize, filetime))";
285 case 'get_cached_dir':
286 return "SELECT val FROM $this->table WHERE dirname = :dirname";
__destruct()
close the database connection
__construct($table='getid3_cache', $hide=false)
__construct()
clear_cache()
clear the cache private
__get($name)
use the magical __get() for sql queries
create_table()
create data base table this is almost the same as MySQL, with the exception of the dirname being adde...
analyze($filename)
analyze file and cache them, if cached pull from the db
get_cached_dir($dir)
get cached directory
GetId3() by James Heinrich info@getid3.org //.
Create styles array
The data for the language used.
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
$table
table to use for caching