diff options
author | Bharat Mediratta <bharat@menalto.com> | 2010-09-16 20:43:48 -0700 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2010-09-16 20:43:48 -0700 |
commit | 3e1743b21fd35b9d6d540e827292f1f4f006b531 (patch) | |
tree | 07a7b5fbd34c076fb2c2757eb65330cc51f150b3 /modules/gallery/helpers | |
parent | 64dfccc4eddf204a80ce533bad69ac8c0c83c1bd (diff) |
Add a module variable containing extra paths to search for binaries.
Fixes ticket #1384.
Diffstat (limited to 'modules/gallery/helpers')
-rw-r--r-- | modules/gallery/helpers/gallery_installer.php | 8 | ||||
-rw-r--r-- | modules/gallery/helpers/graphics.php | 3 | ||||
-rw-r--r-- | modules/gallery/helpers/movie.php | 3 |
3 files changed, 11 insertions, 3 deletions
diff --git a/modules/gallery/helpers/gallery_installer.php b/modules/gallery/helpers/gallery_installer.php index 444d307b..83961d6b 100644 --- a/modules/gallery/helpers/gallery_installer.php +++ b/modules/gallery/helpers/gallery_installer.php @@ -307,8 +307,9 @@ class gallery_installer { module::set_var("gallery", "email_line_length", 70); module::set_var("gallery", "email_header_separator", serialize("\n")); module::set_var("gallery", "show_user_profiles_to", "registered_users"); + module::set_var("gallery", "extra_binary_paths", "/usr/local/bin:/opt/local/bin:/opt/bin"); - module::set_version("gallery", 39); + module::set_version("gallery", 40); } static function upgrade($version) { @@ -631,6 +632,11 @@ class gallery_installer { module::set_var("gallery", "show_user_profiles_to", "registered_users"); module::set_version("gallery", $version = 39); } + + if ($version == 39) { + module::set_var("gallery", "extra_binary_paths", "/usr/local/bin:/opt/local/bin:/opt/bin"); + module::set_version("gallery", $version = 40); + } } static function uninstall() { diff --git a/modules/gallery/helpers/graphics.php b/modules/gallery/helpers/graphics.php index bb085ea5..2868a28d 100644 --- a/modules/gallery/helpers/graphics.php +++ b/modules/gallery/helpers/graphics.php @@ -314,9 +314,10 @@ class graphics_Core { $toolkits->graphicsmagick->error = t("GraphicsMagick requires the <b>exec</b> function"); } else { $graphics_path = module::get_var("gallery", "graphics_toolkit_path", null); + $extra_binary_paths = module::get_var("gallery", "extra_binary_paths", null); putenv("PATH=" . getenv("PATH") . (empty($graphics_path) ? "" : ":$graphics_path") . - ":/usr/local/bin:/opt/local/bin:/opt/bin"); + ":" . $extra_binary_paths); // @todo: consider refactoring the two segments below into a loop since they are so // similar. diff --git a/modules/gallery/helpers/movie.php b/modules/gallery/helpers/movie.php index 3e55eefe..50339541 100644 --- a/modules/gallery/helpers/movie.php +++ b/modules/gallery/helpers/movie.php @@ -86,9 +86,10 @@ class movie_Core { static function find_ffmpeg() { if (!($ffmpeg_path = module::get_var("gallery", "ffmpeg_path")) || !file_exists($ffmpeg_path)) { $graphics_path = module::get_var("gallery", "graphics_toolkit_path", null); + $extra_binary_paths = module::get_var("gallery", "extra_binary_paths", null); putenv("PATH=" . getenv("PATH") . (empty($graphics_path) ? "" : ":$graphics_path") . - ":/usr/local/bin:/opt/local/bin:/opt/bin"); + ":" . $extra_binary_paths); if (function_exists("exec")) { $ffmpeg_path = exec("which ffmpeg"); } |