update travis-pecl
authorMichael Wallner <mike@php.net>
Fri, 2 Mar 2018 16:01:54 +0000 (17:01 +0100)
committerMichael Wallner <mike@php.net>
Fri, 2 Mar 2018 16:01:54 +0000 (17:01 +0100)
.travis.yml
gen_pq_type.sh [deleted file]
gen_travis_yml.php [deleted file]
php_pq_type.awk [deleted file]
scripts/gen_pq_type.sh [new file with mode: 0755]
scripts/gen_travis_yml.php [new file with mode: 0755]
scripts/php_pq_type.awk [new file with mode: 0755]
src/php_pq_params.c
travis/pecl

index 6d00d62de9d1a3cc9874df5d25b823314f9be206..d43ddb85dc80ef2da8863a3f48a9e4c84b68bb91 100644 (file)
@@ -1,5 +1,6 @@
 # autogenerated file; do not edit
 language: c
+sudo: false
 
 addons:
  postgresql: 9.4
@@ -9,50 +10,34 @@ addons:
    - php-pear
    - valgrind
 
+compiler:
+ - gcc
+ - clang
+
 env:
  global:
   - PQ_DSN="postgres://postgres@localhost/test"
  matrix:
-  - PHP=7.0 enable_debug=no enable_maintainer_zts=no enable_json=no
-  - PHP=7.1 enable_debug=no enable_maintainer_zts=no enable_json=no
-  - PHP=7.2 enable_debug=no enable_maintainer_zts=no enable_json=no
-  - PHP=master enable_debug=no enable_maintainer_zts=no enable_json=no
-  - PHP=7.0 enable_debug=yes enable_maintainer_zts=no enable_json=no
-  - PHP=7.1 enable_debug=yes enable_maintainer_zts=no enable_json=no
-  - PHP=7.2 enable_debug=yes enable_maintainer_zts=no enable_json=no
-  - PHP=master enable_debug=yes enable_maintainer_zts=no enable_json=no
-  - PHP=7.0 enable_debug=no enable_maintainer_zts=yes enable_json=no
-  - PHP=7.1 enable_debug=no enable_maintainer_zts=yes enable_json=no
-  - PHP=7.2 enable_debug=no enable_maintainer_zts=yes enable_json=no
-  - PHP=master enable_debug=no enable_maintainer_zts=yes enable_json=no
-  - PHP=7.0 enable_debug=yes enable_maintainer_zts=yes enable_json=no
-  - PHP=7.1 enable_debug=yes enable_maintainer_zts=yes enable_json=no
-  - PHP=7.2 enable_debug=yes enable_maintainer_zts=yes enable_json=no
-  - PHP=master enable_debug=yes enable_maintainer_zts=yes enable_json=no
-  - PHP=7.0 enable_debug=no enable_maintainer_zts=no enable_json=yes
-  - PHP=7.1 enable_debug=no enable_maintainer_zts=no enable_json=yes
-  - PHP=7.2 enable_debug=no enable_maintainer_zts=no enable_json=yes
-  - PHP=master enable_debug=no enable_maintainer_zts=no enable_json=yes
-  - PHP=7.0 enable_debug=yes enable_maintainer_zts=no enable_json=yes
-  - PHP=7.1 enable_debug=yes enable_maintainer_zts=no enable_json=yes
-  - PHP=7.2 enable_debug=yes enable_maintainer_zts=no enable_json=yes
-  - PHP=master enable_debug=yes enable_maintainer_zts=no enable_json=yes
-  - PHP=7.0 enable_debug=no enable_maintainer_zts=yes enable_json=yes
-  - PHP=7.1 enable_debug=no enable_maintainer_zts=yes enable_json=yes
-  - PHP=7.2 enable_debug=no enable_maintainer_zts=yes enable_json=yes
-  - PHP=master enable_debug=no enable_maintainer_zts=yes enable_json=yes
   - PHP=7.0 enable_debug=yes enable_maintainer_zts=yes enable_json=yes
   - PHP=7.1 enable_debug=yes enable_maintainer_zts=yes enable_json=yes
-  - PHP=7.2 enable_debug=yes enable_maintainer_zts=yes enable_json=yes
   - PHP=master enable_debug=yes enable_maintainer_zts=yes enable_json=yes
+  - PHP=7.2 enable_json=no
+  - PHP=7.2 enable_json=yes enable_debug=no enable_maintainer_zts=no
+  - PHP=7.2 enable_json=yes enable_debug=yes enable_maintainer_zts=no
+  - PHP=7.2 enable_json=yes enable_debug=no enable_maintainer_zts=yes
+  - PHP=7.2 enable_json=yes enable_debug=yes enable_maintainer_zts=yes
+  - PHP=7.2 enable_json=yes CFLAGS='-O0 -g --coverage' CXXFLAGS='-O0 -g --coverage'
 
-before_script:
+install:
  - make -f travis/pecl/Makefile php
  - make -f travis/pecl/Makefile pecl PECL=raphf:raphf:2.0.0
- - make -f travis/pecl/Makefile ext PECL=pq
+
+before_script:
  - psql -U postgres -c "CREATE DATABASE test"
 
 script:
+ - make -f travis/pecl/Makefile ext PECL=pq
  - make -f travis/pecl/Makefile test
 
-sudo: false
+after_success:
+ - test -n "$CFLAGS" && cd src/.libs && bash <(curl -s https://codecov.io/bash) -X xcode -X coveragepy
diff --git a/gen_pq_type.sh b/gen_pq_type.sh
deleted file mode 100755 (executable)
index a0c49db..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/sh
-CWD=$(dirname $0)
-awk -f $CWD/php_pq_type.awk >$CWD/php_pq_type.h \
-       <${1-/usr/include/postgresql}/server/catalog/pg_type.h
diff --git a/gen_travis_yml.php b/gen_travis_yml.php
deleted file mode 100755 (executable)
index a5b4420..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-#!/usr/bin/env php
-# autogenerated file; do not edit
-language: c
-
-addons:
- postgresql: 9.4
- apt:
-  packages:
-   - php5-cli
-   - php-pear
-   - valgrind
-
-env:
- global:
-  - PQ_DSN="postgres://postgres@localhost/test"
- matrix:
-<?php
-
-$gen = include "./travis/pecl/gen-matrix.php";
-$env = $gen([
-       "PHP" => ["7.0", "7.1", "7.2", "master"],
-       "enable_debug",
-       "enable_maintainer_zts",
-       "enable_json",
-]);
-foreach ($env as $e) {
-       printf("  - %s\n", $e);
-}
-
-?>
-
-before_script:
- - make -f travis/pecl/Makefile php
- - make -f travis/pecl/Makefile pecl PECL=raphf:raphf:2.0.0
- - make -f travis/pecl/Makefile ext PECL=pq
- - psql -U postgres -c "CREATE DATABASE test"
-
-script:
- - make -f travis/pecl/Makefile test
-
-sudo: false
diff --git a/php_pq_type.awk b/php_pq_type.awk
deleted file mode 100755 (executable)
index 93c4a8d..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-#!/usr/bin/awk -f
-
-BEGIN {
-       printf "#ifndef PHP_PQ_TYPE\n"
-       printf "# define PHP_PQ_TYPE(t,o)\n"
-       printf "#endif\n"
-}
-
-END {
-       printf "#ifndef PHP_PQ_TYPE_IS_ARRAY\n"
-       printf "# define PHP_PQ_TYPE_IS_ARRAY(oid) (\\\n\t\t0 \\\n"
-       for (oid in arrays) {
-               printf "\t||\t((oid) == %d) \\\n", oid
-       }
-       printf ")\n#endif\n"
-
-       printf "#ifndef PHP_PQ_TYPE_OF_ARRAY\n"
-       printf "# define PHP_PQ_TYPE_OF_ARRAY(oid) ("
-       for (oid in arrays) {
-               printf "\\\n\t(oid) == %d ? %s : ", oid, arrays[oid]
-       }
-       printf "0 \\\n)\n#endif\n"
-
-       printf "#ifndef PHP_PQ_DELIM_OF_ARRAY\n"
-       printf "# define PHP_PQ_DELIM_OF_ARRAY(oid) ("
-       for (oid in delims) {
-               printf "\\\n\t(oid) == %d ? '%s' : ", oid, delims[oid]
-       }
-       printf "\\\n\t0 \\\n)\n#endif\n"
-}
-
-/^DATA/ {
-       oid = $4
-       name = toupper($6)
-       adelim = $15
-       atypoid = $17
-       if (sub("^_", "", name)) {
-               arrays[oid] = atypoid
-               name = name "ARRAY"
-       }
-       delims[oid] = adelim
-       printf "#ifndef PHP_PQ_OID_%s\n", name
-       printf "# define PHP_PQ_OID_%s %d\n", name, oid
-       printf "#endif\n"
-       printf "PHP_PQ_TYPE(\"%s\", %d)\n", name, oid
-}
diff --git a/scripts/gen_pq_type.sh b/scripts/gen_pq_type.sh
new file mode 100755 (executable)
index 0000000..6920860
--- /dev/null
@@ -0,0 +1,4 @@
+#!/bin/sh
+CWD=$(dirname $0)
+awk -f $CWD/php_pq_type.awk >$CWD/../php_pq_type.h \
+       <${1-/usr/include/postgresql}/server/catalog/pg_type.h
diff --git a/scripts/gen_travis_yml.php b/scripts/gen_travis_yml.php
new file mode 100755 (executable)
index 0000000..6513aef
--- /dev/null
@@ -0,0 +1,66 @@
+#!/usr/bin/env php
+# autogenerated file; do not edit
+language: c
+sudo: false
+
+addons:
+ postgresql: 9.4
+ apt:
+  packages:
+   - php5-cli
+   - php-pear
+   - valgrind
+
+compiler:
+ - gcc
+ - clang
+
+env:
+ global:
+  - PQ_DSN="postgres://postgres@localhost/test"
+ matrix:
+<?php
+
+$gen = include "./travis/pecl/gen-matrix.php";
+$cur = "7.2";
+$env = $gen([
+       "PHP" => ["7.0", "7.1", "master"],
+       "enable_debug" => "yes",
+       "enable_maintainer_zts" => "yes",
+       "enable_json" => "yes",
+], [
+       "PHP" => $cur,
+       "enable_json" => "no",
+], [
+       "PHP" => $cur,
+       "enable_json" => "yes",
+       "enable_debug",
+       "enable_maintainer_zts"
+], [
+       "PHP" => $cur,
+       "enable_json" => "yes",
+       "CFLAGS" => "'-O0 -g --coverage'",
+       "CXXFLAGS" => "'-O0 -g --coverage'",
+]);
+
+foreach ($env as $g) {
+       foreach ($g as $e) {
+               printf("  - %s\n", $e);
+       }
+}
+
+?>
+
+install:
+ - make -f travis/pecl/Makefile php
+ - make -f travis/pecl/Makefile pecl PECL=raphf:raphf:2.0.0
+
+before_script:
+ - psql -U postgres -c "CREATE DATABASE test"
+
+script:
+ - make -f travis/pecl/Makefile ext PECL=pq
+ - make -f travis/pecl/Makefile test
+
+after_success:
+ - test -n "$CFLAGS" && cd src/.libs && bash <(curl -s https://codecov.io/bash) -X xcode -X coveragepy
diff --git a/scripts/php_pq_type.awk b/scripts/php_pq_type.awk
new file mode 100755 (executable)
index 0000000..93c4a8d
--- /dev/null
@@ -0,0 +1,46 @@
+#!/usr/bin/awk -f
+
+BEGIN {
+       printf "#ifndef PHP_PQ_TYPE\n"
+       printf "# define PHP_PQ_TYPE(t,o)\n"
+       printf "#endif\n"
+}
+
+END {
+       printf "#ifndef PHP_PQ_TYPE_IS_ARRAY\n"
+       printf "# define PHP_PQ_TYPE_IS_ARRAY(oid) (\\\n\t\t0 \\\n"
+       for (oid in arrays) {
+               printf "\t||\t((oid) == %d) \\\n", oid
+       }
+       printf ")\n#endif\n"
+
+       printf "#ifndef PHP_PQ_TYPE_OF_ARRAY\n"
+       printf "# define PHP_PQ_TYPE_OF_ARRAY(oid) ("
+       for (oid in arrays) {
+               printf "\\\n\t(oid) == %d ? %s : ", oid, arrays[oid]
+       }
+       printf "0 \\\n)\n#endif\n"
+
+       printf "#ifndef PHP_PQ_DELIM_OF_ARRAY\n"
+       printf "# define PHP_PQ_DELIM_OF_ARRAY(oid) ("
+       for (oid in delims) {
+               printf "\\\n\t(oid) == %d ? '%s' : ", oid, delims[oid]
+       }
+       printf "\\\n\t0 \\\n)\n#endif\n"
+}
+
+/^DATA/ {
+       oid = $4
+       name = toupper($6)
+       adelim = $15
+       atypoid = $17
+       if (sub("^_", "", name)) {
+               arrays[oid] = atypoid
+               name = name "ARRAY"
+       }
+       delims[oid] = adelim
+       printf "#ifndef PHP_PQ_OID_%s\n", name
+       printf "# define PHP_PQ_OID_%s %d\n", name, oid
+       printf "#endif\n"
+       printf "PHP_PQ_TYPE(\"%s\", %d)\n", name, oid
+}
index 5a5156ff32d85b758498e3459edc2369cffdcde0..6739b459b00876d445f65fe3981b3735435632bf 100644 (file)
@@ -75,7 +75,9 @@ unsigned php_pq_params_add_type_oid(php_pq_params_t *p, Oid type)
 
 static zend_string *object_param_to_string(php_pq_params_t *p, zval *zobj, Oid type)
 {
+#if PHP_PQ_HAVE_PHP_JSON_H && defined(PHP_PQ_OID_JSON)
        smart_str str = {0};
+#endif
 
        switch (type) {
 #if PHP_PQ_HAVE_PHP_JSON_H && defined(PHP_PQ_OID_JSON)
index 05f5e23f9c6a3d588675f0387c882af1f57c0e4e..2622a78d9eb346103f502445f6ac8d315ebfecc5 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 05f5e23f9c6a3d588675f0387c882af1f57c0e4e
+Subproject commit 2622a78d9eb346103f502445f6ac8d315ebfecc5