correctly bail out on non-existing INI file
authorMichael Wallner <mike@php.net>
Fri, 15 May 2015 07:44:35 +0000 (09:44 +0200)
committerMichael Wallner <mike@php.net>
Fri, 15 May 2015 07:44:35 +0000 (09:44 +0200)
bin/pharext
src/pharext/Installer.php
src/pharext/Task/Activate.php

index 3444866c58ef3527513461b314254594386e6b6d..a6b0d4a7fe78400f52ea1eda2a0370b7d3fcf78c 100755 (executable)
Binary files a/bin/pharext and b/bin/pharext differ
index a90eb28e9acc97350465be252d22d20589568a3d..29fe271c6bec2e9588b0cef342ba2d8bbeb8901d 100644 (file)
@@ -210,7 +210,7 @@ class Installer implements Command
 
        private function activate($temp) {
                if ($this->args->ini) {
-                       $files = [realpath($this->args->ini)];
+                       $files = [$this->args->ini];
                } else {
                        $files = array_filter(array_map("trim", explode(",", php_ini_scanned_files())));
                        $files[] = php_ini_loaded_file();
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)) {