Throw exception if locale path not found, to easier spot typos.
authorJan Schneider <jan@horde.org>
Mon, 11 Oct 2010 13:36:24 +0000 (15:36 +0200)
committerJan Schneider <jan@horde.org>
Wed, 13 Oct 2010 00:30:03 +0000 (02:30 +0200)
framework/Translation/lib/Horde/Translation/Gettext.php

index 355de11..aff5cd5 100644 (file)
@@ -39,6 +39,9 @@ class Horde_Translation_Gettext implements Horde_Translation
      */
     public function __construct($domain, $path)
     {
+        if (!is_dir($path)) {
+            throw new InvalidArgumentException('$path is not a directory');
+        }
         $this->_gettext = function_exists('_');
         if (!$this->_gettext) {
             return;