diff options
author | Bharat Mediratta <bharat@menalto.com> | 2011-01-10 15:49:15 -0800 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2011-01-10 15:49:15 -0800 |
commit | 23eaec7063b81d4dae04ec3f5c311a0a2f228a05 (patch) | |
tree | 136b478c0f47ceb7947b17b7a52fde80c50cc338 /modules/gallery/helpers/movie.php | |
parent | d557b2a63e2ea424965fb53be9f6b76ad3f18015 (diff) |
Stop using "which" to find binaries. Create system::find_binary()
which traverses the $PATH and returns any executable binary of the
appropriate name that it can find. Fixes #1555.
Diffstat (limited to 'modules/gallery/helpers/movie.php')
-rw-r--r-- | modules/gallery/helpers/movie.php | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/modules/gallery/helpers/movie.php b/modules/gallery/helpers/movie.php index 0895c5f4..dd0b437e 100644 --- a/modules/gallery/helpers/movie.php +++ b/modules/gallery/helpers/movie.php @@ -83,22 +83,18 @@ class movie_Core { } } + /** + * Return the path to the ffmpeg binary if one exists and is executable, or null. + */ static function find_ffmpeg() { if (!($ffmpeg_path = module::get_var("gallery", "ffmpeg_path")) || !file_exists($ffmpeg_path)) { - gallery::set_path_env( - array(module::get_var("gallery", "graphics_toolkit_path"), - getenv("PATH"), - module::get_var("gallery", "extra_binary_paths"))); - if (function_exists("exec")) { - $ffmpeg_path = exec("which ffmpeg"); - } - + $ffmpeg_path = system::find_binary( + "ffmpeg", module::get_var("gallery", "graphics_toolkit_path")); module::set_var("gallery", "ffmpeg_path", $ffmpeg_path); } return $ffmpeg_path; } - /** * Return the width, height, mime_type and extension of the given movie file. */ |