ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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

 __construct ()
 
 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 18 of file write.lyrics3.php.

Constructor & Destructor Documentation

◆ __construct()

getid3_write_lyrics3::__construct ( )

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

26  {
27  return true;
28  }

Member Function Documentation

◆ DeleteLyrics3()

getid3_write_lyrics3::DeleteLyrics3 ( )

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

References getID3\analyze().

34  {
35  // Initialize getID3 engine
36  $getID3 = new getID3;
37  $ThisFileInfo = $getID3->analyze($this->filename);
38  if (isset($ThisFileInfo['lyrics3']['tag_offset_start']) && isset($ThisFileInfo['lyrics3']['tag_offset_end'])) {
39  if (is_readable($this->filename) && is_writable($this->filename) && is_file($this->filename) && ($fp = fopen($this->filename, 'a+b'))) {
40 
41  flock($fp, LOCK_EX);
42  $oldignoreuserabort = ignore_user_abort(true);
43 
44  fseek($fp, $ThisFileInfo['lyrics3']['tag_offset_end']);
45  $DataAfterLyrics3 = '';
46  if ($ThisFileInfo['filesize'] > $ThisFileInfo['lyrics3']['tag_offset_end']) {
47  $DataAfterLyrics3 = fread($fp, $ThisFileInfo['filesize'] - $ThisFileInfo['lyrics3']['tag_offset_end']);
48  }
49 
50  ftruncate($fp, $ThisFileInfo['lyrics3']['tag_offset_start']);
51 
52  if (!empty($DataAfterLyrics3)) {
53  fseek($fp, $ThisFileInfo['lyrics3']['tag_offset_start']);
54  fwrite($fp, $DataAfterLyrics3, strlen($DataAfterLyrics3));
55  }
56 
57  flock($fp, LOCK_UN);
58  fclose($fp);
59  ignore_user_abort($oldignoreuserabort);
60 
61  return true;
62 
63  } else {
64  $this->errors[] = 'Cannot fopen('.$this->filename.', "a+b")';
65  return false;
66  }
67  }
68  // no Lyrics3 present
69  return true;
70  }
analyze($filename, $filesize=null, $original_filename='')
Definition: getid3.php:357
+ Here is the call graph for this function:

◆ WriteLyrics3()

getid3_write_lyrics3::WriteLyrics3 ( )

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

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

Field Documentation

◆ $errors

getid3_write_lyrics3::$errors = array()

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

◆ $filename

getid3_write_lyrics3::$filename

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

◆ $tag_data

getid3_write_lyrics3::$tag_data

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

◆ $warnings

getid3_write_lyrics3::$warnings = array()

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


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