<?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 //
/////////////////////////////////////////////////////////////////
// //
// module.tag.apetag.php //
class getid3_apetag extends getid3_handler
{
- public $inline_attachments = true; // true: return full data for all attachments; false: return no data for all attachments; integer: return data for attachments <= than this; string: save as file to this directory
+ /**
+ * true: return full data for all attachments;
+ * false: return no data for all attachments;
+ * integer: return data for attachments <= than this;
+ * string: save as file to this directory.
+ *
+ * @var int|bool|string
+ */
+ public $inline_attachments = true;
+
public $overrideendoffset = 0;
+ /**
+ * @return bool
+ */
public function Analyze() {
$info = &$this->getid3->info;
}
} elseif (is_string($this->inline_attachments)) {
$this->inline_attachments = rtrim(str_replace(array('/', '\\'), DIRECTORY_SEPARATOR, $this->inline_attachments), DIRECTORY_SEPARATOR);
- if (!is_dir($this->inline_attachments) || !is_writable($this->inline_attachments)) {
+ if (!is_dir($this->inline_attachments) || !getID3::is_writable($this->inline_attachments)) {
// cannot write, skip
$this->warning('attachment at '.$thisfile_ape_items_current['offset'].' cannot be saved to "'.$this->inline_attachments.'" (not writable)');
unset($thisfile_ape_items_current['data']);
// if we get this far, must be OK
if (is_string($this->inline_attachments)) {
$destination_filename = $this->inline_attachments.DIRECTORY_SEPARATOR.md5($info['filenamepath']).'_'.$thisfile_ape_items_current['data_offset'];
- if (!file_exists($destination_filename) || is_writable($destination_filename)) {
+ if (!file_exists($destination_filename) || getID3::is_writable($destination_filename)) {
file_put_contents($destination_filename, $thisfile_ape_items_current['data']);
} else {
$this->warning('attachment at '.$thisfile_ape_items_current['offset'].' cannot be saved to "'.$destination_filename.'" (not writable)');
return true;
}
+ /**
+ * @param string $APEheaderFooterData
+ *
+ * @return array|false
+ */
public function parseAPEheaderFooter($APEheaderFooterData) {
// http://www.uni-jena.de/~pfk/mpp/sv8/apeheader.html
return $headerfooterinfo;
}
+ /**
+ * @param int $rawflagint
+ *
+ * @return array
+ */
public function parseAPEtagFlags($rawflagint) {
// "Note: APE Tags 1.0 do not use any of the APE Tag flags.
// All are set to zero on creation and ignored on reading."
return $flags;
}
+ /**
+ * @param int $contenttypeid
+ *
+ * @return string
+ */
public function APEcontentTypeFlagLookup($contenttypeid) {
static $APEcontentTypeFlagLookup = array(
0 => 'utf-8',
return (isset($APEcontentTypeFlagLookup[$contenttypeid]) ? $APEcontentTypeFlagLookup[$contenttypeid] : 'invalid');
}
+ /**
+ * @param string $itemkey
+ *
+ * @return bool
+ */
public function APEtagItemIsUTF8Lookup($itemkey) {
static $APEtagItemIsUTF8Lookup = array(
'title',