--- /dev/null
+# generated file; do not edit!
+
+name: curl-matrix
+on:
+ workflow_dispatch:
+ push:
+
+jobs:
+ curl-master:
+ name: curl-master
+ continue-on-error: true
+ env:
+ PHP: "8.0"
+ CURL: "master"
+ enable_debug: "yes"
+ enable_iconv: "yes"
+ with_http_libcurl_dir: "/opt"
+ runs-on: ubuntu-18.04
+ steps:
+ - uses: actions/checkout@v2
+ with:
+ submodules: true
+ path: http
+ - uses: actions/checkout@v2
+ with:
+ repository: curl/curl
+ path: curl
+ - name: Install
+ run: |
+ echo 'deb-src http://azure.archive.ubuntu.com/ubuntu bionic main' | sudo tee -a /etc/apt/sources.list && \
+ echo 'deb-src http://azure.archive.ubuntu.com/ubuntu bionic-updates main' | sudo tee -a /etc/apt/sources.list && \
+ sudo apt-get update -y && \
+ sudo apt-get build-dep -y libcurl4-openssl-dev && \
+ sudo apt-get install -y \
+ php-cli \
+ php-pear \
+ libidn11-dev \
+ libidn2-0-dev \
+ libicu-dev \
+ libevent-dev \
+ libbrotli-dev \
+ re2c
+ - name: Curl
+ run: |
+ sudo chmod +x /usr/share/libtool/build-aux/ltmain.sh
+ sudo ln -s /usr/share/libtool/build-aux/ltmain.sh /usr/bin/libtool
+ cd curl
+ ./buildconf
+ ./configure --prefix=/opt --disable-dependency-tracking --with-ssl --with-openssl --without-libssh2
+ make -j2
+ make install
+ - name: Prepare
+ run: |
+ cd http
+ make -f scripts/ci/Makefile php || make -f scripts/ci/Makefile clean php
+ make -f scripts/ci/Makefile pecl PECL=m6w6/ext-raphf.git:raphf:master
+ - name: Build
+ run: |
+ cd http
+ make -f scripts/ci/Makefile ext PECL=http
+ - name: Test
+ run: |
+ cd http
+ make -f scripts/ci/Makefile test
+
+ curl-7_78_0:
+ name: curl-7_78_0
+ continue-on-error: true
+ env:
+ PHP: "8.0"
+ CURL: "7_78_0"
+ enable_debug: "yes"
+ enable_iconv: "yes"
+ with_http_libcurl_dir: "/opt"
+ runs-on: ubuntu-18.04
+ steps:
+ - uses: actions/checkout@v2
+ with:
+ submodules: true
+ path: http
+ - uses: actions/checkout@v2
+ with:
+ repository: curl/curl
+ path: curl
+ ref: curl-7_78_0 #
+ - name: Install
+ run: |
+ echo 'deb-src http://azure.archive.ubuntu.com/ubuntu bionic main' | sudo tee -a /etc/apt/sources.list && \
+ echo 'deb-src http://azure.archive.ubuntu.com/ubuntu bionic-updates main' | sudo tee -a /etc/apt/sources.list && \
+ sudo apt-get update -y && \
+ sudo apt-get build-dep -y libcurl4-openssl-dev && \
+ sudo apt-get install -y \
+ php-cli \
+ php-pear \
+ libidn11-dev \
+ libidn2-0-dev \
+ libicu-dev \
+ libevent-dev \
+ libbrotli-dev \
+ re2c
+ - name: Curl
+ run: |
+ sudo chmod +x /usr/share/libtool/build-aux/ltmain.sh
+ sudo ln -s /usr/share/libtool/build-aux/ltmain.sh /usr/bin/libtool
+ cd curl
+ ./buildconf
+ ./configure --prefix=/opt --disable-dependency-tracking --with-ssl --with-openssl --without-libssh2
+ make -j2
+ make install
+ - name: Prepare
+ run: |
+ cd http
+ make -f scripts/ci/Makefile php || make -f scripts/ci/Makefile clean php
+ make -f scripts/ci/Makefile pecl PECL=m6w6/ext-raphf.git:raphf:master
+ - name: Build
+ run: |
+ cd http
+ make -f scripts/ci/Makefile ext PECL=http
+ - name: Test
+ run: |
+ cd http
+ make -f scripts/ci/Makefile test
+
+ curl-7_77_0:
+ name: curl-7_77_0
+ continue-on-error: true
+ env:
+ PHP: "8.0"
+ CURL: "7_77_0"
+ enable_debug: "yes"
+ enable_iconv: "yes"
+ with_http_libcurl_dir: "/opt"
+ runs-on: ubuntu-18.04
+ steps:
+ - uses: actions/checkout@v2
+ with:
+ submodules: true
+ path: http
+ - uses: actions/checkout@v2
+ with:
+ repository: curl/curl
+ path: curl
+ ref: curl-7_77_0 #
+ - name: Install
+ run: |
+ echo 'deb-src http://azure.archive.ubuntu.com/ubuntu bionic main' | sudo tee -a /etc/apt/sources.list && \
+ echo 'deb-src http://azure.archive.ubuntu.com/ubuntu bionic-updates main' | sudo tee -a /etc/apt/sources.list && \
+ sudo apt-get update -y && \
+ sudo apt-get build-dep -y libcurl4-openssl-dev && \
+ sudo apt-get install -y \
+ php-cli \
+ php-pear \
+ libidn11-dev \
+ libidn2-0-dev \
+ libicu-dev \
+ libevent-dev \
+ libbrotli-dev \
+ re2c
+ - name: Curl
+ run: |
+ sudo chmod +x /usr/share/libtool/build-aux/ltmain.sh
+ sudo ln -s /usr/share/libtool/build-aux/ltmain.sh /usr/bin/libtool
+ cd curl
+ ./buildconf
+ ./configure --prefix=/opt --disable-dependency-tracking --with-ssl --with-openssl --without-libssh2
+ make -j2
+ make install
+ - name: Prepare
+ run: |
+ cd http
+ make -f scripts/ci/Makefile php || make -f scripts/ci/Makefile clean php
+ make -f scripts/ci/Makefile pecl PECL=m6w6/ext-raphf.git:raphf:master
+ - name: Build
+ run: |
+ cd http
+ make -f scripts/ci/Makefile ext PECL=http
+ - name: Test
+ run: |
+ cd http
+ make -f scripts/ci/Makefile test
+
+ curl-7_76_1:
+ name: curl-7_76_1
+ continue-on-error: true
+ env:
+ PHP: "8.0"
+ CURL: "7_76_1"
+ enable_debug: "yes"
+ enable_iconv: "yes"
+ with_http_libcurl_dir: "/opt"
+ runs-on: ubuntu-18.04
+ steps:
+ - uses: actions/checkout@v2
+ with:
+ submodules: true
+ path: http
+ - uses: actions/checkout@v2
+ with:
+ repository: curl/curl
+ path: curl
+ ref: curl-7_76_1 #
+ - name: Install
+ run: |
+ echo 'deb-src http://azure.archive.ubuntu.com/ubuntu bionic main' | sudo tee -a /etc/apt/sources.list && \
+ echo 'deb-src http://azure.archive.ubuntu.com/ubuntu bionic-updates main' | sudo tee -a /etc/apt/sources.list && \
+ sudo apt-get update -y && \
+ sudo apt-get build-dep -y libcurl4-openssl-dev && \
+ sudo apt-get install -y \
+ php-cli \
+ php-pear \
+ libidn11-dev \
+ libidn2-0-dev \
+ libicu-dev \
+ libevent-dev \
+ libbrotli-dev \
+ re2c
+ - name: Curl
+ run: |
+ sudo chmod +x /usr/share/libtool/build-aux/ltmain.sh
+ sudo ln -s /usr/share/libtool/build-aux/ltmain.sh /usr/bin/libtool
+ cd curl
+ ./buildconf
+ ./configure --prefix=/opt --disable-dependency-tracking --with-ssl --with-openssl --without-libssh2
+ make -j2
+ make install
+ - name: Prepare
+ run: |
+ cd http
+ make -f scripts/ci/Makefile php || make -f scripts/ci/Makefile clean php
+ make -f scripts/ci/Makefile pecl PECL=m6w6/ext-raphf.git:raphf:master
+ - name: Build
+ run: |
+ cd http
+ make -f scripts/ci/Makefile ext PECL=http
+ - name: Test
+ run: |
+ cd http
+ make -f scripts/ci/Makefile test
+
+ curl-7_74_0:
+ name: curl-7_74_0
+ continue-on-error: true
+ env:
+ PHP: "8.0"
+ CURL: "7_74_0"
+ enable_debug: "yes"
+ enable_iconv: "yes"
+ with_http_libcurl_dir: "/opt"
+ runs-on: ubuntu-18.04
+ steps:
+ - uses: actions/checkout@v2
+ with:
+ submodules: true
+ path: http
+ - uses: actions/checkout@v2
+ with:
+ repository: curl/curl
+ path: curl
+ ref: curl-7_74_0 #
+ - name: Install
+ run: |
+ echo 'deb-src http://azure.archive.ubuntu.com/ubuntu bionic main' | sudo tee -a /etc/apt/sources.list && \
+ echo 'deb-src http://azure.archive.ubuntu.com/ubuntu bionic-updates main' | sudo tee -a /etc/apt/sources.list && \
+ sudo apt-get update -y && \
+ sudo apt-get build-dep -y libcurl4-openssl-dev && \
+ sudo apt-get install -y \
+ php-cli \
+ php-pear \
+ libidn11-dev \
+ libidn2-0-dev \
+ libicu-dev \
+ libevent-dev \
+ libbrotli-dev \
+ re2c
+ - name: Curl
+ run: |
+ sudo chmod +x /usr/share/libtool/build-aux/ltmain.sh
+ sudo ln -s /usr/share/libtool/build-aux/ltmain.sh /usr/bin/libtool
+ cd curl
+ ./buildconf
+ ./configure --prefix=/opt --disable-dependency-tracking --with-ssl --with-openssl --without-libssh2
+ make -j2
+ make install
+ - name: Prepare
+ run: |
+ cd http
+ make -f scripts/ci/Makefile php || make -f scripts/ci/Makefile clean php
+ make -f scripts/ci/Makefile pecl PECL=m6w6/ext-raphf.git:raphf:master
+ - name: Build
+ run: |
+ cd http
+ make -f scripts/ci/Makefile ext PECL=http
+ - name: Test
+ run: |
+ cd http
+ make -f scripts/ci/Makefile test
+
+ curl-7_71_1:
+ name: curl-7_71_1
+ continue-on-error: true
+ env:
+ PHP: "8.0"
+ CURL: "7_71_1"
+ enable_debug: "yes"
+ enable_iconv: "yes"
+ with_http_libcurl_dir: "/opt"
+ runs-on: ubuntu-18.04
+ steps:
+ - uses: actions/checkout@v2
+ with:
+ submodules: true
+ path: http
+ - uses: actions/checkout@v2
+ with:
+ repository: curl/curl
+ path: curl
+ ref: curl-7_71_1 #
+ - name: Install
+ run: |
+ echo 'deb-src http://azure.archive.ubuntu.com/ubuntu bionic main' | sudo tee -a /etc/apt/sources.list && \
+ echo 'deb-src http://azure.archive.ubuntu.com/ubuntu bionic-updates main' | sudo tee -a /etc/apt/sources.list && \
+ sudo apt-get update -y && \
+ sudo apt-get build-dep -y libcurl4-openssl-dev && \
+ sudo apt-get install -y \
+ php-cli \
+ php-pear \
+ libidn11-dev \
+ libidn2-0-dev \
+ libicu-dev \
+ libevent-dev \
+ libbrotli-dev \
+ re2c
+ - name: Curl
+ run: |
+ sudo chmod +x /usr/share/libtool/build-aux/ltmain.sh
+ sudo ln -s /usr/share/libtool/build-aux/ltmain.sh /usr/bin/libtool
+ cd curl
+ ./buildconf
+ ./configure --prefix=/opt --disable-dependency-tracking --with-ssl --with-openssl --without-libssh2
+ make -j2
+ make install
+ - name: Prepare
+ run: |
+ cd http
+ make -f scripts/ci/Makefile php || make -f scripts/ci/Makefile clean php
+ make -f scripts/ci/Makefile pecl PECL=m6w6/ext-raphf.git:raphf:master
+ - name: Build
+ run: |
+ cd http
+ make -f scripts/ci/Makefile ext PECL=http
+ - name: Test
+ run: |
+ cd http
+ make -f scripts/ci/Makefile test
+
+ curl-7_68_0:
+ name: curl-7_68_0
+ continue-on-error: true
+ env:
+ PHP: "8.0"
+ CURL: "7_68_0"
+ enable_debug: "yes"
+ enable_iconv: "yes"
+ with_http_libcurl_dir: "/opt"
+ runs-on: ubuntu-18.04
+ steps:
+ - uses: actions/checkout@v2
+ with:
+ submodules: true
+ path: http
+ - uses: actions/checkout@v2
+ with:
+ repository: curl/curl
+ path: curl
+ ref: curl-7_68_0 #
+ - name: Install
+ run: |
+ echo 'deb-src http://azure.archive.ubuntu.com/ubuntu bionic main' | sudo tee -a /etc/apt/sources.list && \
+ echo 'deb-src http://azure.archive.ubuntu.com/ubuntu bionic-updates main' | sudo tee -a /etc/apt/sources.list && \
+ sudo apt-get update -y && \
+ sudo apt-get build-dep -y libcurl4-openssl-dev && \
+ sudo apt-get install -y \
+ php-cli \
+ php-pear \
+ libidn11-dev \
+ libidn2-0-dev \
+ libicu-dev \
+ libevent-dev \
+ libbrotli-dev \
+ re2c
+ - name: Curl
+ run: |
+ sudo chmod +x /usr/share/libtool/build-aux/ltmain.sh
+ sudo ln -s /usr/share/libtool/build-aux/ltmain.sh /usr/bin/libtool
+ cd curl
+ ./buildconf
+ ./configure --prefix=/opt --disable-dependency-tracking --with-ssl --with-openssl --without-libssh2
+ make -j2
+ make install
+ - name: Prepare
+ run: |
+ cd http
+ make -f scripts/ci/Makefile php || make -f scripts/ci/Makefile clean php
+ make -f scripts/ci/Makefile pecl PECL=m6w6/ext-raphf.git:raphf:master
+ - name: Build
+ run: |
+ cd http
+ make -f scripts/ci/Makefile ext PECL=http
+ - name: Test
+ run: |
+ cd http
+ make -f scripts/ci/Makefile test
+
+ curl-7_67_0:
+ name: curl-7_67_0
+ continue-on-error: true
+ env:
+ PHP: "8.0"
+ CURL: "7_67_0"
+ enable_debug: "yes"
+ enable_iconv: "yes"
+ with_http_libcurl_dir: "/opt"
+ runs-on: ubuntu-18.04
+ steps:
+ - uses: actions/checkout@v2
+ with:
+ submodules: true
+ path: http
+ - uses: actions/checkout@v2
+ with:
+ repository: curl/curl
+ path: curl
+ ref: curl-7_67_0 #
+ - name: Install
+ run: |
+ echo 'deb-src http://azure.archive.ubuntu.com/ubuntu bionic main' | sudo tee -a /etc/apt/sources.list && \
+ echo 'deb-src http://azure.archive.ubuntu.com/ubuntu bionic-updates main' | sudo tee -a /etc/apt/sources.list && \
+ sudo apt-get update -y && \
+ sudo apt-get build-dep -y libcurl4-openssl-dev && \
+ sudo apt-get install -y \
+ php-cli \
+ php-pear \
+ libidn11-dev \
+ libidn2-0-dev \
+ libicu-dev \
+ libevent-dev \
+ libbrotli-dev \
+ re2c
+ - name: Curl
+ run: |
+ sudo chmod +x /usr/share/libtool/build-aux/ltmain.sh
+ sudo ln -s /usr/share/libtool/build-aux/ltmain.sh /usr/bin/libtool
+ cd curl
+ ./buildconf
+ ./configure --prefix=/opt --disable-dependency-tracking --with-ssl --with-openssl --without-libssh2
+ make -j2
+ make install
+ - name: Prepare
+ run: |
+ cd http
+ make -f scripts/ci/Makefile php || make -f scripts/ci/Makefile clean php
+ make -f scripts/ci/Makefile pecl PECL=m6w6/ext-raphf.git:raphf:master
+ - name: Build
+ run: |
+ cd http
+ make -f scripts/ci/Makefile ext PECL=http
+ - name: Test
+ run: |
+ cd http
+ make -f scripts/ci/Makefile test
+
+ curl-7_64_0:
+ name: curl-7_64_0
+ continue-on-error: true
+ env:
+ PHP: "8.0"
+ CURL: "7_64_0"
+ enable_debug: "yes"
+ enable_iconv: "yes"
+ with_http_libcurl_dir: "/opt"
+ runs-on: ubuntu-18.04
+ steps:
+ - uses: actions/checkout@v2
+ with:
+ submodules: true
+ path: http
+ - uses: actions/checkout@v2
+ with:
+ repository: curl/curl
+ path: curl
+ ref: curl-7_64_0 #
+ - name: Install
+ run: |
+ echo 'deb-src http://azure.archive.ubuntu.com/ubuntu bionic main' | sudo tee -a /etc/apt/sources.list && \
+ echo 'deb-src http://azure.archive.ubuntu.com/ubuntu bionic-updates main' | sudo tee -a /etc/apt/sources.list && \
+ sudo apt-get update -y && \
+ sudo apt-get build-dep -y libcurl4-openssl-dev && \
+ sudo apt-get install -y \
+ php-cli \
+ php-pear \
+ libidn11-dev \
+ libidn2-0-dev \
+ libicu-dev \
+ libevent-dev \
+ libbrotli-dev \
+ re2c
+ - name: Curl
+ run: |
+ sudo chmod +x /usr/share/libtool/build-aux/ltmain.sh
+ sudo ln -s /usr/share/libtool/build-aux/ltmain.sh /usr/bin/libtool
+ cd curl
+ ./buildconf
+ ./configure --prefix=/opt --disable-dependency-tracking --with-ssl --with-openssl --without-libssh2
+ make -j2
+ make install
+ - name: Prepare
+ run: |
+ cd http
+ make -f scripts/ci/Makefile php || make -f scripts/ci/Makefile clean php
+ make -f scripts/ci/Makefile pecl PECL=m6w6/ext-raphf.git:raphf:master
+ - name: Build
+ run: |
+ cd http
+ make -f scripts/ci/Makefile ext PECL=http
+ - name: Test
+ run: |
+ cd http
+ make -f scripts/ci/Makefile test
+
+ curl-7_61_1:
+ name: curl-7_61_1
+ continue-on-error: true
+ env:
+ PHP: "8.0"
+ CURL: "7_61_1"
+ enable_debug: "yes"
+ enable_iconv: "yes"
+ with_http_libcurl_dir: "/opt"
+ runs-on: ubuntu-18.04
+ steps:
+ - uses: actions/checkout@v2
+ with:
+ submodules: true
+ path: http
+ - uses: actions/checkout@v2
+ with:
+ repository: curl/curl
+ path: curl
+ ref: curl-7_61_1 #
+ - name: Install
+ run: |
+ echo 'deb-src http://azure.archive.ubuntu.com/ubuntu bionic main' | sudo tee -a /etc/apt/sources.list && \
+ echo 'deb-src http://azure.archive.ubuntu.com/ubuntu bionic-updates main' | sudo tee -a /etc/apt/sources.list && \
+ sudo apt-get update -y && \
+ sudo apt-get build-dep -y libcurl4-openssl-dev && \
+ sudo apt-get install -y \
+ php-cli \
+ php-pear \
+ libidn11-dev \
+ libidn2-0-dev \
+ libicu-dev \
+ libevent-dev \
+ libbrotli-dev \
+ re2c
+ - name: Curl
+ run: |
+ sudo chmod +x /usr/share/libtool/build-aux/ltmain.sh
+ sudo ln -s /usr/share/libtool/build-aux/ltmain.sh /usr/bin/libtool
+ cd curl
+ ./buildconf
+ ./configure --prefix=/opt --disable-dependency-tracking --with-ssl --with-openssl --without-libssh2
+ make -j2
+ make install
+ - name: Prepare
+ run: |
+ cd http
+ make -f scripts/ci/Makefile php || make -f scripts/ci/Makefile clean php
+ make -f scripts/ci/Makefile pecl PECL=m6w6/ext-raphf.git:raphf:master
+ - name: Build
+ run: |
+ cd http
+ make -f scripts/ci/Makefile ext PECL=http
+ - name: Test
+ run: |
+ cd http
+ make -f scripts/ci/Makefile test
+
+ curl-7_58_0:
+ name: curl-7_58_0
+ continue-on-error: true
+ env:
+ PHP: "8.0"
+ CURL: "7_58_0"
+ enable_debug: "yes"
+ enable_iconv: "yes"
+ with_http_libcurl_dir: "/opt"
+ runs-on: ubuntu-18.04
+ steps:
+ - uses: actions/checkout@v2
+ with:
+ submodules: true
+ path: http
+ - uses: actions/checkout@v2
+ with:
+ repository: curl/curl
+ path: curl
+ ref: curl-7_58_0 #
+ - name: Install
+ run: |
+ echo 'deb-src http://azure.archive.ubuntu.com/ubuntu bionic main' | sudo tee -a /etc/apt/sources.list && \
+ echo 'deb-src http://azure.archive.ubuntu.com/ubuntu bionic-updates main' | sudo tee -a /etc/apt/sources.list && \
+ sudo apt-get update -y && \
+ sudo apt-get build-dep -y libcurl4-openssl-dev && \
+ sudo apt-get install -y \
+ php-cli \
+ php-pear \
+ libidn11-dev \
+ libidn2-0-dev \
+ libicu-dev \
+ libevent-dev \
+ libbrotli-dev \
+ re2c
+ - name: Curl
+ run: |
+ sudo chmod +x /usr/share/libtool/build-aux/ltmain.sh
+ sudo ln -s /usr/share/libtool/build-aux/ltmain.sh /usr/bin/libtool
+ cd curl
+ ./buildconf
+ ./configure --prefix=/opt --disable-dependency-tracking --with-ssl --with-openssl --without-libssh2
+ make -j2
+ make install
+ - name: Prepare
+ run: |
+ cd http
+ make -f scripts/ci/Makefile php || make -f scripts/ci/Makefile clean php
+ make -f scripts/ci/Makefile pecl PECL=m6w6/ext-raphf.git:raphf:master
+ - name: Build
+ run: |
+ cd http
+ make -f scripts/ci/Makefile ext PECL=http
+ - name: Test
+ run: |
+ cd http
+ make -f scripts/ci/Makefile test
+
+ curl-7_52_1:
+ name: curl-7_52_1
+ continue-on-error: true
+ env:
+ PHP: "8.0"
+ CURL: "7_52_1"
+ enable_debug: "yes"
+ enable_iconv: "yes"
+ with_http_libcurl_dir: "/opt"
+ runs-on: ubuntu-18.04
+ steps:
+ - uses: actions/checkout@v2
+ with:
+ submodules: true
+ path: http
+ - uses: actions/checkout@v2
+ with:
+ repository: curl/curl
+ path: curl
+ ref: curl-7_52_1 #
+ - name: Install
+ run: |
+ echo 'deb-src http://azure.archive.ubuntu.com/ubuntu bionic main' | sudo tee -a /etc/apt/sources.list && \
+ echo 'deb-src http://azure.archive.ubuntu.com/ubuntu bionic-updates main' | sudo tee -a /etc/apt/sources.list && \
+ sudo apt-get update -y && \
+ sudo apt-get build-dep -y libcurl4-openssl-dev && \
+ sudo apt-get install -y \
+ php-cli \
+ php-pear \
+ libidn11-dev \
+ libidn2-0-dev \
+ libicu-dev \
+ libevent-dev \
+ libbrotli-dev \
+ re2c
+ - name: Curl
+ run: |
+ sudo chmod +x /usr/share/libtool/build-aux/ltmain.sh
+ sudo ln -s /usr/share/libtool/build-aux/ltmain.sh /usr/bin/libtool
+ cd curl
+ ./buildconf
+ ./configure --prefix=/opt --disable-dependency-tracking --with-ssl --with-openssl --without-libssh2
+ make -j2
+ make install
+ - name: Prepare
+ run: |
+ cd http
+ make -f scripts/ci/Makefile php || make -f scripts/ci/Makefile clean php
+ make -f scripts/ci/Makefile pecl PECL=m6w6/ext-raphf.git:raphf:master
+ - name: Build
+ run: |
+ cd http
+ make -f scripts/ci/Makefile ext PECL=http
+ - name: Test
+ run: |
+ cd http
+ make -f scripts/ci/Makefile test
+
+ curl-7_49_1:
+ name: curl-7_49_1
+ continue-on-error: true
+ env:
+ PHP: "8.0"
+ CURL: "7_49_1"
+ enable_debug: "yes"
+ enable_iconv: "yes"
+ with_http_libcurl_dir: "/opt"
+ runs-on: ubuntu-18.04
+ steps:
+ - uses: actions/checkout@v2
+ with:
+ submodules: true
+ path: http
+ - uses: actions/checkout@v2
+ with:
+ repository: curl/curl
+ path: curl
+ ref: curl-7_49_1 #
+ - name: Install
+ run: |
+ echo 'deb-src http://azure.archive.ubuntu.com/ubuntu bionic main' | sudo tee -a /etc/apt/sources.list && \
+ echo 'deb-src http://azure.archive.ubuntu.com/ubuntu bionic-updates main' | sudo tee -a /etc/apt/sources.list && \
+ sudo apt-get update -y && \
+ sudo apt-get build-dep -y libcurl4-openssl-dev && \
+ sudo apt-get install -y \
+ php-cli \
+ php-pear \
+ libidn11-dev \
+ libidn2-0-dev \
+ libicu-dev \
+ libevent-dev \
+ libbrotli-dev \
+ re2c
+ - name: Curl
+ run: |
+ sudo chmod +x /usr/share/libtool/build-aux/ltmain.sh
+ sudo ln -s /usr/share/libtool/build-aux/ltmain.sh /usr/bin/libtool
+ cd curl
+ ./buildconf
+ ./configure --prefix=/opt --disable-dependency-tracking --with-ssl --with-openssl --without-libssh2
+ make -j2
+ make install
+ - name: Prepare
+ run: |
+ cd http
+ make -f scripts/ci/Makefile php || make -f scripts/ci/Makefile clean php
+ make -f scripts/ci/Makefile pecl PECL=m6w6/ext-raphf.git:raphf:master
+ - name: Build
+ run: |
+ cd http
+ make -f scripts/ci/Makefile ext PECL=http
+ - name: Test
+ run: |
+ cd http
+ make -f scripts/ci/Makefile test
+
+ curl-7_31_0:
+ name: curl-7_31_0
+ continue-on-error: true
+ env:
+ PHP: "8.0"
+ CURL: "7_31_0"
+ enable_debug: "yes"
+ enable_iconv: "yes"
+ with_http_libcurl_dir: "/opt"
+ runs-on: ubuntu-18.04
+ steps:
+ - uses: actions/checkout@v2
+ with:
+ submodules: true
+ path: http
+ - uses: actions/checkout@v2
+ with:
+ repository: curl/curl
+ path: curl
+ ref: curl-7_31_0 #
+ - name: Install
+ run: |
+ echo 'deb-src http://azure.archive.ubuntu.com/ubuntu bionic main' | sudo tee -a /etc/apt/sources.list && \
+ echo 'deb-src http://azure.archive.ubuntu.com/ubuntu bionic-updates main' | sudo tee -a /etc/apt/sources.list && \
+ sudo apt-get update -y && \
+ sudo apt-get build-dep -y libcurl4-openssl-dev && \
+ sudo apt-get install -y \
+ php-cli \
+ php-pear \
+ libidn11-dev \
+ libidn2-0-dev \
+ libicu-dev \
+ libevent-dev \
+ libbrotli-dev \
+ re2c
+ - name: Curl
+ run: |
+ sudo chmod +x /usr/share/libtool/build-aux/ltmain.sh
+ sudo ln -s /usr/share/libtool/build-aux/ltmain.sh /usr/bin/libtool
+ cd curl
+ ./buildconf
+ ./configure --prefix=/opt --disable-dependency-tracking --with-ssl --with-openssl --without-libssh2
+ make -j2
+ make install
+ - name: Prepare
+ run: |
+ cd http
+ make -f scripts/ci/Makefile php || make -f scripts/ci/Makefile clean php
+ make -f scripts/ci/Makefile pecl PECL=m6w6/ext-raphf.git:raphf:master
+ - name: Build
+ run: |
+ cd http
+ make -f scripts/ci/Makefile ext PECL=http
+ - name: Test
+ run: |
+ cd http
+ make -f scripts/ci/Makefile test
+
+ curl-7_20_1:
+ name: curl-7_20_1
+ continue-on-error: true
+ env:
+ PHP: "8.0"
+ CURL: "7_20_1"
+ enable_debug: "yes"
+ enable_iconv: "yes"
+ with_http_libcurl_dir: "/opt"
+ runs-on: ubuntu-18.04
+ steps:
+ - uses: actions/checkout@v2
+ with:
+ submodules: true
+ path: http
+ - uses: actions/checkout@v2
+ with:
+ repository: curl/curl
+ path: curl
+ ref: curl-7_20_1 #
+ - name: Install
+ run: |
+ echo 'deb-src http://azure.archive.ubuntu.com/ubuntu bionic main' | sudo tee -a /etc/apt/sources.list && \
+ echo 'deb-src http://azure.archive.ubuntu.com/ubuntu bionic-updates main' | sudo tee -a /etc/apt/sources.list && \
+ sudo apt-get update -y && \
+ sudo apt-get build-dep -y libcurl4-openssl-dev && \
+ sudo apt-get install -y \
+ php-cli \
+ php-pear \
+ libidn11-dev \
+ libidn2-0-dev \
+ libicu-dev \
+ libevent-dev \
+ libbrotli-dev \
+ re2c
+ - name: Curl
+ run: |
+ sudo chmod +x /usr/share/libtool/build-aux/ltmain.sh
+ sudo ln -s /usr/share/libtool/build-aux/ltmain.sh /usr/bin/libtool
+ cd curl
+ ./buildconf
+ ./configure --prefix=/opt --disable-dependency-tracking --with-ssl --with-openssl --without-libssh2
+ make -j2
+ make install
+ - name: Prepare
+ run: |
+ cd http
+ make -f scripts/ci/Makefile php || make -f scripts/ci/Makefile clean php
+ make -f scripts/ci/Makefile pecl PECL=m6w6/ext-raphf.git:raphf:master
+ - name: Build
+ run: |
+ cd http
+ make -f scripts/ci/Makefile ext PECL=http
+ - name: Test
+ run: |
+ cd http
+ make -f scripts/ci/Makefile test
+
+ curl-7_19_7:
+ name: curl-7_19_7
+ continue-on-error: true
+ env:
+ PHP: "8.0"
+ CURL: "7_19_7"
+ enable_debug: "yes"
+ enable_iconv: "yes"
+ with_http_libcurl_dir: "/opt"
+ runs-on: ubuntu-18.04
+ steps:
+ - uses: actions/checkout@v2
+ with:
+ submodules: true
+ path: http
+ - uses: actions/checkout@v2
+ with:
+ repository: curl/curl
+ path: curl
+ ref: curl-7_19_7 #
+ - name: Install
+ run: |
+ echo 'deb-src http://azure.archive.ubuntu.com/ubuntu bionic main' | sudo tee -a /etc/apt/sources.list && \
+ echo 'deb-src http://azure.archive.ubuntu.com/ubuntu bionic-updates main' | sudo tee -a /etc/apt/sources.list && \
+ sudo apt-get update -y && \
+ sudo apt-get build-dep -y libcurl4-openssl-dev && \
+ sudo apt-get install -y \
+ php-cli \
+ php-pear \
+ libidn11-dev \
+ libidn2-0-dev \
+ libicu-dev \
+ libevent-dev \
+ libbrotli-dev \
+ re2c
+ - name: Curl
+ run: |
+ sudo chmod +x /usr/share/libtool/build-aux/ltmain.sh
+ sudo ln -s /usr/share/libtool/build-aux/ltmain.sh /usr/bin/libtool
+ cd curl
+ ./buildconf
+ ./configure --prefix=/opt --disable-dependency-tracking --with-ssl --with-openssl --without-libssh2
+ make -j2
+ make install
+ - name: Prepare
+ run: |
+ cd http
+ make -f scripts/ci/Makefile php || make -f scripts/ci/Makefile clean php
+ make -f scripts/ci/Makefile pecl PECL=m6w6/ext-raphf.git:raphf:master
+ - name: Build
+ run: |
+ cd http
+ make -f scripts/ci/Makefile ext PECL=http
+ - name: Test
+ run: |
+ cd http
+ make -f scripts/ci/Makefile test
+
+ curl-7_18_2:
+ name: curl-7_18_2
+ continue-on-error: true
+ env:
+ PHP: "8.0"
+ CURL: "7_18_2"
+ enable_debug: "yes"
+ enable_iconv: "yes"
+ with_http_libcurl_dir: "/opt"
+ runs-on: ubuntu-18.04
+ steps:
+ - uses: actions/checkout@v2
+ with:
+ submodules: true
+ path: http
+ - uses: actions/checkout@v2
+ with:
+ repository: curl/curl
+ path: curl
+ ref: curl-7_18_2 #
+ - name: Install
+ run: |
+ echo 'deb-src http://azure.archive.ubuntu.com/ubuntu bionic main' | sudo tee -a /etc/apt/sources.list && \
+ echo 'deb-src http://azure.archive.ubuntu.com/ubuntu bionic-updates main' | sudo tee -a /etc/apt/sources.list && \
+ sudo apt-get update -y && \
+ sudo apt-get build-dep -y libcurl4-openssl-dev && \
+ sudo apt-get install -y \
+ php-cli \
+ php-pear \
+ libidn11-dev \
+ libidn2-0-dev \
+ libicu-dev \
+ libevent-dev \
+ libbrotli-dev \
+ re2c
+ - name: Curl
+ run: |
+ sudo chmod +x /usr/share/libtool/build-aux/ltmain.sh
+ sudo ln -s /usr/share/libtool/build-aux/ltmain.sh /usr/bin/libtool
+ cd curl
+ ./buildconf
+ ./configure --prefix=/opt --disable-dependency-tracking --with-ssl --with-openssl --without-libssh2
+ make -j2
+ make install
+ - name: Prepare
+ run: |
+ cd http
+ make -f scripts/ci/Makefile php || make -f scripts/ci/Makefile clean php
+ make -f scripts/ci/Makefile pecl PECL=m6w6/ext-raphf.git:raphf:master
+ - name: Build
+ run: |
+ cd http
+ make -f scripts/ci/Makefile ext PECL=http
+ - name: Test
+ run: |
+ cd http
+ make -f scripts/ci/Makefile test
+
AC_DEFUN([PECL_CHECK_LIBBROTLI], [
+ dnl config.m4 calls PECL_CHECK_DONE once more
+ PECL_COUNT_CHECKS([+1])
+ PECL_SAVE_ENV([CPPFLAGS], [libbrotli])
+ PECL_SAVE_ENV([LDFLAGS], [libbrotli])
+ PECL_SAVE_ENV([LIBS], [libbrotli])
+
PECL_CHECK_LIBBROTLI_COMMON([$1], [$2])
PECL_CHECK_DONE(libbrotlicommon, [$PECL_VAR([HAVE_LIBBROTLI_COMMON])])
PECL_CHECK_LIBBROTLI_DEC([$1], [$2])
fi
fi
])
+
+ PECL_HAVE_CONST([curl/curl.h], [CURL_LOCK_DATA_SSL_SESSION], int, [
+ AC_CACHE_CHECK([whether curl_share accepts CURL_LOCK_DATA_SSL_SESSION], PECL_CACHE_VAR([LIBCURL_SHARE_SSL]), [
+ PECL_CACHE_VAR([LIBCURL_SHARE_SSL])=
+ AC_TRY_RUN([
+ #include <curl/curl.h>
+ int main(int argc, char *argv[]) {
+ CURLSH *ch = curl_share_init();
+ return curl_share_setopt(ch, CURLSHOPT_SHARE, CURL_LOCK_DATA_SSL_SESSION);
+ }
+ ], [
+ PECL_CACHE_VAR([LIBCURL_SHARE_SSL])=yes
+ ], [
+ PECL_CACHE_VAR([LIBCURL_SHARE_SSL])=no
+ ])
+ ])
+ if test "$PECL_CACHE_VAR([LIBCURL_SHARE_SSL])" = yes; then
+ PECL_DEFINE([HAVE_LIBCURL_SHARE_SSL], [1])
+ fi
+ ])
+
+ if test "$PECL_VAR([LIBCURL_SSLLIB])" == "OpenSSL"; then
+ PECL_HAVE_CONST([curl/curl.h], [CURLOPT_TLS13_CIPHERS], int, [
+ AC_CACHE_CHECK([whether curl_easy_setopt accepts CURLOPT_TLS13_CIPHERS], PECL_CACHE_VAR([LIBCURL_TLS13_CIPHERS]), [
+ PECL_CACHE_VAR([LIBCURL_TLS13_CIPHERS])=
+ AC_TRY_RUN([
+ #include <curl/curl.h>
+ int main(int argc, char *argv[]) {
+ CURL *ch = curl_easy_init();
+ return curl_easy_setopt(ch, CURLSHOPT_TLS13_CIPHERS, "");
+ }
+ ], [
+ PECL_CACHE_VAR([LIBCURL_TLS13_CIPHERS])=yes
+ ], [
+ PECL_CACHE_VAR([LIBCURL_TLS13_CIPHERS])=no
+ ])
+ ])
+ if test "$PECL_CACHE_VAR([LIBCURL_TLS13_CIPHERS])" = yes; then
+ PECL_DEFINE([HAVE_LIBCURL_TLS13_CIPHERS], [1])
+ fi
+ ])
+ fi
])
])
dnl
$1=$PECL_SAVE_VAR([$2_$1])
])
dnl
+dnl PECL_COUNT_CHECKS(incdec)
+dnl
+AC_DEFUN([PECL_COUNT_CHECKS], [
+ PECL_VAR([_checks])=$(($PECL_VAR([_checks])$1))
+])
+dnl
dnl PECL_EVAL_LIBLINE(libline)
dnl
AC_DEFUN([PECL_EVAL_LIBLINE], [
dnl PECL_CHECK_CUSTOM(name, path, header, lib, version)
dnl
AC_DEFUN([PECL_CHECK_CUSTOM], [
+ PECL_COUNT_CHECKS([+1])
PECL_SAVE_ENV([CPPFLAGS], [$1])
PECL_SAVE_ENV([LDFLAGS], [$1])
PECL_SAVE_ENV([LIBS], [$1])
done
])
if test -n "$PECL_CACHE_VAR([$1_prefix])"; then
- CPPFLAGS="-I$PECL_CACHE_VAR([$1_prefix])/include"
- LDFLAGS="-L$PECL_CACHE_VAR([$1_prefix])/$PHP_LIBDIR"
- LIBS="-l$4"
- PECL_EVAL_LIBLINE([$LDFLAGS $LIBS])
+ CPPFLAGS="$CPPFLAGS -I$PECL_CACHE_VAR([$1_prefix])/include"
+ LDFLAGS="$LDFLAGS -L$PECL_CACHE_VAR([$1_prefix])/$PHP_LIBDIR"
+ LIBS="$LIBS -l$4"
+ dnl PECL_EVAL_LIBLINE([$LDFLAGS $LIBS])
AC_CACHE_VAL(PECL_CACHE_VAR([$1_version]), [
pushd $PECL_CACHE_VAR([$1_prefix]) >/dev/null
dnl PECL_CHECK_CONFIG(name, prog-config, version-flag, cppflags-flag, ldflags-flag, libs-flag)
dnl
AC_DEFUN([PECL_CHECK_CONFIG], [
+ PECL_COUNT_CHECKS([+1])
PECL_SAVE_ENV([CPPFLAGS], [$1])
PECL_SAVE_ENV([LDFLAGS], [$1])
PECL_SAVE_ENV([LIBS], [$1])
-
AC_MSG_CHECKING([for $1])
ifelse($2, [$PKG_CONFIG $1], [
AC_CACHE_VAL(PECL_CACHE_VAR([$1_exists]), [
AC_CACHE_VAL(PECL_CACHE_VAR([$1_cppflags]), [
PECL_CACHE_VAR([$1_cppflags])=$($2 $4)
])
- CPPFLAGS=$PECL_CACHE_VAR([$1_cppflags])
+ CPPFLAGS="$CPPFLAGS $PECL_CACHE_VAR([$1_cppflags])"
AC_CACHE_VAL(PECL_CACHE_VAR([$1_ldflags]), [
PECL_CACHE_VAR([$1_ldflags])=$($2 $5)
])
- LDFLAGS=$PECL_CACHE_VAR([$1_ldflags])
+ LDFLAGS="$LDFLAGS $PECL_CACHE_VAR([$1_ldflags])"
AC_CACHE_VAL(PECL_CACHE_VAR([$1_libs]), [
PECL_CACHE_VAR([$1_libs])=$($2 $6)
])
- LIBS=$PECL_CACHE_VAR([$1_libs])
- PECL_EVAL_LIBLINE([$LDFLAGS $LIBS])
+ LIBS="$LIBS $PECL_CACHE_VAR([$1_libs])"
+ dnl PECL_EVAL_LIBLINE([$LDFLAGS $LIBS])
ifelse($2, [$PKG_CONFIG $1], [
fi
])
+ AC_MSG_RESULT([${PECL_CHECKED_VERSION([$1]):-no}])
+
if test -n "$PECL_CHECKED_VERSION([$1])"; then
PECL_VAR([HAVE_$1])=true
PECL_DEFINE([HAVE_$1])
else
PECL_VAR([HAVE_$1])=false
fi
-
- AC_MSG_RESULT([${PECL_CHECKED_VERSION([$1]):-no}])
])
dnl
dnl PECL_CHECK_PKGCONFIG(pkg[, additional-pkg-config-path])
dnl PECL_CHECK_DONE(name, success[, incline, libline])
dnl
AC_DEFUN([PECL_CHECK_DONE], [
- if $2; then
- incline=$CPPFLAGS
- libline="$LDFLAGS $LIBS"
+ PECL_COUNT_CHECKS([-1])
+ success=$2
+ if $success && test -n "$LDFLAGS$LIBS"; then
+ AC_MSG_CHECKING([whether $1 can be linked])
+ AC_TRY_LINK([], [], [success=yes], [success=no])
+ AC_MSG_RESULT([$success])
+ if ! $success; then
+ AC_MSG_WARN([$1 was found, but fails to link with:])
+ AC_MSG_WARN([ LDFLAGS='$LDFLAGS'])
+ AC_MSG_WARN([ LIBS='$LIBS'])
+ AC_MSG_WARN([Missing or updated library paths?])
+ fi
+ fi
+ if $success; then
+ _cppflags=$PECL_SAVE_VAR([$1_CPPFLAGS])
+ _ldflags=$PECL_SAVE_VAR([$1_LDFLAGS])
+ _libs=$PECL_SAVE_VAR([$1_LIBS])
+ incline=${CPPFLAGS:${#_cppflags}}
+ libline=["${LDFLAGS:${#_ldflags}} ${LIBS:${#_libs}}"]
PECL_DEFINE([HAVE_$1])
else
incline=$3
AC_CHECK_LIB(nsl, getdomainname)
])
AC_CHECK_FUNCS(mbrtowc mbtowc iswalnum inet_pton)
+
+ CFLAGS="$CFLAGS -Wno-strict-prototypes"
dnl ZLIB
PHP_ARG_WITH([http-zlib-dir], [whether/where to check for zlib],
--- /dev/null
+# current is 7.78.0 ATM
+# 7.21.5-7.29.0 fail to configure on gh actions
+
+alpine: 7.78.0 7.67.0
+centos: 7.61.1 # 7.29.0
+debian: 7.74.0 7.64.0 7.52.1
+fedora: 7.78.0 7.76.1 7.71.1
+other: 7.49.1 7.31.0
+ubuntu: 7.74.0 7.68.0 7.58.0
+
+# always test against a few recent
+latest: master 7.78.0 7.77.0 7.76.1
+oldest: 7.18.2 7.19.7 7.20.1
+
+# 7.64.1 fails client tests because of superfluous infof() calls
+# 7.64.0 fails client cookie test because of curl/curl#3613
--- /dev/null
+#!/usr/bin/env php
+<?php echo "# generated file; do not edit!\n"; ?>
+
+name: curl-matrix
+on:
+ workflow_dispatch:
+ push:
+
+jobs:
+<?php
+
+if ($argc > 1) {
+ $curlver = array_map(fn($v) => strtr($v, ".", "_"), array_unique(array_slice($argv, 1)));
+} else {
+ $curlver = array_unique(
+ iterator_to_array(
+ (function() {
+ $split = function($sep, $subject, $def = [""]) {
+ return array_filter(array_map("trim", explode($sep, $subject))) + $def;
+ };
+ foreach (file(__DIR__."/curlver.dist") as $line) {
+ $rec = $split(":", $split("#", $line)[0]);
+ if (!empty($rec[1])) foreach ($split(" ", $rec[1], []) as $dist_ver) {
+ yield strtr($dist_ver, ".", "_");
+ }
+ }
+ })()
+ )
+ );
+}
+
+rsort($curlver, SORT_NATURAL);
+
+$gen = include __DIR__ . "/ci/gen-matrix.php";
+$job = $gen->github([
+"curl" => [
+ "PHP" => "8.0",
+ "CURL" => $curlver,
+ "enable_debug" => "yes",
+ "enable_iconv" => "yes",
+ "with_http_libcurl_dir" => "/opt",
+]]);
+foreach ($job as $id => $env) {
+ printf(" curl-%s:\n", $env["CURL"]);
+ printf(" name: curl-%s\n", $env["CURL"]);
+ printf(" continue-on-error: true\n");
+ printf(" env:\n");
+ foreach ($env as $key => $val) {
+ printf(" %s: \"%s\"\n", $key, $val);
+ }
+?>
+ runs-on: ubuntu-18.04
+ steps:
+ - uses: actions/checkout@v2
+ with:
+ submodules: true
+ path: http
+ - uses: actions/checkout@v2
+ with:
+ repository: curl/curl
+ path: curl
+<?php if ($env["CURL"] !== "master") : ?>
+ ref: curl-<?=$env["CURL"]?> #
+<?php endif; ?>
+ - name: Install
+ run: |
+ echo 'deb-src http://azure.archive.ubuntu.com/ubuntu bionic main' | sudo tee -a /etc/apt/sources.list && \
+ echo 'deb-src http://azure.archive.ubuntu.com/ubuntu bionic-updates main' | sudo tee -a /etc/apt/sources.list && \
+ sudo apt-get update -y && \
+ sudo apt-get build-dep -y libcurl4-openssl-dev && \
+ sudo apt-get install -y \
+ php-cli \
+ php-pear \
+ libidn11-dev \
+ libidn2-0-dev \
+ libicu-dev \
+ libevent-dev \
+ libbrotli-dev \
+ re2c
+ - name: Curl
+ run: |
+ sudo chmod +x /usr/share/libtool/build-aux/ltmain.sh
+ sudo ln -s /usr/share/libtool/build-aux/ltmain.sh /usr/bin/libtool
+ cd curl
+ ./buildconf
+ ./configure --prefix=/opt --disable-dependency-tracking --with-ssl --with-openssl --without-libssh2
+ make -j2
+ make install
+ - name: Prepare
+ run: |
+ cd http
+ make -f scripts/ci/Makefile php || make -f scripts/ci/Makefile clean php
+ make -f scripts/ci/Makefile pecl PECL=m6w6/ext-raphf.git:raphf:master
+ - name: Build
+ run: |
+ cd http
+ make -f scripts/ci/Makefile ext PECL=http
+ - name: Test
+ run: |
+ cd http
+ make -f scripts/ci/Makefile test
+
+<?php
+}
return FAILURE;
}
+ZEND_RESULT_CODE php_http_client_requeue(php_http_client_t *h, php_http_message_t *request)
+{
+ if (h->ops->dequeue) {
+ php_http_client_enqueue_t *enqueue = php_http_client_enqueued(h, request, NULL);
+
+ if (!enqueue) {
+ php_error_docref(NULL, E_WARNING, "Failed to requeue request; request not in queue");
+ return FAILURE;
+ }
+ return h->ops->requeue(h, enqueue);
+ }
+ return FAILURE;
+}
+
php_http_client_enqueue_t *php_http_client_enqueued(php_http_client_t *h, void *compare_arg, php_http_client_enqueue_cmp_func_t compare_func)
{
zend_llist_element *el = NULL;
RETVAL_ZVAL(getThis(), 1, 0);
}
-static HashTable *combined_options(zval *client, zval *request)
+static HashTable *combined_options(HashTable *options, zval *client, zval *request)
{
- HashTable *options;
unsigned num_options = 0;
zval z_roptions, z_options_tmp, *z_coptions = zend_read_property(php_http_client_class_entry, Z_OBJ_P(client), ZEND_STRL("options"), 0, &z_options_tmp);
num_options = num;
}
}
- ALLOC_HASHTABLE(options);
- ZEND_INIT_SYMTABLE_EX(options, num_options, 0);
+ if (options) {
+ zend_hash_clean(options);
+ } else {
+ ALLOC_HASHTABLE(options);
+ ZEND_INIT_SYMTABLE_EX(options, num_options, 0);
+ }
if (Z_TYPE_P(z_coptions) == IS_ARRAY) {
array_copy(Z_ARRVAL_P(z_coptions), options);
}
Z_ADDREF_P(request);
q.request = msg_obj->message;
- q.options = combined_options(getThis(), request);
+ q.options = combined_options(NULL, getThis(), request);
q.dtor = msg_queue_dtor;
q.opaque = msg_obj;
q.closure.fci = fci;
zend_fcall_info_cache fcc = empty_fcall_info_cache;
php_http_client_object_t *obj;
php_http_message_object_t *msg_obj;
- php_http_client_enqueue_t q;
+ php_http_client_enqueue_t q, *e;
php_http_expect(SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS(), "O|f", &request, php_http_get_client_request_class_entry(), &fci, &fcc), invalid_arg, return);
obj = PHP_HTTP_OBJ(NULL, getThis());
msg_obj = PHP_HTTP_OBJ(NULL, request);
- if (php_http_client_enqueued(obj->client, msg_obj->message, NULL)) {
- php_http_expect(SUCCESS == php_http_client_dequeue(obj->client, msg_obj->message), runtime, return);
+ if ((e = php_http_client_enqueued(obj->client, msg_obj->message, NULL))) {
+ combined_options(e->options, getThis(), request);
+ php_http_expect(SUCCESS == php_http_client_requeue(obj->client, msg_obj->message), runtime, return);
+ if (fci.size) {
+ if (e->closure.fci.size) {
+ zval_ptr_dtor(&e->closure.fci.function_name);
+ if (e->closure.fci.object) {
+ zend_object_release(e->closure.fci.object);
+ }
+ }
+ Z_TRY_ADDREF(fci.function_name);
+ if (fci.object) {
+ GC_ADDREF(fci.object);
+ }
+ }
+ RETURN_ZVAL(getThis(), 1, 0);
}
q.request = msg_obj->message;
- q.options = combined_options(getThis(), request);
+ q.options = combined_options(NULL, getThis(), request);
q.dtor = msg_queue_dtor;
q.opaque = msg_obj;
q.closure.fci = fci;
typedef ZEND_RESULT_CODE (*php_http_client_wait_func_t)(struct php_http_client *p, struct timeval *custom_timeout);
typedef ZEND_RESULT_CODE (*php_http_client_enqueue_func_t)(struct php_http_client *p, php_http_client_enqueue_t *enqueue);
typedef ZEND_RESULT_CODE (*php_http_client_dequeue_func_t)(struct php_http_client *p, php_http_client_enqueue_t *enqueue);
+typedef ZEND_RESULT_CODE (*php_http_client_requeue_func_t)(struct php_http_client *p, php_http_client_enqueue_t *enqueue);
typedef ZEND_RESULT_CODE (*php_http_client_setopt_func_t)(struct php_http_client *p, php_http_client_setopt_opt_t opt, void *arg);
typedef ZEND_RESULT_CODE (*php_http_client_getopt_func_t)(struct php_http_client *h, php_http_client_getopt_opt_t opt, void *arg, void **res);
php_http_client_once_func_t once;
php_http_client_enqueue_func_t enqueue;
php_http_client_dequeue_func_t dequeue;
+ php_http_client_requeue_func_t requeue;
php_http_client_setopt_func_t setopt;
php_http_client_getopt_func_t getopt;
} php_http_client_ops_t;
#if PHP_HTTP_HAVE_LIBCURL
+#define DEBUG_COOKIES 0
+
#if PHP_HTTP_HAVE_LIBCURL_OPENSSL
# include <openssl/ssl.h>
#endif
return FAILURE;
}
if (Z_TYPE_P(val) == IS_TRUE) {
+#if DEBUG_COOKIES
+ fprintf(stderr, "CURLOPT_COOKIELIST: SESS\n");
+#endif
if (CURLE_OK != curl_easy_setopt(ch, CURLOPT_COOKIELIST, "SESS")) {
return FAILURE;
}
} else {
storage->cookiestore = NULL;
}
- if ( CURLE_OK != curl_easy_setopt(ch, CURLOPT_COOKIEFILE, storage->cookiestore ? storage->cookiestore : "")
- || CURLE_OK != curl_easy_setopt(ch, CURLOPT_COOKIEJAR, storage->cookiestore)
- ) {
+
+#if DEBUG_COOKIES
+ fprintf(stderr, "CURLOPT_COOKIEFILE: %s\n", storage->cookiestore);
+#endif
+ // does NOT enable ch->data.cookies until transfer; adds to ch->stsate.cookielist
+ if (CURLE_OK != curl_easy_setopt(ch, CURLOPT_COOKIEFILE, storage->cookiestore ? storage->cookiestore : "")) {
+ return FAILURE;
+ }
+#if DEBUG_COOKIES
+ fprintf(stderr, "CURLOPT_COOKIEJAR: %s\n", storage->cookiestore);
+#endif
+ // enables ch->data.cookies
+ if (CURLE_OK != curl_easy_setopt(ch, CURLOPT_COOKIEJAR, storage->cookiestore)) {
return FAILURE;
}
opt->flags |= PHP_HTTP_CURLE_OPTION_IGNORE_RC;
}
#endif
-#if PHP_HTTP_CURL_VERSION(7,61,0)
+#if PHP_HTTP_CURL_VERSION(7,61,0) && PHP_HTTP_HAVE_LIBCURL_TLS13_CIPHERS
if ((opt = php_http_option_register(ssl_registry, ZEND_STRL("tls13_ciphers"), CURLOPT_TLS13_CIPHERS, IS_STRING))) {
opt->flags |= PHP_HTTP_CURLE_OPTION_CHECK_STRLEN;
}
opt->flags |= PHP_HTTP_CURLE_OPTION_CHECK_BASEDIR;
}
# endif
-# if PHP_HTTP_CURL_VERSION(7,61,0)
+# if PHP_HTTP_CURL_VERSION(7,61,0) && PHP_HTTP_HAVE_LIBCURL_TLS13_CIPHERS
if ((opt = php_http_option_register(proxy_registry, ZEND_STRL("tls13_ciphers"), CURLOPT_PROXY_TLS13_CIPHERS, IS_STRING))) {
opt->flags |= PHP_HTTP_CURLE_OPTION_CHECK_STRLEN;
}
return SUCCESS;
}
-#if PHP_HTTP_CURL_VERSION(7,23,0)
+#if PHP_HTTP_HAVE_LIBCURL_SHARE_SSL
static ZEND_RESULT_CODE php_http_curlm_option_set_share_ssl(php_http_option_t *opt, zval *value, void *userdata)
{
php_http_client_t *client = userdata;
opt->setter = php_http_curlm_option_set_share_cookies;
ZVAL_TRUE(&opt->defval);
}
-#if PHP_HTTP_CURL_VERSION(7,23,0)
+#if PHP_HTTP_HAVE_LIBCURL_SHARE_SSL
if ((opt = php_http_option_register(registry, ZEND_STRL("share_ssl"), 0, _IS_BOOL))) {
opt->setter = php_http_curlm_option_set_share_ssl;
ZVAL_TRUE(&opt->defval);
/* client ops */
-static ZEND_RESULT_CODE php_http_client_curl_handler_reset(php_http_client_curl_handler_t *curl)
+static ZEND_RESULT_CODE php_http_client_curl_handler_reset(php_http_client_curl_handler_t *handler)
{
- CURL *ch = curl->handle;
+ php_http_client_curl_t *curl = handler->client->ctx;
+ CURL *ch = handler->handle;
php_http_curle_storage_t *st;
if ((st = php_http_curle_get_storage(ch))) {
#endif
#if PHP_HTTP_CURL_VERSION(7,21,3)
- if (curl->options.resolve) {
- curl_slist_free_all(curl->options.resolve);
- curl->options.resolve = NULL;
+ if (handler->options.resolve) {
+ curl_slist_free_all(handler->options.resolve);
+ handler->options.resolve = NULL;
}
#endif
- curl->options.retry.count = 0;
- curl->options.retry.delay = 0;
- curl->options.redirects = 0;
- curl->options.encode_cookies = 1;
+ handler->options.retry.count = 0;
+ handler->options.retry.delay = 0;
+ handler->options.redirects = 0;
+ handler->options.encode_cookies = 1;
- if (curl->options.headers) {
- curl_slist_free_all(curl->options.headers);
- curl->options.headers = NULL;
+ if (handler->options.headers) {
+ curl_slist_free_all(handler->options.headers);
+ handler->options.headers = NULL;
}
- if (curl->options.proxyheaders) {
- curl_slist_free_all(curl->options.proxyheaders);
- curl->options.proxyheaders = NULL;
+ if (handler->options.proxyheaders) {
+ curl_slist_free_all(handler->options.proxyheaders);
+ handler->options.proxyheaders = NULL;
}
- php_http_buffer_reset(&curl->options.cookies);
- php_http_buffer_reset(&curl->options.ranges);
+ php_http_buffer_reset(&handler->options.cookies);
+ php_http_buffer_reset(&handler->options.ranges);
+
+ if (php_http_message_body_size(handler->response.body)) {
+ php_http_message_body_free(&handler->response.body);
+ handler->response.body = php_http_message_body_init(NULL, NULL);
+ }
+ php_http_buffer_reset(&handler->response.headers);
+
+#if ZTS
+ curl_easy_setopt(ch, CURLOPT_NOSIGNAL, 1L);
+#endif
+ curl_easy_setopt(ch, CURLOPT_HEADER, 0L);
+ curl_easy_setopt(ch, CURLOPT_FILETIME, 1L);
+ curl_easy_setopt(ch, CURLOPT_AUTOREFERER, 1L);
+ curl_easy_setopt(ch, CURLOPT_VERBOSE, 1L);
+ curl_easy_setopt(ch, CURLOPT_NOPROGRESS, 0L);
+ curl_easy_setopt(ch, CURLOPT_HEADERFUNCTION, php_http_curle_header_callback);
+ curl_easy_setopt(ch, CURLOPT_WRITEFUNCTION, php_http_curle_body_callback);
+ curl_easy_setopt(ch, CURLOPT_DEBUGFUNCTION, php_http_curle_raw_callback);
+ curl_easy_setopt(ch, CURLOPT_READFUNCTION, php_http_curle_read_callback);
+ curl_easy_setopt(ch, CURLOPT_SEEKFUNCTION, php_http_curle_seek_callback);
+#if PHP_HTTP_CURL_VERSION(7,32,0)
+ curl_easy_setopt(ch, CURLOPT_XFERINFOFUNCTION, php_http_curle_xferinfo_callback);
+ curl_easy_setopt(ch, CURLOPT_XFERINFODATA, handler);
+#else
+ curl_easy_setopt(ch, CURLOPT_PROGRESSFUNCTION, php_http_curle_progress_callback);
+ curl_easy_setopt(ch, CURLOPT_PROGRESSDATA, handler);
+#endif
+ curl_easy_setopt(ch, CURLOPT_DEBUGDATA, handler);
+ curl_easy_setopt(ch, CURLOPT_WRITEDATA, handler);
+ curl_easy_setopt(ch, CURLOPT_HEADERDATA, handler);
+#if DEBUG_COOKIES
+ fprintf(stderr, "CURLOPT_SHARE: %p\n", curl->handle->share);
+#endif
+ curl_easy_setopt(ch, CURLOPT_SHARE, curl->handle->share);
return SUCCESS;
}
static php_http_client_curl_handler_t *php_http_client_curl_handler_init(php_http_client_t *h, php_resource_factory_t *rf)
{
void *handle;
- php_http_client_curl_t *curl = h->ctx;
php_http_client_curl_handler_t *handler;
if (!(handle = php_resource_factory_handle_ctor(rf, NULL))) {
php_http_buffer_init(&handler->options.ranges);
zend_hash_init(&handler->options.cache, 0, NULL, ZVAL_PTR_DTOR, 0);
-#if ZTS
- curl_easy_setopt(handle, CURLOPT_NOSIGNAL, 1L);
-#endif
- curl_easy_setopt(handle, CURLOPT_HEADER, 0L);
- curl_easy_setopt(handle, CURLOPT_FILETIME, 1L);
- curl_easy_setopt(handle, CURLOPT_AUTOREFERER, 1L);
- curl_easy_setopt(handle, CURLOPT_VERBOSE, 1L);
- curl_easy_setopt(handle, CURLOPT_NOPROGRESS, 0L);
- curl_easy_setopt(handle, CURLOPT_HEADERFUNCTION, php_http_curle_header_callback);
- curl_easy_setopt(handle, CURLOPT_WRITEFUNCTION, php_http_curle_body_callback);
- curl_easy_setopt(handle, CURLOPT_DEBUGFUNCTION, php_http_curle_raw_callback);
- curl_easy_setopt(handle, CURLOPT_READFUNCTION, php_http_curle_read_callback);
- curl_easy_setopt(handle, CURLOPT_SEEKFUNCTION, php_http_curle_seek_callback);
-#if PHP_HTTP_CURL_VERSION(7,32,0)
- curl_easy_setopt(handle, CURLOPT_XFERINFOFUNCTION, php_http_curle_xferinfo_callback);
- curl_easy_setopt(handle, CURLOPT_XFERINFODATA, handler);
-#else
- curl_easy_setopt(handle, CURLOPT_PROGRESSFUNCTION, php_http_curle_progress_callback);
- curl_easy_setopt(handle, CURLOPT_PROGRESSDATA, handler);
-#endif
- curl_easy_setopt(handle, CURLOPT_DEBUGDATA, handler);
- curl_easy_setopt(handle, CURLOPT_WRITEDATA, handler);
- curl_easy_setopt(handle, CURLOPT_HEADERDATA, handler);
- curl_easy_setopt(handle, CURLOPT_SHARE, curl->handle->share);
-
php_http_client_curl_handler_reset(handler);
return handler;
#endif
curl_easy_setopt(handler->handle, CURLOPT_VERBOSE, 0L);
curl_easy_setopt(handler->handle, CURLOPT_DEBUGFUNCTION, NULL);
+ /* see gh issue #84 */
+#if DEBUG_COOKIES
+ fprintf(stderr, "CURLOPT_COOKIELIST: FLUSH\n");
+ fprintf(stderr, "CURLOPT_SHARE: (null)\n");
+#endif
curl_easy_setopt(handler->handle, CURLOPT_COOKIELIST, "FLUSH");
curl_easy_setopt(handler->handle, CURLOPT_SHARE, NULL);
- /* see gh issue #84 */
#if PHP_HTTP_CURL_VERSION(7,63,0) && !PHP_HTTP_CURL_VERSION(7,65,0)
- curl_easy_setopt(handler->handle, CURLOPT_COOKIEJAR, NULL);
+ {
+ php_http_curle_storage_t *st = php_http_curle_get_storage(handler->handle);
+ curl_easy_setopt(handler->handle, CURLOPT_COOKIEJAR, st ? st->cookiestore : NULL);
+ }
#endif
}
php_http_client_curl_handler_dtor(handler);
}
+static void retire_ch(php_persistent_handle_factory_t *f, void **handle)
+{
+ CURL *ch = *handle;
+ /* erase all cookies */
+ if (ch) {
+ curl_easy_reset(ch);
+ curl_easy_setopt(ch, CURLOPT_COOKIELIST, "ALL");
+ curl_easy_setopt(ch, CURLOPT_COOKIEFILE, NULL);
+ }
+}
+
static php_resource_factory_t *create_rf(php_http_client_t *h, php_http_client_enqueue_t *enqueue)
{
php_persistent_handle_factory_t *pf = NULL;
id_len = spprintf(&id_str, 0, "%.*s:%s:%d", (int) phf->ident->len, phf->ident->val, STR_PTR(url->host), port);
id = php_http_cs2zs(id_str, id_len);
- pf = php_persistent_handle_concede(NULL, PHP_HTTP_G->client.curl.driver.request_name, id, NULL, NULL);
+ pf = php_persistent_handle_concede(NULL, PHP_HTTP_G->client.curl.driver.request_name, id, NULL, retire_ch);
zend_string_release(id);
}
return SUCCESS;
}
+static ZEND_RESULT_CODE php_http_client_curl_requeue(php_http_client_t *h, php_http_client_enqueue_t *enqueue)
+{
+ CURLMcode rs;
+ php_http_client_curl_t *curl = h->ctx;
+ php_http_client_curl_handler_t *handler = enqueue->opaque;
+ php_http_client_progress_state_t *progress;
+
+ if (SUCCESS != php_http_client_curl_handler_reset(handler)) {
+ return FAILURE;
+ }
+
+ if (SUCCESS != php_http_client_curl_handler_prepare(handler, enqueue)) {
+ return FAILURE;
+ }
+
+ if (CURLM_OK != (rs = curl_multi_remove_handle(curl->handle->multi, handler->handle))) {
+ php_error_docref(NULL, E_WARNING, "Could not dequeue request: %s", curl_multi_strerror(rs));
+ return FAILURE;
+ }
+
+ if (CURLM_OK != (rs = curl_multi_add_handle(curl->handle->multi, handler->handle))) {
+ zend_llist_del_element(&h->requests, handler->handle, (int (*)(void *, void *)) compare_queue);
+ php_error_docref(NULL, E_WARNING, "Could not enqueue request: %s", curl_multi_strerror(rs));
+ return FAILURE;
+ }
+
+ ++curl->unfinished;
+
+ if (h->callback.progress.func && SUCCESS == php_http_client_getopt(h, PHP_HTTP_CLIENT_OPT_PROGRESS_INFO, enqueue->request, &progress)) {
+ progress->info = "start";
+ h->callback.progress.func(h->callback.progress.arg, h, &handler->queue, progress);
+ progress->started = 1;
+ }
+
+ return SUCCESS;
+}
+
static ZEND_RESULT_CODE php_http_client_curl_dequeue(php_http_client_t *h, php_http_client_enqueue_t *enqueue)
{
CURLMcode rs;
{
php_http_client_curl_t *curl = h->ctx;
+ (void) curl;
+
switch (opt) {
case PHP_HTTP_CLIENT_OPT_CONFIGURATION:
return php_http_options_apply(&php_http_curlm_options, (HashTable *) arg, h);
php_http_client_curl_once,
php_http_client_curl_enqueue,
php_http_client_curl_dequeue,
+ php_http_client_curl_requeue,
php_http_client_curl_setopt,
php_http_client_curl_getopt
};
#[ReturnTypeWillChange]
function update(SplSubject $client, http\Client\Request $request = null, StdClass $progress = null) {
echo "P";
- if ($progress->info !== "prepare" && $client->getProgressInfo($request) != $progress) {
- var_dump($progress);
+ /* fence against buggy infof() calls in some curl versions */
+ $compare = $client->getProgressInfo($request);
+ if ($progress->info !== "prepare" && $compare && $compare != $progress) {
+ var_dump($progress, $compare);
}
}
}
}
server("env.inc", function($port) {
+ $client = new http\Client;
+ $client->setCookies(array("test" => "bar"));
+ $client->addCookies(array("foo" => "test"));
$request = new http\Client\Request("GET", "http://localhost:$port");
+ $client->enqueue($request);
+ $client->send();
+ echo $client->getResponse()->getBody()->toString();
- foreach (http\Client::getAvailableDrivers() as $driver) {
- $client = new http\Client($driver);
- $client->setCookies(array("test" => "bar"));
- $client->addCookies(array("foo" => "test"));
- $client->enqueue($request);
- $client->send();
- var_dump($client->getResponse()->getBody()->toString());
- $request->setOptions(array("cookies" => x($client->getCookies())));
- $client->requeue($request);
- $client->send();
- var_dump($client->getResponse()->getBody()->toString());
- }
+ $request->setOptions(array("cookies" => x($client->getCookies())));
+ $client->requeue($request);
+ $client->send();
+
+ echo $client->getResponse()->getBody()->toString();
});
?>
Done
---EXPECTREGEX--
+--EXPECT--
Test
-(?:string\(46\) "Array\n\(\n \[test\] \=\> bar\n \[foo\] \=\> test\n\)\n"\nstring\(46\) "Array\n\(\n \[test\] \=\> test\n \[foo\] \=\> bar\n\)\n"\n)+Done
+Array
+(
+ [test] => bar
+ [foo] => test
+)
+Array
+(
+ [test] => test
+ [foo] => bar
+)
+Done
<?php
include "skipif.inc";
skip_client_test();
+if (0 === strpos(http\Client\Curl\Versions\CURL, "7.64.0")) {
+ die("skip - cookie handling broken or crashes with libcurl-7.64\n");
+}
?>
--FILE--
<?php
server("cookie.inc", function($port) {
$client = new http\Client(null, "cookies");
- $client->configure(array("pipelining" => false));
+ $client->configure(array("pipelining" => false, "share_cookies" => false));
+
$request = new http\Client\Request("GET", "http://localhost:$port?r1");
$client->enqueue($request);
$client->send();
- while (($r = $client->getResponse())) {
- dump_headers(null, $r->getHeaders());
- }
+ dump_responses($client, ["counter" => 1]);
+
$client->requeue($request);
+ $client->send();
+ dump_responses($client, ["counter" => 2]);
+ $client->dequeue($request);
+
$request = new http\Client\Request("GET", "http://localhost:$port?r2");
$client->enqueue($request);
$client->send();
- while (($r = $client->getResponse())) {
- dump_headers(null, $r->getHeaders());
- }
+ dump_responses($client, ["counter" => 1]);
});
?>
X-Original-Transfer-Encoding: chunked
Etag: ""
-Set-Cookie: counter=2;
+Set-Cookie: counter=1;
X-Original-Transfer-Encoding: chunked
===DONE===
server("cookie.inc", function($port) {
$client = new http\Client(null, "cookies");
$client->configure(array("share_cookies" => false));
+
$request = new http\Client\Request("GET", "http://localhost:$port");
$client->enqueue($request);
$client->send();
- while (($r = $client->getResponse())) {
- dump_headers(null, $r->getHeaders());
- }
+ dump_responses($client, ["counter" => 1]);
+
/* requeue the previous request */
$client->requeue($request);
- $request = new http\Client\Request("GET", "http://localhost:$port");
- $client->enqueue($request);
- $client->send();
- while (($r = $client->getResponse())) {
- dump_headers(null, $r->getHeaders());
- }
- $request = new http\Client\Request("GET", "http://localhost:$port");
- $client->enqueue($request);
$client->send();
- while (($r = $client->getResponse())) {
- dump_headers(null, $r->getHeaders());
+ dump_responses($client, ["counter" => 2]);
+
+ for($i = 0; $i < 3; ++$i) {
+ /* new requests */
+ $request = new http\Client\Request("GET", "http://localhost:$port");
+ $client->enqueue($request);
+ $client->send();
+ dump_responses($client, ["counter" => 1]);
}
- $request = new http\Client\Request("GET", "http://localhost:$port");
- $client->enqueue($request);
+
+ /* requeue the previous request */
+ $client->requeue($request);
$client->send();
- while (($r = $client->getResponse())) {
- dump_headers(null, $r->getHeaders());
- }
+ dump_responses($client, ["counter" => 2]);
});
?>
X-Original-Transfer-Encoding: chunked
Etag: ""
-Set-Cookie: counter=1;
+Set-Cookie: counter=2;
X-Original-Transfer-Encoding: chunked
Etag: ""
-Set-Cookie: counter=2;
+Set-Cookie: counter=1;
X-Original-Transfer-Encoding: chunked
Etag: ""
Set-Cookie: counter=1;
X-Original-Transfer-Encoding: chunked
+Etag: ""
+Set-Cookie: counter=2;
+X-Original-Transfer-Encoding: chunked
+
===DONE===
server("cookie.inc", function($port) {
$client = new http\Client(null, "cookies");
$client->configure(array("share_cookies" => true));
+
$request = new http\Client\Request("GET", "http://localhost:$port");
$client->enqueue($request);
$client->send();
- while (($r = $client->getResponse())) {
- dump_headers(null, $r->getHeaders());
- }
+ dump_responses($client, ["counter" => 1]);
+
/* requeue the previous request */
$client->requeue($request);
- $request = new http\Client\Request("GET", "http://localhost:$port");
- $client->enqueue($request);
- $client->send();
- while (($r = $client->getResponse())) {
- dump_headers(null, $r->getHeaders());
- }
- $request = new http\Client\Request("GET", "http://localhost:$port");
- $client->enqueue($request);
$client->send();
- while (($r = $client->getResponse())) {
- dump_headers(null, $r->getHeaders());
+ dump_responses($client, ["counter" => 2]);
+
+ for($i = 3; $i < 6; ++$i) {
+ /* new requests */
+ $request = new http\Client\Request("GET", "http://localhost:$port");
+ $client->enqueue($request);
+ $client->send();
+ dump_responses($client, ["counter" => $i]);
}
- $request = new http\Client\Request("GET", "http://localhost:$port");
- $client->enqueue($request);
+
+ /* requeue the previous request */
+ $client->requeue($request);
$client->send();
- while (($r = $client->getResponse())) {
- dump_headers(null, $r->getHeaders());
- }
+ dump_responses($client, ["counter" => $i]);
});
?>
X-Original-Transfer-Encoding: chunked
Etag: ""
-Set-Cookie: counter=2;
+Set-Cookie: counter=3;
X-Original-Transfer-Encoding: chunked
Etag: ""
-Set-Cookie: counter=3;
+Set-Cookie: counter=4;
X-Original-Transfer-Encoding: chunked
Etag: ""
-Set-Cookie: counter=4;
+Set-Cookie: counter=5;
+X-Original-Transfer-Encoding: chunked
+
+Etag: ""
+Set-Cookie: counter=6;
X-Original-Transfer-Encoding: chunked
===DONE===
}
}
-?>
\ No newline at end of file
+function dump_responses($client, array $expect_cookie = []) {
+ while (($r = $client->getResponse())) {
+ dump_headers(null, $r->getHeaders());
+ if ($expect_cookie) {
+ $got_cookies = array_merge(...array_map(fn($c) => $c->getCookies(), $r->getCookies()));
+ if ($expect_cookie != $got_cookies) {
+ var_dump($expect_cookie, $got_cookies);
+ echo $r->toString(true);
+ }
+ }
+ }
+
+}
+?>