ILIAS  Release_4_1_x_branch Revision 61804
 All Data Structures Namespaces Files Functions Variables Groups Pages
getid3_write_lyrics3 Class Reference

getID3() by James Heinrich info@.nosp@m.geti.nosp@m.d3.or.nosp@m.g // More...

+ Collaboration diagram for getid3_write_lyrics3:

Public Member Functions

 getid3_write_lyrics3 ()
 WriteLyrics3 ()
 DeleteLyrics3 ()

Data Fields

 $filename
 $tag_data
 $warnings = array()
 $errors = array()

Detailed Description

getID3() by James Heinrich info@.nosp@m.geti.nosp@m.d3.or.nosp@m.g //

Definition at line 17 of file write.lyrics3.php.

Member Function Documentation

getid3_write_lyrics3::DeleteLyrics3 ( )

Definition at line 34 of file write.lyrics3.php.

References getID3\analyze().

{
// Initialize getID3 engine
$getID3 = new getID3;
$ThisFileInfo = $getID3->analyze($this->filename);
if (isset($ThisFileInfo['lyrics3']['tag_offset_start']) && isset($ThisFileInfo['lyrics3']['tag_offset_end'])) {
if ($fp = @fopen($this->filename, 'a+b')) {
flock($fp, LOCK_EX);
$oldignoreuserabort = ignore_user_abort(true);
fseek($fp, $ThisFileInfo['lyrics3']['tag_offset_end'], SEEK_SET);
$DataAfterLyrics3 = '';
if ($ThisFileInfo['filesize'] > $ThisFileInfo['lyrics3']['tag_offset_end']) {
$DataAfterLyrics3 = fread($fp, $ThisFileInfo['filesize'] - $ThisFileInfo['lyrics3']['tag_offset_end']);
}
ftruncate($fp, $ThisFileInfo['lyrics3']['tag_offset_start']);
if (!empty($DataAfterLyrics3)) {
fseek($fp, $ThisFileInfo['lyrics3']['tag_offset_start'], SEEK_SET);
fwrite($fp, $DataAfterLyrics3, strlen($DataAfterLyrics3));
}
flock($fp, LOCK_UN);
fclose($fp);
ignore_user_abort($oldignoreuserabort);
return true;
} else {
$this->errors[] = 'Cannot open "'.$this->filename.'" in "a+b" mode';
return false;
}
}
// no Lyrics3 present
return true;
}

+ Here is the call graph for this function:

getid3_write_lyrics3::getid3_write_lyrics3 ( )

Definition at line 25 of file write.lyrics3.php.

{
return true;
}
getid3_write_lyrics3::WriteLyrics3 ( )

Definition at line 29 of file write.lyrics3.php.

{
$this->errors[] = 'WriteLyrics3() not yet functional - cannot write Lyrics3';
return false;
}

Field Documentation

getid3_write_lyrics3::$errors = array()

Definition at line 23 of file write.lyrics3.php.

getid3_write_lyrics3::$filename

Definition at line 19 of file write.lyrics3.php.

getid3_write_lyrics3::$tag_data

Definition at line 20 of file write.lyrics3.php.

getid3_write_lyrics3::$warnings = array()

Definition at line 22 of file write.lyrics3.php.


The documentation for this class was generated from the following file: