From: Michael Wallner Date: Fri, 15 May 2015 07:44:35 +0000 (+0200) Subject: correctly bail out on non-existing INI file X-Git-Tag: v4.0.0~9 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=3b508bf5199fa6bd0c960e943e0a0bd28f9d737c;p=pharext%2Fpharext correctly bail out on non-existing INI file --- diff --git a/bin/pharext b/bin/pharext index 3444866..a6b0d4a 100755 Binary files a/bin/pharext and b/bin/pharext differ diff --git a/src/pharext/Installer.php b/src/pharext/Installer.php index a90eb28..29fe271 100644 --- a/src/pharext/Installer.php +++ b/src/pharext/Installer.php @@ -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(); diff --git a/src/pharext/Task/Activate.php b/src/pharext/Task/Activate.php index 3d7e05f..6a892e8 100644 --- a/src/pharext/Task/Activate.php +++ b/src/pharext/Task/Activate.php @@ -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)) {