Пример #1
0
 public function __construct($filename)
 {
     if (ini_get('safe_mode')) {
         throw new getid3_exception('PHP running in Safe Mode (backtick operator not available). Cannot call vorbiscomment binary.');
     }
     static $initialized;
     if (!$initialized) {
         // check existance and version of vorbiscomment
         if (!ereg('^Vorbiscomment ([0-9]+\\.[0-9]+\\.[0-9]+)', `vorbiscomment --version 2>&1`, $r)) {
             throw new getid3_exception('Fatal: vorbiscomment binary not available.');
         }
         if (strnatcmp($r[1], '1.0.0') == -1) {
             throw new getid3_exception('Fatal: vorbiscomment version 1.0.0 or newer is required, available version: ' . $r[1] . '.');
         }
         $initialized = true;
     }
     parent::__construct($filename);
 }
Пример #2
0
 public function __construct($filename)
 {
     if (preg_match('#(1|ON)#i', ini_get('safe_mode'))) {
         throw new getid3_exception('PHP running in Safe Mode (backtick operator not available). Cannot call metaflac binary.');
     }
     static $initialized;
     if (!$initialized) {
         // check existance and version of metaflac
         if (!preg_match('#^metaflac ([0-9]+\\.[0-9]+\\.[0-9]+)#i', `metaflac --version`, $r)) {
             throw new getid3_exception('Fatal: metaflac binary not available.');
         }
         if (strnatcmp($r[1], '1.1.1') == -1) {
             throw new getid3_exception('Fatal: metaflac version 1.1.1 or newer is required, available version: ' . $r[1] . '.');
         }
         $initialized = true;
     }
     parent::__construct($filename);
 }