You are here

function audiofield_accessible_ffprobe in AudioField 7

Accessible command line tool: ffprobe.

3 calls to audiofield_accessible_ffprobe()
audiofield_admin_settings_form in ./audiofield.admin.inc
Settings form for administering module.
audiofield_admin_settings_form_validate in ./audiofield.admin.inc
Implements hook_validate().
audiofield_field_formatter_settings_form in ./audio.field.inc
Implements hook_field_formatter_settings_form().

File

./audiofield.module, line 46
Audio Field module for displaying audio files as usable players.

Code

function audiofield_accessible_ffprobe($path = '') {
  if (!$path) {
    $audiofield_detail = variable_get('audiofield_detail');
    if (isset($audiofield_detail['ffprobe_path'])) {
      $path = $audiofield_detail['ffprobe_path'];
    }
  }
  $arg = array(
    'which',
    ' ',
    $path,
    'ffprobe',
  );
  if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
    $arg[3] = 'ffprobe.exe';
  }
  $command = implode('', $arg);
  exec($command, $output, $result);
  if ($result == 0 && count($output) == 1) {
    return TRUE;
  }
  return FALSE;
}