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_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/gen_pq_type.sh b/scripts/gen_pq_type.sh similarity index 61% rename from gen_pq_type.sh rename to scripts/gen_pq_type.sh index a0c49db..6920860 100755 --- a/gen_pq_type.sh +++ b/scripts/gen_pq_type.sh @@ -1,4 +1,4 @@ #!/bin/sh CWD=$(dirname $0) -awk -f $CWD/php_pq_type.awk >$CWD/php_pq_type.h \ +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/php_pq_type.awk b/scripts/php_pq_type.awk similarity index 100% rename from php_pq_type.awk rename to scripts/php_pq_type.awk 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