com web/rmtools: added an extra config for oci8 and implemented a way: client/data/config/pecl/exts.ini client/include/PeclExt.php
| From: | Stephen A. Zarkos | Date: | Mon, 16 Sep 2013 06:48:43 +0000 |
| Subject: | com web/rmtools: added an extra config for oci8 and implemented a way: client/data/config/pecl/exts.ini client/include/PeclExt.php | ||
| Groups: | php.webmaster | ||
| Request: | Send a blank email to php-webmaster+get-16677@lists.php.net to get a copy of this message | ||
Commit: 5e9d6016834e7cad14af3768a2de66fc7ec3e54c
Author: Anatol Belski <ab@php.net> Mon, 16 Sep 2013 08:48:43 +0200
Parents: 459e538f4cea2407c5b510dacd4d838085e8a750
Branches: master
Link: http://git.php.net/?p=web/rmtools.git;a=commitdiff;h=5e9d6016834e7cad14af3768a2de66fc7ec3e54c
Log:
added an extra config for oci8 and implemented a way
to override the ext configure option through the config
Changed paths:
M client/data/config/pecl/exts.ini
M client/include/PeclExt.php
Diff:
diff --git a/client/data/config/pecl/exts.ini b/client/data/config/pecl/exts.ini
index 5b5ad88..d4a795d 100644
--- a/client/data/config/pecl/exts.ini
+++ b/client/data/config/pecl/exts.ini
@@ -227,3 +227,10 @@ libs[]=pdflib
exts[]=
opts[]=
+[oci8]
+type=with
+libs[]=
+exts[]=
+opts[]=--with-oci8=C:\pecl-dep-libs\oracle\instantclient_10_2\sdk,shared
+opts[]=--with-oci8-11g=C:\pecl-dep-libs\oracle\instantclient_11_2\sdk,shared
+
diff --git a/client/include/PeclExt.php b/client/include/PeclExt.php
index bc0ff9b..ed761a4 100644
--- a/client/include/PeclExt.php
+++ b/client/include/PeclExt.php
@@ -236,13 +236,34 @@ class PeclExt
protected function buildConfigureLine(array $data)
{
$ret = '';
+ $ignore_main_opt = false;
if (!isset($data['type'])
|| !in_array($data['type'], array('with', 'enable'))) {
throw new \Exception("Unknown extention configure type, expected enable/with");
}
- $ret = ' "--' . $data['type'] . '-' .
str_replace('_', '-', $this->name) . '=shared" ';
+ $main_opt = '--' . $data['type'] . '-' . str_replace('_',
'-', $this->name);
+
+ if (isset($data['opts']) && $data['opts']) {
+ $data['opts'] = !is_array($data['opts']) ? array($data['opts']) :
$data['opts'];
+ foreach($data['opts'] as $opt) {
+ if ($opt) {
+ /* XXX simple check for opt syntax */
+ $ret .= ' "' . $opt . '" ';
+ }
+ /* the main enable/with option was overridden in the ini */
+ if (strstr($opt, "$main_opt=") !== false) {
+ $ignore_main_opt = true;
+ }
+ }
+ } else {
+ $data['opts'] = array();
+ }
+
+ if (!$ignore_main_opt) {
+ $ret .= ' "' . $main_opt . '=shared" ';
+ }
if (isset($data['libs']) && $data['libs']) {
$data['libs'] = !is_array($data['libs']) ? array($data['libs']) :
$data['libs'];
@@ -282,18 +303,6 @@ class PeclExt
$data['libs'] = array();
}
- if (isset($data['opts']) && $data['opts']) {
- $data['opts'] = !is_array($data['opts']) ? array($data['opts']) :
$data['opts'];
- foreach($data['opts'] as $opt) {
- if ($opt) {
- /* XXX simple check for opt syntax */
- $ret .= ' "' . $opt . '" ';
- }
- }
- } else {
- $data['opts'] = array();
- }
-
if (isset($data['exts']) && $data['exts']) {
if (empty($this->non_core_ext_deps)) {
$this->setupNonCoreExtDeps();