correctly bail out on non-existing INI file
[pharext/pharext] / src / pharext / Task / Activate.php
index 3d7e05f017604863a469042634a5e362a7d249c5..6a892e89741af32edcaa38077f6e1dfe6327d6b2 100644 (file)
@@ -80,6 +80,9 @@ class Activate implements Task
                        if ($verbose) {
                                printf("Checking %s ...\n", $file);
                        }
+                       if (!file_exists($file)) {
+                               throw new Exception(sprintf("INI file '%s' does not exist", $file));
+                       }
                        $temp = new Tempfile("phpini");
                        foreach (file($file) as $line) {
                                if (preg_match("/^\s*{$this->type}\s*=\s*[\"']?{$pattern}[\"']?\s*(;.*)?\$/", $line)) {