当前位置: 首页>>代码示例>>PHP>>正文


PHP getID3::warning方法代码示例

本文整理汇总了PHP中getID3::warning方法的典型用法代码示例。如果您正苦于以下问题:PHP getID3::warning方法的具体用法?PHP getID3::warning怎么用?PHP getID3::warning使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在getID3的用法示例。


在下文中一共展示了getID3::warning方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: warning

 protected function warning($text)
 {
     return $this->getid3->warning($text);
 }
开发者ID:fs-contributor,项目名称:rtMedia,代码行数:4,代码来源:getid3.php

示例2: __construct

 public function __construct(getID3 $getid3, $algorithm)
 {
     $this->getid3 = $getid3;
     // Check algorithm
     if (!preg_match('/^(md5|sha1)$/', $algorithm)) {
         throw new getid3_exception('Unsupported algorithm, "' . $algorithm . '", in GetHashdata()');
     }
     //// Handle ogg vorbis files
     if (@$getid3->info['fileformat'] == 'ogg' && @$getid3->info['audio']['dataformat'] == 'vorbis') {
         // We cannot get an identical md5_data value for Ogg files where the comments
         // span more than 1 Ogg page (compared to the same audio data with smaller
         // comments) using the normal getID3() method of MD5'ing the data between the
         // end of the comments and the end of the file (minus any trailing tags),
         // because the page sequence numbers of the pages that the audio data is on
         // do not match. Under normal circumstances, where comments are smaller than
         // the nominal 4-8kB page size, then this is not a problem, but if there are
         // very large comments, the only way around it is to strip off the comment
         // tags with vorbiscomment and MD5 that file.
         // This procedure must be applied to ALL Ogg files, not just the ones with
         // comments larger than 1 page, because the below method simply MD5's the
         // whole file with the comments stripped, not just the portion after the
         // comments block (which is the standard getID3() method.
         // The above-mentioned problem of comments spanning multiple pages and changing
         // page sequence numbers likely happens for OggSpeex and OggFLAC as well, but
         // currently vorbiscomment only works on OggVorbis files.
         if ((bool) ini_get('safe_mode')) {
             throw new getid3_exception('PHP running in Safe Mode - cannot make system call to vorbiscomment[.exe]  needed for ' . $algorithm . '_data.');
         }
         if (!preg_match('/^Vorbiscomment /', `vorbiscomment --version 2>&1`)) {
             throw new getid3_exception('vorbiscomment[.exe] binary not found in path. UNIX: typically /usr/bin. Windows: typically c:\\windows\\system32.');
         }
         // Prevent user from aborting script
         $old_abort = ignore_user_abort(true);
         // Create empty file
         $empty = tempnam('*', 'getID3');
         touch($empty);
         // Use vorbiscomment to make temp file without comments
         $temp = tempnam('*', 'getID3');
         $command_line = 'vorbiscomment -w -c ' . escapeshellarg($empty) . ' ' . escapeshellarg(realpath($getid3->filename)) . ' ' . escapeshellarg($temp) . ' 2>&1';
         // Error from vorbiscomment
         if ($vorbis_comment_error = `{$command_line}`) {
             throw new getid3_exception('System call to vorbiscomment[.exe] failed.');
         }
         // Get hash of newly created file
         $hash_function = $algorithm . '_file';
         $getid3->info[$algorithm . '_data'] = $hash_function($temp);
         // Clean up
         unlink($empty);
         unlink($temp);
         // Reset abort setting
         ignore_user_abort($old_abort);
         // Return success
         return true;
     }
     //// Handle other file formats
     // Get hash from part of file
     if (@$getid3->info['avdataoffset'] || @$getid3->info['avdataend'] && @$getid3->info['avdataend'] < $getid3->info['filesize']) {
         if ((bool) ini_get('safe_mode')) {
             $getid3->warning('PHP running in Safe Mode - backtick operator not available, using slower non-system-call ' . $algorithm . ' algorithm.');
             $hash_function = 'hash_file_partial_safe_mode';
         } else {
             $hash_function = 'hash_file_partial';
         }
         $getid3->info[$algorithm . '_data'] = $this->{$hash_function}($getid3->filename, $getid3->info['avdataoffset'], $getid3->info['avdataend'], $algorithm);
     } else {
         $hash_function = $algorithm . '_file';
         $getid3->info[$algorithm . '_data'] = $hash_function($getid3->filename);
     }
 }
开发者ID:jwlynch,项目名称:openacs.core,代码行数:69,代码来源:module.lib.data_hash.php


注:本文中的getID3::warning方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。