ILIAS
release_5-2 Revision v5.2.25-18-g3f80b828510
|
GetId3() by James Heinrich info@ //. geti d3.or gMore...
Public Member Functions | |
__construct ($table='getid3_cache', $hide=false) | |
__construct() More... | |
__destruct () | |
close the database connection More... | |
analyze ($filename) | |
analyze file and cache them, if cached pull from the db More... | |
get_cached_dir ($dir) | |
get cached directory More... | |
__get ($name) | |
use the magical __get() for sql queries More... | |
Public Member Functions inherited from GetId3\GetId3Core | |
__construct () | |
public: constructor More... | |
version () | |
fread_buffer_size () | |
setOption ($optArray) | |
public: setOption More... | |
openfile ($filename) | |
analyze ($filename) | |
public: analyze file More... | |
GetFileFormatArray () | |
array $format_info More... | |
GetFileFormat (&$filedata, $filename='') | |
CharConvert (&$array, $encoding) | |
HandleAllTags () | |
array $tags More... | |
getHashdata ($algorithm) | |
ChannelsBitratePlaytimeCalculations () | |
CalculateCompressionRatioVideo () | |
CalculateCompressionRatioAudio () | |
CalculateReplayGain () | |
ProcessAudioStreams () | |
GetId3_tempnam () | |
Private Member Functions | |
clear_cache () | |
clear the cache private More... | |
create_table () | |
create data base table this is almost the same as MySQL, with the exception of the dirname being added More... | |
Private Attributes | |
$db | |
$table | |
table to use for caching More... | |
GetId3() by James Heinrich info@ //. geti d3.or g
// // This is a caching extension for GetId3(). It works the exact same way as the GetId3 class, but return cached information much faster
Normal GetId3 usage (example):
require_once 'getid3/getid3.php'; $getID3 = new GetId3; $getID3->encoding = 'UTF-8'; $info1 = $getID3->analyze('file1.flac'); $info2 = $getID3->analyze('file2.wv');
GetId3_cached usage:
require_once 'getid3/getid3.php'; require_once 'getid3/extension.cache.sqlite3.php'; // all parameters are optional, defaults are: $getID3 = new GetId3_cached_sqlite3($table='getid3_cache', $hide=FALSE); $getID3->encoding = 'UTF-8'; $info1 = $getID3->analyze('file1.flac'); $info2 = $getID3->analyze('file2.wv');
Supported Cache Types (this extension)
SQL Databases:
mysql host, database, username, password
sqlite3 table='getid3_cache', hide=false (PHP5)
** database file will be stored in the same directory as this script, ** webserver must have write access to that directory! ** set $hide to TRUE to prefix db file with .ht to pervent access from web client ** this is a default setting in the Apache configuration:
<Files ~ "^\.ht"> Order allow,deny Deny from all Satisfy all </Files>
DBM-Style Databases: (use extension.cache.dbm)
gdbm dbm_filename, lock_filename ndbm dbm_filename, lock_filename db2 dbm_filename, lock_filename db3 dbm_filename, lock_filename db4 dbm_filename, lock_filename (PHP5 required)
PHP must have write access to both dbm_filename and lock_filename.
Recommended Cache Types
Infrequent updates, many reads any DBM Frequent updates mysql
IMHO this is still a bit slow, I'm using this with MP4/MOV/ M4v files there is a plan to add directory scanning and analyzing to make things work much faster
Definition at line 106 of file Sqlite3.php.
GetId3\Extension\Cache\Sqlite3::__construct | ( | $table = 'getid3_cache' , |
|
$hide = false |
|||
) |
string | $table | holds name of sqlite table |
Definition at line 125 of file Sqlite3.php.
References GetId3\Extension\Cache\Sqlite3\$db, $file, $result, GetId3\Extension\Cache\Sqlite3\$table, $version, GetId3\Extension\Cache\Sqlite3\clear_cache(), GetId3\Extension\Cache\Sqlite3\create_table(), and GetId3\GetId3Core\VERSION.
GetId3\Extension\Cache\Sqlite3::__destruct | ( | ) |
close the database connection
Definition at line 151 of file Sqlite3.php.
References GetId3\Extension\Cache\Sqlite3\$db.
GetId3\Extension\Cache\Sqlite3::__get | ( | $name | ) |
use the magical __get() for sql queries
access as easy as $this->{case name}, returns NULL if query is not found
Definition at line 264 of file Sqlite3.php.
GetId3\Extension\Cache\Sqlite3::analyze | ( | $filename | ) |
analyze file and cache them, if cached pull from the db
type | $filename |
Definition at line 181 of file Sqlite3.php.
References GetId3\Extension\Cache\Sqlite3\$db, GetId3\GetId3Core\$filename, $res, $result, and time.
|
private |
clear the cache private
Definition at line 162 of file Sqlite3.php.
References GetId3\Extension\Cache\Sqlite3\$db, and GetId3\GetId3Core\VERSION.
Referenced by GetId3\Extension\Cache\Sqlite3\__construct().
|
private |
create data base table this is almost the same as MySQL, with the exception of the dirname being added
Definition at line 226 of file Sqlite3.php.
References GetId3\Extension\Cache\Sqlite3\$db.
Referenced by GetId3\Extension\Cache\Sqlite3\__construct().
GetId3\Extension\Cache\Sqlite3::get_cached_dir | ( | $dir | ) |
get cached directory
This function is not in the MySQL extention, it's ment to speed up requesting multiple files which is ideal for podcasting, playlists, etc.
public
string | $dir | directory to search the cache database for |
Definition at line 244 of file Sqlite3.php.
References GetId3\Extension\Cache\Sqlite3\$db, $res, $row, and array.
|
private |
Definition at line 112 of file Sqlite3.php.
Referenced by GetId3\Extension\Cache\Sqlite3\__construct(), GetId3\Extension\Cache\Sqlite3\__destruct(), GetId3\Extension\Cache\Sqlite3\analyze(), GetId3\Extension\Cache\Sqlite3\clear_cache(), GetId3\Extension\Cache\Sqlite3\create_table(), and GetId3\Extension\Cache\Sqlite3\get_cached_dir().
|
private |
table to use for caching
Definition at line 118 of file Sqlite3.php.
Referenced by GetId3\Extension\Cache\Sqlite3\__construct().