[SPIP] v3.2.1-->v3.2.3
[lhc/web/www.git] / www / plugins-dist / medias / lib / getid3 / write.lyrics3.php
index 12275f4..4c5c868 100644 (file)
@@ -1,11 +1,11 @@
 <?php
+
 /////////////////////////////////////////////////////////////////
 /// getID3() by James Heinrich <info@getid3.org>               //
-//  available at http://getid3.sourceforge.net                 //
-//            or http://www.getid3.org                         //
-//          also https://github.com/JamesHeinrich/getID3       //
-/////////////////////////////////////////////////////////////////
-// See readme.txt for more details                             //
+//  available at https://github.com/JamesHeinrich/getID3       //
+//            or https://www.getid3.org                        //
+//            or http://getid3.sourceforge.net                 //
+//  see readme.txt for more details                            //
 /////////////////////////////////////////////////////////////////
 //                                                             //
 // write.lyrics3.php                                           //
 
 class getid3_write_lyrics3
 {
+       /**
+        * @var string
+        */
        public $filename;
+
+       /**
+        * @var array
+        */
        public $tag_data;
        //public $lyrics3_version = 2;       // 1 or 2
-       public $warnings        = array(); // any non-critical errors will be stored here
-       public $errors          = array(); // any critical errors will be stored here
+
+       /**
+        * Any non-critical errors will be stored here.
+        *
+        * @var array
+        */
+       public $warnings        = array();
+
+       /**
+        * Any critical errors will be stored here.
+        *
+        * @var array
+        */
+       public $errors          = array();
 
        public function __construct() {
-               return true;
        }
 
+       /**
+        * @return bool
+        */
        public function WriteLyrics3() {
                $this->errors[] = 'WriteLyrics3() not yet functional - cannot write Lyrics3';
                return false;
        }
+
+       /**
+        * @return bool
+        */
        public function DeleteLyrics3() {
                // 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 (is_readable($this->filename) && is_writable($this->filename) && is_file($this->filename) && ($fp = fopen($this->filename, 'a+b'))) {
+                       if (is_readable($this->filename) && getID3::is_writable($this->filename) && is_file($this->filename) && ($fp = fopen($this->filename, 'a+b'))) {
 
                                flock($fp, LOCK_EX);
                                $oldignoreuserabort = ignore_user_abort(true);