summaryrefslogtreecommitdiff
path: root/modules/gallery
diff options
context:
space:
mode:
authorTim Almdal <tnalmdal@shaw.ca>2009-07-14 06:37:53 -0700
committerTim Almdal <tnalmdal@shaw.ca>2009-07-14 06:37:53 -0700
commitbe635df6d98bb5bbc08302a00d29ea5a016ca37b (patch)
treee35daf465b26ac68dc4be99839f9de05c992c1e0 /modules/gallery
parent021e6eccd03df460fddb0d2bdcab335ddd2d6c52 (diff)
parent2a40f48d659c5b0ac3ab90e25aaaef12dce99c39 (diff)
Merge branch 'master' of git@github.com:gallery/gallery3
Diffstat (limited to 'modules/gallery')
-rw-r--r--modules/gallery/helpers/graphics.php2
-rw-r--r--modules/gallery/helpers/movie.php2
-rw-r--r--modules/gallery/module.info4
-rw-r--r--modules/gallery/tests/File_Structure_Test.php37
4 files changed, 41 insertions, 4 deletions
diff --git a/modules/gallery/helpers/graphics.php b/modules/gallery/helpers/graphics.php
index bbae0602..db9b2ef5 100644
--- a/modules/gallery/helpers/graphics.php
+++ b/modules/gallery/helpers/graphics.php
@@ -331,7 +331,7 @@ class graphics_Core {
if (!isset($gd["GD Version"])) {
$gd["GD Version"] = false;
}
- putenv("PATH=" . getenv("PATH") . ":/usr/local/bin:/opt/local/bin");
+ putenv("PATH=" . getenv("PATH") . ":/usr/local/bin:/opt/local/bin:/opt/bin");
return array("gd" => $gd,
"imagemagick" => $exec ? dirname(exec("which convert")) : false,
"graphicsmagick" => $exec ? dirname(exec("which gm")) : false);
diff --git a/modules/gallery/helpers/movie.php b/modules/gallery/helpers/movie.php
index 54159294..d62ead76 100644
--- a/modules/gallery/helpers/movie.php
+++ b/modules/gallery/helpers/movie.php
@@ -145,7 +145,7 @@ class movie_Core {
static function find_ffmpeg() {
if (!$ffmpeg_path = module::get_var("gallery", "ffmpeg_path")) {
- putenv("PATH=" . getenv("PATH") . ":/usr/local/bin:/opt/local/bin");
+ putenv("PATH=" . getenv("PATH") . ":/usr/local/bin:/opt/local/bin:/opt/bin");
if (function_exists("exec")) {
$ffmpeg_path = exec("which ffmpeg");
}
diff --git a/modules/gallery/module.info b/modules/gallery/module.info
index c184aba7..64a30b1f 100644
--- a/modules/gallery/module.info
+++ b/modules/gallery/module.info
@@ -1,3 +1,3 @@
-name = Gallery 3
-description = Gallery core application
+name = "Gallery 3"
+description = "Gallery core application"
version = 6
diff --git a/modules/gallery/tests/File_Structure_Test.php b/modules/gallery/tests/File_Structure_Test.php
index 06f456ff..8a97e00b 100644
--- a/modules/gallery/tests/File_Structure_Test.php
+++ b/modules/gallery/tests/File_Structure_Test.php
@@ -213,6 +213,43 @@ class File_Structure_Test extends Unit_Test_Case {
}
}
}
+
+ public function module_info_is_well_formed_test() {
+ $info_files = array_merge(
+ glob("modules/*/module.info"),
+ glob("themes/*/module.info"));
+
+ $errors = array();
+ foreach ($info_files as $file) {
+ foreach (file($file) as $line) {
+ $parts = explode("=", $line, 2);
+ $values[trim($parts[0])] = trim($parts[1]);
+ }
+
+ $module = dirname($file);
+ // Certain keys must exist
+ foreach (array("name", "description", "version") as $key) {
+ if (!array_key_exists($key, $values)) {
+ $errors[] = "$module: missing key $key";
+ }
+ }
+
+ // Any values containing spaces must be quoted
+ foreach ($values as $key => $value) {
+ if (strpos($value, " ") !== false && !preg_match('/^".*"$/', $value)) {
+ $errors[] = "$module: value for $key must be quoted";
+ }
+ }
+
+ // The file must parse
+ if (!is_array(parse_ini_file($file))) {
+ $errors[] = "$module: info file is not parseable";
+ }
+ }
+ if ($errors) {
+ $this->assert_true(false, $errors);
+ }
+ }
}
class PhpCodeFilterIterator extends FilterIterator {