Sugestion for: Get base path of getID3() - ONCE

Locked
WaldoMonster
getID3() contributor
Posts:112
Joined:Mon Apr 01, 2002 12:20 am
Location:Netherlands
Contact:
Sugestion for: Get base path of getID3() - ONCE

Post by WaldoMonster » Thu Jan 20, 2005 1:19 pm

Current code getID3() 1.7.2:
[php]// Get base path of getID3() - ONCE
if (!defined('GETID3_INCLUDEPATH')) {
define('GETID3_OS_DIRSLASH', (GETID3_OS_ISWINDOWS ? '\\' : '/'));

foreach (get_included_files() as $key => $val) {
if (basename($val) == 'getid3.php') {
define('GETID3_INCLUDEPATH', dirname($val).GETID3_OS_DIRSLASH);
break;
}
}
}[/php]

Alternative:
[php]// Get base path of getID3() - ONCE
if (!defined('GETID3_INCLUDEPATH')) {
define('GETID3_OS_DIRSLASH', (GETID3_OS_ISWINDOWS ? '\\' : '/'));
define('GETID3_INCLUDEPATH', dirname(__FILE__).GETID3_OS_DIRSLASH);
}[/php]

Allan Hansen
getID3() v2 developer
Posts:445
Joined:Sun May 04, 2003 2:22 pm
Location:Holmegaard, Denmark

Post by Allan Hansen » Thu Jan 20, 2005 6:54 pm

Something similar was implemented in 2.0.0b1

Locked