com web/rmtools: fixed error handling on ext initialization: client/include/PeclExt.php client/script/pecl.php
| From: | Stephen A. Zarkos | Date: | Sun, 01 Sep 2013 16:07:24 +0000 |
| Subject: | com web/rmtools: fixed error handling on ext initialization: client/include/PeclExt.php client/script/pecl.php | ||
| Groups: | php.webmaster | ||
| Request: | Send a blank email to php-webmaster+get-16716@lists.php.net to get a copy of this message | ||
Commit: f78df3fb7390ba6dd2a5bdeb602388f0fe77086a
Author: Anatol Belski <ab@php.net> Sun, 1 Sep 2013 18:07:24 +0200
Parents: 5d3dcbc959ed49750e3c75ea20d5b6b583b3be6a
Branches: master
Link: http://git.php.net/?p=web/rmtools.git;a=commitdiff;h=f78df3fb7390ba6dd2a5bdeb602388f0fe77086a
Log:
fixed error handling on ext initialization
Changed paths:
M client/include/PeclExt.php
M client/script/pecl.php
Diff:
diff --git a/client/include/PeclExt.php b/client/include/PeclExt.php
index b956c8f..a077ae0 100644
--- a/client/include/PeclExt.php
+++ b/client/include/PeclExt.php
@@ -220,7 +220,7 @@ class PeclExt
}
}
if (!isset($config['type'])) {
- throw new Exception("Couldn't determine whether 'with' or 'enable'
configure option to use");
+ throw new \Exception("Couldn't determine whether 'with' or
'enable' configure option to use");
}
/* XXX Extension deps have to be checked here using
@@ -346,6 +346,7 @@ class PeclExt
}
if (!file_exists($this->tmp_extract_path . DIRECTORY_SEPARATOR . 'config.w32')) {
+ $this->cleanup();
throw new \Exception("config.w32 doesn't exist in the tarball");
}
@@ -358,14 +359,17 @@ class PeclExt
if(preg_match(',#define PHP_VERSION "(.*)",Sm', file_get_contents($ver_hdr),
$m)) {
$php_ver = $m[1];
} else {
+ $this->cleanup();
throw new \Exception("Couldn't parse PHP sources for version");
}
if ($min_php_ver && version_compare($php_ver, $min_php_ver) < 0) {
+ $this->cleanup();
throw new \Exception("At least PHP '$min_php_ver' required, got
'$php_ver'");
}
if ($max_php_ver && version_compare($php_ver, $max_php_ver) >= 0) {
+ $this->cleanup();
throw new \Exception("At most PHP '$max_php_ver' required, got
'$php_ver'");
}
}
diff --git a/client/script/pecl.php b/client/script/pecl.php
index 324ffd3..310fcd3 100644
--- a/client/script/pecl.php
+++ b/client/script/pecl.php
@@ -47,6 +47,8 @@ if (!is_dir($build_dir_parent)) {
$builds = $branch->getBuildList('windows');
+echo "Using <$ext_tgz>\n";
+
/* Each windows configuration from the ini for the given PHP version will be built */
foreach ($builds as $build_name) {
@@ -63,8 +65,6 @@ foreach ($builds as $build_name) {
} catch (Exception $e) {
echo $e->getMessage() . "\n";
$build->clean();
- $ext->cleanup();
- rm\rmdir_rf($toupload_dir);
/* XXX mail the ext dev what the error was, if it's something in the check
phase like missing config.w32, it's interesting for sure.