101 $file = dirname(__FILE__).
'/'.basename(__FILE__,
'php').
'sqlite';
103 $file = dirname(__FILE__).
'/.ht.'.basename(__FILE__,
'php').
'sqlite';
105 $this->db =
new SQLite3($file);
109 $sql = $this->version_check;
117 return parent::__construct();
147 $sql = $this->delete_cache;
149 $sql = $this->set_version;
154 return $stmt->execute();
174 $sql = $this->get_id3_data;
177 $stmt->bindValue(
':filesize', $filesize_real, SQLITE3_INTEGER);
178 $stmt->bindValue(
':filetime', $filetime, SQLITE3_INTEGER);
182 return unserialize(base64_decode(
$result));
185 $analysis = parent::analyze(
$filename, $filesize, $original_filename);
187 $sql = $this->cache_file;
190 $stmt->bindValue(
':dirname', $dirname, SQLITE3_TEXT);
191 $stmt->bindValue(
':filesize', $filesize_real, SQLITE3_INTEGER);
192 $stmt->bindValue(
':filetime', $filetime, SQLITE3_INTEGER);
193 $stmt->bindValue(
':atime', time(), SQLITE3_INTEGER);
194 $stmt->bindValue(
':val', base64_encode(serialize($analysis)), SQLITE3_TEXT);
206 $sql = $this->make_table;
207 return $db->exec($sql);
223 $sql = $this->get_cached_dir;
225 $stmt->bindValue(
':dirname', $dir, SQLITE3_TEXT);
228 $rows[] = unserialize(base64_decode(
$row));
240 case 'version_check':
241 return "SELECT val FROM $this->table WHERE filename = :filename AND filesize = '-1' AND filetime = '-1' AND analyzetime = '-1'";
244 return "DELETE FROM $this->table";
247 return "INSERT INTO $this->table (filename, dirname, filesize, filetime, analyzetime, val) VALUES (:filename, :dirname, -1, -1, -1, :val)";
250 return "SELECT val FROM $this->table WHERE filename = :filename AND filesize = :filesize AND filetime = :filetime";
253 return "INSERT INTO $this->table (filename, dirname, filesize, filetime, analyzetime, val) VALUES (:filename, :dirname, :filesize, :filetime, :atime, :val)";
257 return "CREATE TABLE IF NOT EXISTS $this->table (filename VARCHAR(255) DEFAULT '', dirname VARCHAR(255) DEFAULT '', filesize INT(11) DEFAULT '0', filetime INT(11) DEFAULT '0', analyzetime INT(11) DEFAULT '0', val text, PRIMARY KEY (filename, filesize, filetime))";
259 case 'get_cached_dir':
260 return "SELECT val FROM $this->table WHERE dirname = :dirname";
$table
table to use for caching
__get($name)
use the magical __get() for sql queries
get_cached_dir($dir)
get cached directory
foreach($_POST as $key=> $value) $res
__construct($table='getid3_cache', $hide=false)
__construct()
create_table()
create data base table this is almost the same as MySQL, with the exception of the dirname being adde...
clear_cache()
clear the cache private
getID3() by James Heinrich info@getid3.org //
__destruct()
close the database connection
analyze($filename, $filesize=null, $original_filename='')
analyze file and cache them, if cached pull from the db