CJT3
CJT3

Reputation: 2908

Reading album art using php-reader (zend)

I have been trying to use the Zend Id3v2 class (php-reader) to get the album artwork (apic) from an MP3, but it doesn't seem to want to work properly. Is there a different php-reader library available that has been proven to work?

Also, for some reason all of the require_once calls in the function are set to 'Zend/...' and not to an absolute path like require_once $_SERVER['DOCUMENT_ROOT'].'/Zend...', which breaks them because they are trying to get to a subfolder called 'Zend' in the current directory which is a sub directory of Zend. I also can't use Finder & Replace to set it to an absolute path without going through each file manually, as the files in this class are locked. SMH FACEPALM

Upvotes: 0

Views: 187

Answers (1)

Rob Allen
Rob Allen

Reputation: 12778

Zend Framework 1 is written with the assumption that the folder where your Zend is stored is on the include_path.

e.g.

define('LIBRARY_PATH', __DIR__ . '/../library');

set_include_path(implode(PATH_SEPARATOR, array(
    realpath(LIBRARY_PATH),
    get_include_path(),
)));

This assumes that you're running this code in a sibling folder to library and that your Zend Framework files are in library/Zend

Upvotes: 1

Related Questions