com web/rmtools: more checks for build dir: include/BuildVC.php include/PeclBuildVC.php
| From: | Anatol Belski | Date: | Thu, 17 Nov 2016 00:19:59 +0000 |
| Subject: | com web/rmtools: more checks for build dir: include/BuildVC.php include/PeclBuildVC.php | ||
| Groups: | php.webmaster | ||
| Request: | Send a blank email to php-webmaster+get-25902@lists.php.net to get a copy of this message | ||
Commit: 578213bd38b9d533988e08e55ac49991348e476c
Author: Anatol Belski <ab@php.net> Thu, 17 Nov 2016 01:19:59 +0100
Parents: 1f1a880827faf1eb3fd7f173d4a827f19a919f5c
Branches: master
Link: http://git.php.net/?p=web/rmtools.git;a=commitdiff;h=578213bd38b9d533988e08e55ac49991348e476c
Log:
more checks for build dir
Changed paths:
M include/BuildVC.php
M include/PeclBuildVC.php
Diff:
diff --git a/include/BuildVC.php b/include/BuildVC.php
index 317110a...a4de9bc 100644
--- a/include/BuildVC.php
+++ b/include/BuildVC.php
@@ -29,9 +29,14 @@ class BuildVC {
function __construct(Branch $branch, $build_name)
{
+ $build_dir = $this->branch->config->getBuildDir();
+ if (!file_exists($build_dir)) {
+ throw new \Exception("Directory '$build_dir' doesn't exist");
+ }
+
$this->branch = $branch;
$this->build_name = $build_name;
- $this->obj_dir = $this->branch->config->getBuildDir() . '/' .
$this->build_name;
+ $this->obj_dir = $build_dir . '/' . $this->build_name;
$this->compiler = $this->branch->config->getCompiler();
$this->architecture = $this->branch->config->getArchitecture();
diff --git a/include/PeclBuildVC.php b/include/PeclBuildVC.php
index e4e670b..f13df7d 100644
--- a/include/PeclBuildVC.php
+++ b/include/PeclBuildVC.php
@@ -30,9 +30,14 @@ class PeclBuildVC {
function __construct(PeclBranch $branch, $build_name)
{
+ $build_dir = $this->config->getBuildDir();
+ if (!file_exists($build_dir)) {
+ throw new \Exception("Directory '$build_dir' doesn't exist");
+ }
+
$this->branch = $branch;
$this->build_name = $build_name;
- $this->obj_dir = $branch->config->getBuildDir() . '/' .
$branch->config->getBranch() . '-' . $this->build_name;
+ $this->obj_dir = $build_dir . '/' . $branch->config->getBranch() .
'-' . $this->build_name;
$this->compiler = $branch->config->builds[$build_name]['compiler'];
$this->architecture = $branch->config->builds[$build_name]['arch'];
$this->thread_safe =
(boolean)$branch->config->builds[$build_name]['thread_safe'];