Lines Matching refs:this

53 		$this->startup_error   = '';
54 $this->startup_warning = '';
58 … $this->startup_error .= 'getID3() requires PHP v4.2.0 or higher - you are running v'.phpversion();
70 …$this->startup_error .= 'PHP has less than 3MB available memory and will very likely run out. Incr…
72 …$this->startup_warning .= 'PHP has less than 12MB available memory and might run out if all module…
77 …$this->warning('WARNING: Safe mode is on, shorten support disabled, md5data/sha1data for ogg vorbi…
102 $this->startup_error .= 'getid3.lib.php is missing or corrupt';
117 …$this->startup_error .= '"'.$helperappsdir.'" cannot be defined as GETID3_HELPERAPPSDIR because it…
130 …$this->startup_error .= 'GETID3_HELPERAPPSDIR must not have any spaces in it - use 8dot3 naming co…
144 if (isset($this, $opt) === false) {
147 $this->$opt = $val;
156 if (!empty($this->startup_error)) {
157 return $this->error($this->startup_error);
159 if (!empty($this->startup_warning)) {
160 $this->warning($this->startup_warning);
164 $this->info = array();
165 $this->info['GETID3_VERSION'] = GETID3_VERSION;
168 …if (!function_exists('iconv') && !in_array($this->encoding, array('ISO-8859-1', 'UTF-8', 'UTF-16LE…
175 return $this->error($errormessage);
183 …return $this->error('Could not disable magic_quotes_runtime - getID3() cannot work properly with t…
189 …return $this->error('Remote files are not supported in this version of getID3() - please copy the …
194 return $this->error('Could not open file "'.$filename.'"');
198 $this->info['filesize'] = filesize($filename);
201 if ($this->option_max_2gb_check) {
206 if ((($this->info['filesize'] != 0) && (ftell($fp) == 0)) ||
207 ($this->info['filesize'] < 0) ||
209 unset($this->info['filesize']);
211 return $this->error('File is most likely larger than 2GB and is not supported by PHP');
216 $this->info['avdataoffset'] = 0;
217 $this->info['avdataend'] = $this->info['filesize'];
218 $this->info['fileformat'] = ''; // filled in later
219 $this->info['audio']['dataformat'] = ''; // filled in later, unset if not used
220 $this->info['video']['dataformat'] = ''; // filled in later, unset if not used
221 $this->info['tags'] = array(); // filled in later, unset if not used
222 $this->info['error'] = array(); // filled in later, unset if not used
223 $this->info['warning'] = array(); // filled in later, unset if not used
224 $this->info['comments'] = array(); // filled in later, unset if not used
225 …$this->info['encoding'] = $this->encoding; // required by id3v2 and iso modules - can…
228 $this->info['filename'] = basename($filename);
229 $this->info['filepath'] = str_replace('\\', '/', realpath(dirname($filename)));
230 $this->info['filenamepath'] = $this->info['filepath'].'/'.$this->info['filename'];
235 if ($this->option_tag_id3v2) {
237 $GETID3_ERRORARRAY = &$this->info['warning'];
239 $tag = new getid3_id3v2($fp, $this->info);
248 $this->info['id3v2']['header'] = true;
249 $this->info['id3v2']['majorversion'] = ord($header{3});
250 $this->info['id3v2']['minorversion'] = ord($header{4});
251 …$this->info['id3v2']['headerlength'] = getid3_lib::BigEndian2Int(substr($header, 6, 4), 1) + 1…
253 $this->info['id3v2']['tag_offset_start'] = 0;
254 …$this->info['id3v2']['tag_offset_end'] = $this->info['id3v2']['tag_offset_start'] + $this->info[…
255 $this->info['avdataoffset'] = $this->info['id3v2']['tag_offset_end'];
262 if ($this->option_tag_id3v1) {
264 return $this->error('module.tag.id3v1.php is missing - you may disable option_tag_id3v1.');
266 $tag = new getid3_id3v1($fp, $this->info);
271 if ($this->option_tag_apetag) {
273 return $this->error('module.tag.apetag.php is missing - you may disable option_tag_apetag.');
275 $tag = new getid3_apetag($fp, $this->info);
280 if ($this->option_tag_lyrics3) {
282 return $this->error('module.tag.lyrics3.php is missing - you may disable option_tag_lyrics3.');
284 $tag = new getid3_lyrics3($fp, $this->info);
289 fseek($fp, $this->info['avdataoffset'], SEEK_SET);
293 $determined_format = $this->GetFileFormat($formattest, $filename);
298 return $this->error('unable to determine file format');
302 …etermined_format['fail_id3']) && (in_array('id3v1', $this->info['tags']) || in_array('id3v2', $thi…
305 return $this->error('ID3 tags not allowed on this file type.');
307 $this->info['warning'][] = 'ID3 tags not allowed on this file type.';
312 if (isset($determined_format['fail_ape']) && in_array('ape', $this->info['tags'])) {
315 return $this->error('APE tags not allowed on this file type.');
317 $this->info['warning'][] = 'APE tags not allowed on this file type.';
322 $this->info['mime_type'] = $determined_format['mime_type'];
327 …return $this->error('Format not supported, module, '.$determined_format['include'].', was removed.…
332 …return $this->error('iconv support is required for this module ('.$determined_format['include'].')…
341 …return $this->error('Format not supported, module, '.$determined_format['include'].', is corrupt.'…
344 $class = new $class_name($fp, $this->info, $determined_format['option']);
346 $class = new $class_name($fp, $this->info);
354 if ($this->option_tags_process) {
355 $this->HandleAllTags();
359 if ($this->option_extra_info) {
360 $this->ChannelsBitratePlaytimeCalculations();
361 $this->CalculateCompressionRatioVideo();
362 $this->CalculateCompressionRatioAudio();
363 $this->CalculateReplayGain();
364 $this->ProcessAudioStreams();
368 if ($this->option_md5_data) {
370 if (!$this->option_md5_data_source || empty($this->info['md5_data_source'])) {
371 $this->getHashdata('md5');
376 if ($this->option_sha1_data) {
377 $this->getHashdata('sha1');
381 $this->CleanUp();
387 return $this->info;
394 $this->CleanUp();
396 $this->info['error'][] = $message;
397 return $this->info;
403 $this->info['warning'][] = $message;
414 if (empty($this->info['audio'][$key]) && isset($this->info['audio'][$key])) {
415 unset($this->info['audio'][$key]);
417 if (empty($this->info['video'][$key]) && isset($this->info['video'][$key])) {
418 unset($this->info['video'][$key]);
423 if (!empty($this->info)) {
424 foreach ($this->info as $key => $value) {
425 if (empty($this->info[$key]) && ($this->info[$key] !== 0) && ($this->info[$key] !== '0')) {
426 unset($this->info[$key]);
432 if (empty($this->info['fileformat'])) {
433 if (isset($this->info['avdataoffset'])) {
434 unset($this->info['avdataoffset']);
436 if (isset($this->info['avdataend'])) {
437 unset($this->info['avdataend']);
945 foreach ($this->GetFileFormatArray() as $format_name => $info) {
959 $GetFileFormatArray = $this->GetFileFormatArray();
973 if ($encoding == $this->encoding) {
982 $this->CharConvert($array[$key], $encoding);
987 $array[$key] = trim(getid3_lib::iconv_fallback($encoding, $this->encoding, $value));
1011 'id3v1' => array('id3v1' , $this->encoding_id3v1),
1022 if (isset($this->info[$comment_name]) && !isset($this->info[$comment_name]['encoding'])) {
1023 $this->info[$comment_name]['encoding'] = $encoding;
1027 if (!empty($this->info[$comment_name]['comments'])) {
1029 foreach ($this->info[$comment_name]['comments'] as $tag_key => $valuearray) {
1032 …$this->info['tags'][trim($tag_name)][trim($tag_key)][] = $value; // do not trim!! Unicode characte…
1037 if (!isset($this->info['tags'][$tag_name])) {
1042 if ($this->option_tags_html) {
1043 foreach ($this->info['tags'][$tag_name] as $tag_key => $valuearray) {
1047 …$this->info['tags_html'][$tag_name][$tag_key][$key] = str_replace('&#0;', '', getid3_lib::MultiByt…
1049 $this->info['tags_html'][$tag_name][$tag_key][$key] = $value;
1055 …$this->CharConvert($this->info['tags'][$tag_name], $encoding); // only copy gets convert…
1070 return $this->error('bad algorithm "'.$algorithm.'" in getHashdata()');
1074 if ((@$this->info['fileformat'] == 'ogg') && (@$this->info['audio']['dataformat'] == 'vorbis')) {
1096 …$this->info['warning'][] = 'Failed making system call to vorbiscomment.exe - '.$algorithm.'_data i…
1097 $this->info[$algorithm.'_data'] = false;
1111 $file = $this->info['filenamepath'];
1136 …$this->info['warning'][] = 'Failed making system call to vorbiscomment(.exe) - '.$algorith…
1137 $this->info[$algorithm.'_data'] = false;
1144 $this->info[$algorithm.'_data'] = getid3_lib::md5_file($temp);
1148 $this->info[$algorithm.'_data'] = getid3_lib::sha1_file($temp);
1164 …if (!empty($this->info['avdataoffset']) || (isset($this->info['avdataend']) && ($this->info['avdat…
1167 …$this->info[$algorithm.'_data'] = getid3_lib::hash_data($this->info['filenamepath'], $this->info['…
1174 $this->info[$algorithm.'_data'] = getid3_lib::md5_file($this->info['filenamepath']);
1178 $this->info[$algorithm.'_data'] = getid3_lib::sha1_file($this->info['filenamepath']);
1191 if (@$this->info['audio']['channels'] == '1') {
1192 $this->info['audio']['channelmode'] = 'mono';
1193 } elseif (@$this->info['audio']['channels'] == '2') {
1194 $this->info['audio']['channelmode'] = 'stereo';
1199 …$CombinedBitrate += (isset($this->info['audio']['bitrate']) ? $this->info['audio']['bitrate'] : 0);
1200 …$CombinedBitrate += (isset($this->info['video']['bitrate']) ? $this->info['video']['bitrate'] : 0);
1201 if (($CombinedBitrate > 0) && empty($this->info['bitrate'])) {
1202 $this->info['bitrate'] = $CombinedBitrate;
1211 …if (isset($this->info['video']['dataformat']) && $this->info['video']['dataformat'] && (!isset($th…
1213 …if (isset($this->info['audio']['bitrate']) && ($this->info['audio']['bitrate'] > 0) && ($this->inf…
1215 if (isset($this->info['playtime_seconds']) && ($this->info['playtime_seconds'] > 0)) {
1217 if (isset($this->info['avdataend']) && isset($this->info['avdataoffset'])) {
1220 …$this->info['bitrate'] = round((($this->info['avdataend'] - $this->info['avdataoffset']) * 8) / $t…
1221 $this->info['video']['bitrate'] = $this->info['bitrate'] - $this->info['audio']['bitrate'];
1227 if (!isset($this->info['playtime_seconds']) && !empty($this->info['bitrate'])) {
1228 …$this->info['playtime_seconds'] = (($this->info['avdataend'] - $this->info['avdataoffset']) * 8) /…
1232 if (!empty($this->info['playtime_seconds']) && empty($this->info['playtime_string'])) {
1233 $this->info['playtime_string'] = getid3_lib::PlaytimeString($this->info['playtime_seconds']);
1239 if (empty($this->info['video'])) {
1242 if (empty($this->info['video']['resolution_x']) || empty($this->info['video']['resolution_y'])) {
1245 if (empty($this->info['video']['bits_per_sample'])) {
1249 switch ($this->info['video']['dataformat']) {
1258 $BitrateCompressed = $this->info['filesize'] * 8;
1262 if (!empty($this->info['video']['frame_rate'])) {
1263 $FrameRate = $this->info['video']['frame_rate'];
1267 if (!empty($this->info['playtime_seconds'])) {
1268 $PlaytimeSeconds = $this->info['playtime_seconds'];
1272 if (!empty($this->info['video']['bitrate'])) {
1273 $BitrateCompressed = $this->info['video']['bitrate'];
1279 …$BitrateUncompressed = $this->info['video']['resolution_x'] * $this->info['video']['resolution_y']…
1281 $this->info['video']['compression_ratio'] = $BitrateCompressed / $BitrateUncompressed;
1287 …if (empty($this->info['audio']['bitrate']) || empty($this->info['audio']['channels']) || empty($th…
1290this->info['audio']['compression_ratio'] = $this->info['audio']['bitrate'] / ($this->info['audio']…
1292 if (!empty($this->info['audio']['streams'])) {
1293 foreach ($this->info['audio']['streams'] as $streamnumber => $streamdata) {
1295 …$this->info['audio']['streams'][$streamnumber]['compression_ratio'] = $streamdata['bitrate'] / ($s…
1304 if (isset($this->info['replay_gain'])) {
1305 $this->info['replay_gain']['reference_volume'] = 89;
1306 if (isset($this->info['replay_gain']['track']['adjustment'])) {
1307 …$this->info['replay_gain']['track']['volume'] = $this->info['replay_gain']['reference_volume'] - $
1309 if (isset($this->info['replay_gain']['album']['adjustment'])) {
1310 …$this->info['replay_gain']['album']['volume'] = $this->info['replay_gain']['reference_volume'] - $
1313 if (isset($this->info['replay_gain']['track']['peak'])) {
1314 …$this->info['replay_gain']['track']['max_noclip_gain'] = 0 - getid3_lib::RGADamplitude2dB($this->i…
1316 if (isset($this->info['replay_gain']['album']['peak'])) {
1317 …$this->info['replay_gain']['album']['max_noclip_gain'] = 0 - getid3_lib::RGADamplitude2dB($this->i…
1324 …if (!empty($this->info['audio']['bitrate']) || !empty($this->info['audio']['channels']) || !empty(…
1325 if (!isset($this->info['audio']['streams'])) {
1326 foreach ($this->info['audio'] as $key => $value) {
1328 $this->info['audio']['streams'][0][$key] = $value;
1337 return tempnam($this->tempdir, 'gI3');