From: Michael Wallner Date: Fri, 2 Mar 2018 16:01:54 +0000 (+0100) Subject: update travis-pecl X-Git-Tag: v2.1.4~9 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=b79edc51dfb0d34f172a7bb80e7b0f225d95a744;p=m6w6%2Fext-pq update travis-pecl --- diff --git a/.travis.yml b/.travis.yml index 6d00d62..d43ddb8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 index a0c49db..0000000 --- a/gen_pq_type.sh +++ /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 index a5b4420..0000000 --- a/gen_travis_yml.php +++ /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: - ["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 index 93c4a8d..0000000 --- a/php_pq_type.awk +++ /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 index 0000000..6920860 --- /dev/null +++ b/scripts/gen_pq_type.sh @@ -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 index 0000000..6513aef --- /dev/null +++ b/scripts/gen_travis_yml.php @@ -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: + ["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 index 0000000..93c4a8d --- /dev/null +++ b/scripts/php_pq_type.awk @@ -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 +} diff --git a/src/php_pq_params.c b/src/php_pq_params.c index 5a5156f..6739b45 100644 --- a/src/php_pq_params.c +++ b/src/php_pq_params.c @@ -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) diff --git a/travis/pecl b/travis/pecl index 05f5e23..2622a78 160000 --- a/travis/pecl +++ b/travis/pecl @@ -1 +1 @@ -Subproject commit 05f5e23f9c6a3d588675f0387c882af1f57c0e4e +Subproject commit 2622a78d9eb346103f502445f6ac8d315ebfecc5