added support for retrieving progress information via helpers
This commit is contained in:
parent
c40348a007
commit
36b0036285
10 changed files with 463 additions and 7 deletions
|
|
@ -24,6 +24,8 @@ use Symfony\Component\Process\ProcessBuilder;
|
|||
class FFProbe extends Binary
|
||||
{
|
||||
|
||||
protected $cachedFormats = array();
|
||||
|
||||
/**
|
||||
* Probe the format of a given file
|
||||
*
|
||||
|
|
@ -39,6 +41,10 @@ class FFProbe extends Binary
|
|||
throw new InvalidArgumentException($pathfile);
|
||||
}
|
||||
|
||||
if (isset($this->cachedFormats[$pathfile])) {
|
||||
return $this->cachedFormats[$pathfile];
|
||||
}
|
||||
|
||||
$builder = ProcessBuilder::create(array(
|
||||
$this->binary, $pathfile, '-show_format'
|
||||
));
|
||||
|
|
@ -69,7 +75,7 @@ class FFProbe extends Binary
|
|||
$ret[$key] = $value;
|
||||
}
|
||||
|
||||
return json_encode($ret);
|
||||
return $this->cachedFormats[$pathfile] = json_encode($ret);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue