From 1b6a4aa270edbbe3c94e613faaf0da95a6920c0d Mon Sep 17 00:00:00 2001 From: Nathan Gavin Date: Thu, 20 Feb 2025 16:18:30 +1300 Subject: [PATCH 01/85] Add first run of replacing Travis CI --- .github/workflows/main.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..60fc4f4 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,26 @@ +name: PHPUnit + +on: + pull_request: + push: + +permissions: + contents: read + +jobs: + build: + name: PHPUnit + runs-on: ubuntu-latest + strategy: + matrix: + php-version: ['5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1'] + steps: + - uses: actions/checkout@v4 + - name: Install PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-version }} + - name: Composer install + run: composer install + - name: PHPUnit / PHP ${{ matrix.php-version }} + run: composer test From 75060e4d0a95d97239d0a59c245ab3e329663ba5 Mon Sep 17 00:00:00 2001 From: Nathan Gavin Date: Fri, 21 Feb 2025 10:05:00 +1300 Subject: [PATCH 02/85] Add composer update --- .github/workflows/main.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 60fc4f4..df1bd45 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -20,6 +20,8 @@ jobs: uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php-version }} + - name: Composer update + run: composer update - name: Composer install run: composer install - name: PHPUnit / PHP ${{ matrix.php-version }} From ef546eda445ddd40e4f77e7b6ae12258a849edcf Mon Sep 17 00:00:00 2001 From: Nathan Gavin Date: Fri, 21 Feb 2025 10:15:59 +1300 Subject: [PATCH 03/85] Clone config file and update environment --- .github/workflows/main.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index df1bd45..6d8b443 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -20,6 +20,10 @@ jobs: uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php-version }} + - name: Update package lists + run: sudo apt-get update + - name: Copy config file + run: cp tests/travis/config.php config.php - name: Composer update run: composer update - name: Composer install From 41178cc504d3f3f97a7bea034dce7f53c3cea312 Mon Sep 17 00:00:00 2001 From: Nathan Gavin Date: Fri, 21 Feb 2025 10:39:24 +1300 Subject: [PATCH 04/85] set up apache and php-fpm --- .github/workflows/main.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6d8b443..3884e7f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -22,6 +22,16 @@ jobs: php-version: ${{ matrix.php-version }} - name: Update package lists run: sudo apt-get update + - name: Install Apache and required modules + run: sudo apt-get install apache2 libapache2-mod-fastcgi + - name: Configure PHP-FPM + run: | + sudo cp ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf.default ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf + sudo a2enmod rewrite actions fastcgi alias + echo "cgi.fix_pathinfo = 1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini + sudo sed -i -e "s,www-data,runner,g" /etc/apache2/envvars + sudo chown -R runner:runner /var/lib/apache2/fastcgi + ~/.phpenv/versions/$(phpenv version-name)/sbin/php-fpm - name: Copy config file run: cp tests/travis/config.php config.php - name: Composer update From d5936dd8a9374885e7efcf2d6241da58c9e52ea0 Mon Sep 17 00:00:00 2001 From: Nathan Gavin Date: Fri, 21 Feb 2025 10:52:01 +1300 Subject: [PATCH 05/85] Replace obselete package --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3884e7f..1e4601e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -23,7 +23,7 @@ jobs: - name: Update package lists run: sudo apt-get update - name: Install Apache and required modules - run: sudo apt-get install apache2 libapache2-mod-fastcgi + run: sudo apt-get install apache2 libapache2-mod-fcgid - name: Configure PHP-FPM run: | sudo cp ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf.default ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf From 4ce5eaf053360627ce7b227acf9b593b4bb28212 Mon Sep 17 00:00:00 2001 From: Nathan Gavin Date: Mon, 24 Feb 2025 09:30:18 +1300 Subject: [PATCH 06/85] Add name to step --- .github/workflows/main.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1e4601e..2dd0b98 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -15,7 +15,8 @@ jobs: matrix: php-version: ['5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1'] steps: - - uses: actions/checkout@v4 + - name: Checkout repository + uses: actions/checkout@v4 - name: Install PHP uses: shivammathur/setup-php@v2 with: From dc7538a9f9a5d0f0c4fc28371fd37abcd1c2c49c Mon Sep 17 00:00:00 2001 From: Nathan Gavin Date: Mon, 24 Feb 2025 18:28:03 +1300 Subject: [PATCH 07/85] Replace method of retrieving php version --- .github/workflows/main.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2dd0b98..5b303b8 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -27,12 +27,12 @@ jobs: run: sudo apt-get install apache2 libapache2-mod-fcgid - name: Configure PHP-FPM run: | - sudo cp ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf.default ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf + sudo cp ~/.phpenv/versions/$(php -r "echo PHP_MAJOR_VERSION.'.'.PHP_MINOR_VERSION;")/etc/php-fpm.conf.default ~/.phpenv/versions/$(php -r "echo PHP_MAJOR_VERSION.'.'.PHP_MINOR_VERSION;")/etc/php-fpm.conf sudo a2enmod rewrite actions fastcgi alias - echo "cgi.fix_pathinfo = 1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini + echo "cgi.fix_pathinfo = 1" >> ~/.phpenv/versions/$(php -r "echo PHP_MAJOR_VERSION.'.'.PHP_MINOR_VERSION;")/etc/php.ini sudo sed -i -e "s,www-data,runner,g" /etc/apache2/envvars sudo chown -R runner:runner /var/lib/apache2/fastcgi - ~/.phpenv/versions/$(phpenv version-name)/sbin/php-fpm + ~/.phpenv/versions/$(php -r "echo PHP_MAJOR_VERSION.'.'.PHP_MINOR_VERSION;")/sbin/php-fpm - name: Copy config file run: cp tests/travis/config.php config.php - name: Composer update From 6cb0846026ead4dfaf8893ec39ebf840994c544a Mon Sep 17 00:00:00 2001 From: Nathan Gavin Date: Mon, 24 Feb 2025 18:44:58 +1300 Subject: [PATCH 08/85] Test env --- .github/workflows/main.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5b303b8..1e8267e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -25,6 +25,8 @@ jobs: run: sudo apt-get update - name: Install Apache and required modules run: sudo apt-get install apache2 libapache2-mod-fcgid + - name: test + run: ls ~ - name: Configure PHP-FPM run: | sudo cp ~/.phpenv/versions/$(php -r "echo PHP_MAJOR_VERSION.'.'.PHP_MINOR_VERSION;")/etc/php-fpm.conf.default ~/.phpenv/versions/$(php -r "echo PHP_MAJOR_VERSION.'.'.PHP_MINOR_VERSION;")/etc/php-fpm.conf From 01bda5c049884d52c70ebf8f657a095bc623edb6 Mon Sep 17 00:00:00 2001 From: Nathan Gavin Date: Mon, 24 Feb 2025 18:46:06 +1300 Subject: [PATCH 09/85] Test env --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1e8267e..f66531b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -26,7 +26,7 @@ jobs: - name: Install Apache and required modules run: sudo apt-get install apache2 libapache2-mod-fcgid - name: test - run: ls ~ + run: ls -a ~ - name: Configure PHP-FPM run: | sudo cp ~/.phpenv/versions/$(php -r "echo PHP_MAJOR_VERSION.'.'.PHP_MINOR_VERSION;")/etc/php-fpm.conf.default ~/.phpenv/versions/$(php -r "echo PHP_MAJOR_VERSION.'.'.PHP_MINOR_VERSION;")/etc/php-fpm.conf From 50ae5790ab5f102afcc34642fc501f275fe21f0d Mon Sep 17 00:00:00 2001 From: Nathan Gavin Date: Mon, 24 Feb 2025 19:01:08 +1300 Subject: [PATCH 10/85] Updated with new env structure --- .github/workflows/main.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f66531b..7b62f99 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -29,12 +29,13 @@ jobs: run: ls -a ~ - name: Configure PHP-FPM run: | - sudo cp ~/.phpenv/versions/$(php -r "echo PHP_MAJOR_VERSION.'.'.PHP_MINOR_VERSION;")/etc/php-fpm.conf.default ~/.phpenv/versions/$(php -r "echo PHP_MAJOR_VERSION.'.'.PHP_MINOR_VERSION;")/etc/php-fpm.conf + PHP_VERSION=$(php -r "echo PHP_MAJOR_VERSION.'.'.PHP_MINOR_VERSION;") + sudo cp /etc/php/$PHP_VERSION/fpm/php-fpm.conf.default /etc/php/$PHP_VERSION/fpm/php-fpm.conf sudo a2enmod rewrite actions fastcgi alias - echo "cgi.fix_pathinfo = 1" >> ~/.phpenv/versions/$(php -r "echo PHP_MAJOR_VERSION.'.'.PHP_MINOR_VERSION;")/etc/php.ini + echo "cgi.fix_pathinfo = 1" >> /etc/php/$PHP_VERSION/fpm/php.ini sudo sed -i -e "s,www-data,runner,g" /etc/apache2/envvars sudo chown -R runner:runner /var/lib/apache2/fastcgi - ~/.phpenv/versions/$(php -r "echo PHP_MAJOR_VERSION.'.'.PHP_MINOR_VERSION;")/sbin/php-fpm + sudo service php$PHP_VERSION-fpm start - name: Copy config file run: cp tests/travis/config.php config.php - name: Composer update From 1c119c8df2eb8c9594616c4e284ff6d87c8547e9 Mon Sep 17 00:00:00 2001 From: Nathan Gavin Date: Mon, 24 Feb 2025 19:04:06 +1300 Subject: [PATCH 11/85] Test env --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7b62f99..b37b7c9 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -26,7 +26,7 @@ jobs: - name: Install Apache and required modules run: sudo apt-get install apache2 libapache2-mod-fcgid - name: test - run: ls -a ~ + run: ls -a /etc/ - name: Configure PHP-FPM run: | PHP_VERSION=$(php -r "echo PHP_MAJOR_VERSION.'.'.PHP_MINOR_VERSION;") From 4afa1d49bf40ddba0f855b21ee11111ec1be3bc5 Mon Sep 17 00:00:00 2001 From: Nathan Gavin Date: Mon, 24 Feb 2025 19:05:08 +1300 Subject: [PATCH 12/85] Test env --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b37b7c9..89535ca 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -26,7 +26,7 @@ jobs: - name: Install Apache and required modules run: sudo apt-get install apache2 libapache2-mod-fcgid - name: test - run: ls -a /etc/ + run: ls -a /etc/php/ - name: Configure PHP-FPM run: | PHP_VERSION=$(php -r "echo PHP_MAJOR_VERSION.'.'.PHP_MINOR_VERSION;") From d9a10686419683a4ecea184d8810f59f6fa97d30 Mon Sep 17 00:00:00 2001 From: Nathan Gavin Date: Mon, 24 Feb 2025 19:06:26 +1300 Subject: [PATCH 13/85] Test env --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 89535ca..d94f73a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -26,7 +26,7 @@ jobs: - name: Install Apache and required modules run: sudo apt-get install apache2 libapache2-mod-fcgid - name: test - run: ls -a /etc/php/ + run: ls -a /etc/php/5.6/ - name: Configure PHP-FPM run: | PHP_VERSION=$(php -r "echo PHP_MAJOR_VERSION.'.'.PHP_MINOR_VERSION;") From becd4e78b5370452a9e4950ca48018b8f383a03c Mon Sep 17 00:00:00 2001 From: Nathan Gavin Date: Mon, 24 Feb 2025 19:08:46 +1300 Subject: [PATCH 14/85] Test env --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d94f73a..58230e2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -26,7 +26,7 @@ jobs: - name: Install Apache and required modules run: sudo apt-get install apache2 libapache2-mod-fcgid - name: test - run: ls -a /etc/php/5.6/ + run: ls -a /etc/php/5.6/fpm/ - name: Configure PHP-FPM run: | PHP_VERSION=$(php -r "echo PHP_MAJOR_VERSION.'.'.PHP_MINOR_VERSION;") From b0c80009011c27854d94a8934a9fcfbb4dd54c68 Mon Sep 17 00:00:00 2001 From: Nathan Gavin Date: Tue, 25 Feb 2025 09:27:21 +1300 Subject: [PATCH 15/85] remove default file config step --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 58230e2..cc3c961 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -30,7 +30,7 @@ jobs: - name: Configure PHP-FPM run: | PHP_VERSION=$(php -r "echo PHP_MAJOR_VERSION.'.'.PHP_MINOR_VERSION;") - sudo cp /etc/php/$PHP_VERSION/fpm/php-fpm.conf.default /etc/php/$PHP_VERSION/fpm/php-fpm.conf + sudo apt-get install -y php$PHP_VERSION-fpm sudo a2enmod rewrite actions fastcgi alias echo "cgi.fix_pathinfo = 1" >> /etc/php/$PHP_VERSION/fpm/php.ini sudo sed -i -e "s,www-data,runner,g" /etc/apache2/envvars From 6f2a167a19ff110a2fda7d69a56441a90a54dfff Mon Sep 17 00:00:00 2001 From: Nathan Gavin Date: Tue, 25 Feb 2025 09:28:46 +1300 Subject: [PATCH 16/85] remove test --- .github/workflows/main.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index cc3c961..61cf545 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -25,8 +25,6 @@ jobs: run: sudo apt-get update - name: Install Apache and required modules run: sudo apt-get install apache2 libapache2-mod-fcgid - - name: test - run: ls -a /etc/php/5.6/fpm/ - name: Configure PHP-FPM run: | PHP_VERSION=$(php -r "echo PHP_MAJOR_VERSION.'.'.PHP_MINOR_VERSION;") From 34f2361498cc1d3f3818ed8ee383848c0458579f Mon Sep 17 00:00:00 2001 From: Nathan Gavin Date: Tue, 25 Feb 2025 09:35:17 +1300 Subject: [PATCH 17/85] add print debugging --- .github/workflows/main.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 61cf545..5a843e1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -28,11 +28,17 @@ jobs: - name: Configure PHP-FPM run: | PHP_VERSION=$(php -r "echo PHP_MAJOR_VERSION.'.'.PHP_MINOR_VERSION;") + echo 1 sudo apt-get install -y php$PHP_VERSION-fpm + echo 2 sudo a2enmod rewrite actions fastcgi alias + echo 3 echo "cgi.fix_pathinfo = 1" >> /etc/php/$PHP_VERSION/fpm/php.ini + echo 4 sudo sed -i -e "s,www-data,runner,g" /etc/apache2/envvars + echo 5 sudo chown -R runner:runner /var/lib/apache2/fastcgi + echo 6 sudo service php$PHP_VERSION-fpm start - name: Copy config file run: cp tests/travis/config.php config.php From 2fd344aae8dfb55981d7da37385b016adfa657b4 Mon Sep 17 00:00:00 2001 From: Nathan Gavin Date: Tue, 25 Feb 2025 10:00:01 +1300 Subject: [PATCH 18/85] replace fastcgi with fcgid --- .github/workflows/main.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5a843e1..61ed27b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -30,14 +30,15 @@ jobs: PHP_VERSION=$(php -r "echo PHP_MAJOR_VERSION.'.'.PHP_MINOR_VERSION;") echo 1 sudo apt-get install -y php$PHP_VERSION-fpm + sudo systemctl restart apache2 echo 2 - sudo a2enmod rewrite actions fastcgi alias + sudo a2enmod rewrite actions fcgid alias echo 3 echo "cgi.fix_pathinfo = 1" >> /etc/php/$PHP_VERSION/fpm/php.ini echo 4 sudo sed -i -e "s,www-data,runner,g" /etc/apache2/envvars echo 5 - sudo chown -R runner:runner /var/lib/apache2/fastcgi + sudo chown -R runner:runner /var/lib/apache2/fcgid echo 6 sudo service php$PHP_VERSION-fpm start - name: Copy config file From ac71c4044d714e93dc7cdce663189e9bf6b043c3 Mon Sep 17 00:00:00 2001 From: Nathan Gavin Date: Tue, 25 Feb 2025 13:03:43 +1300 Subject: [PATCH 19/85] Fix test bug regarding URL path --- tests/ProxyTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/ProxyTest.php b/tests/ProxyTest.php index ce7b176..3046eca 100644 --- a/tests/ProxyTest.php +++ b/tests/ProxyTest.php @@ -417,7 +417,7 @@ private function getMatomoUrl() "); } require $pathConfig; - $MATOMO_URL = str_replace('tests/server/', '', $MATOMO_URL); + $MATOMO_URL = str_replace('/tests/server/', '', $MATOMO_URL); return $MATOMO_URL; } From b80404aedec8a04fe72a1265a1f9b6157cbe8bce Mon Sep 17 00:00:00 2001 From: Nathan Gavin Date: Tue, 25 Feb 2025 14:18:54 +1300 Subject: [PATCH 20/85] Add print log to track URL --- tests/ProxyTest.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/ProxyTest.php b/tests/ProxyTest.php index 3046eca..5f670e1 100644 --- a/tests/ProxyTest.php +++ b/tests/ProxyTest.php @@ -394,6 +394,8 @@ private function send($query = null, DateTime $modifiedSince = null, $matomoUrl ]; } + var_dump($matomoUrl . $path . $query); + $request = $client->createRequest($method, $matomoUrl . $path . $query, $requestOptions); $response = $client->send($request); From 4e729a8906147c0c7e77365f8fa628cd9410b6ca Mon Sep 17 00:00:00 2001 From: Nathan Gavin Date: Tue, 25 Feb 2025 14:35:21 +1300 Subject: [PATCH 21/85] Get PHPUnit version --- .github/workflows/main.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 61ed27b..28e8a6f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -43,6 +43,8 @@ jobs: sudo service php$PHP_VERSION-fpm start - name: Copy config file run: cp tests/travis/config.php config.php + - name: PHPUnit version + run: vendor/bin/phpunit --version - name: Composer update run: composer update - name: Composer install From 011b2cfc08e3d383c93d533766ed9537e81dfc49 Mon Sep 17 00:00:00 2001 From: Nathan Gavin Date: Tue, 25 Feb 2025 14:41:20 +1300 Subject: [PATCH 22/85] Update PHPUnit --- .github/workflows/main.yml | 2 -- composer.json | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 28e8a6f..61ed27b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -43,8 +43,6 @@ jobs: sudo service php$PHP_VERSION-fpm start - name: Copy config file run: cp tests/travis/config.php config.php - - name: PHPUnit version - run: vendor/bin/phpunit --version - name: Composer update run: composer update - name: Composer install diff --git a/composer.json b/composer.json index 5cb7a1a..9793a31 100644 --- a/composer.json +++ b/composer.json @@ -13,7 +13,7 @@ "require": { }, "require-dev": { - "phpunit/phpunit": "^4.8.36", + "phpunit/phpunit": "^9.5", "guzzlehttp/guzzle": "^5.0" }, "scripts": { From b1833d9e4cb43a6411b72b0ae423eb4c1fc188a0 Mon Sep 17 00:00:00 2001 From: Nathan Gavin Date: Tue, 25 Feb 2025 14:43:29 +1300 Subject: [PATCH 23/85] Add composer update flag --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 61ed27b..006e4d6 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -43,7 +43,7 @@ jobs: sudo service php$PHP_VERSION-fpm start - name: Copy config file run: cp tests/travis/config.php config.php - - name: Composer update + - name: Composer update -W run: composer update - name: Composer install run: composer install From 5f9a83d6b2fff59f7dad14e66aaf47071bdd32f6 Mon Sep 17 00:00:00 2001 From: Nathan Gavin Date: Tue, 25 Feb 2025 14:51:23 +1300 Subject: [PATCH 24/85] Revert phpunit change --- .github/workflows/main.yml | 2 +- composer.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 006e4d6..61ed27b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -43,7 +43,7 @@ jobs: sudo service php$PHP_VERSION-fpm start - name: Copy config file run: cp tests/travis/config.php config.php - - name: Composer update -W + - name: Composer update run: composer update - name: Composer install run: composer install diff --git a/composer.json b/composer.json index 9793a31..5cb7a1a 100644 --- a/composer.json +++ b/composer.json @@ -13,7 +13,7 @@ "require": { }, "require-dev": { - "phpunit/phpunit": "^9.5", + "phpunit/phpunit": "^4.8.36", "guzzlehttp/guzzle": "^5.0" }, "scripts": { From a1da6898777d4b4d304c76989a544cbd3c9bb0a5 Mon Sep 17 00:00:00 2001 From: Nathan Gavin Date: Tue, 25 Feb 2025 15:18:17 +1300 Subject: [PATCH 25/85] Move apache restart --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 61ed27b..b5f426b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -30,9 +30,9 @@ jobs: PHP_VERSION=$(php -r "echo PHP_MAJOR_VERSION.'.'.PHP_MINOR_VERSION;") echo 1 sudo apt-get install -y php$PHP_VERSION-fpm - sudo systemctl restart apache2 echo 2 sudo a2enmod rewrite actions fcgid alias + sudo systemctl restart apache2 echo 3 echo "cgi.fix_pathinfo = 1" >> /etc/php/$PHP_VERSION/fpm/php.ini echo 4 From b5b5f8edda53bcac048e8488dd680beebfdfaedf Mon Sep 17 00:00:00 2001 From: Nathan Gavin Date: Tue, 25 Feb 2025 15:23:03 +1300 Subject: [PATCH 26/85] See apache status --- .github/workflows/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b5f426b..8a867f7 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -33,6 +33,7 @@ jobs: echo 2 sudo a2enmod rewrite actions fcgid alias sudo systemctl restart apache2 + sudo systemctl status apache2 echo 3 echo "cgi.fix_pathinfo = 1" >> /etc/php/$PHP_VERSION/fpm/php.ini echo 4 From face1904d456ae0a89440b2ea8e6d040ff2a7469 Mon Sep 17 00:00:00 2001 From: Nathan Gavin Date: Tue, 25 Feb 2025 15:27:17 +1300 Subject: [PATCH 27/85] Add apache config --- .github/workflows/main.yml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8a867f7..91a3dae 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -32,15 +32,13 @@ jobs: sudo apt-get install -y php$PHP_VERSION-fpm echo 2 sudo a2enmod rewrite actions fcgid alias + sudo sed -i -e "s,www-data,runner,g" /etc/apache2/envvars + sudo cp -f tests/travis/apache-vhost /etc/apache2/sites-available/000-default.conf + sudo sed -e "s?%TRAVIS_BUILD_DIR%?$(pwd)?g" --in-place /etc/apache2/sites-available/000-default.conf + sudo chown -R runner:runner /var/lib/apache2/fcgid sudo systemctl restart apache2 - sudo systemctl status apache2 echo 3 echo "cgi.fix_pathinfo = 1" >> /etc/php/$PHP_VERSION/fpm/php.ini - echo 4 - sudo sed -i -e "s,www-data,runner,g" /etc/apache2/envvars - echo 5 - sudo chown -R runner:runner /var/lib/apache2/fcgid - echo 6 sudo service php$PHP_VERSION-fpm start - name: Copy config file run: cp tests/travis/config.php config.php From 94524f29b91eb66450924f7bac2e7ad986ebe7bc Mon Sep 17 00:00:00 2001 From: Nathan Gavin Date: Tue, 25 Feb 2025 15:33:00 +1300 Subject: [PATCH 28/85] add pwd --- .github/workflows/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 91a3dae..b8d0013 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -34,6 +34,7 @@ jobs: sudo a2enmod rewrite actions fcgid alias sudo sed -i -e "s,www-data,runner,g" /etc/apache2/envvars sudo cp -f tests/travis/apache-vhost /etc/apache2/sites-available/000-default.conf + pwd sudo sed -e "s?%TRAVIS_BUILD_DIR%?$(pwd)?g" --in-place /etc/apache2/sites-available/000-default.conf sudo chown -R runner:runner /var/lib/apache2/fcgid sudo systemctl restart apache2 From c27620e47155ec0d2a9de11400379bf0fbfbd611 Mon Sep 17 00:00:00 2001 From: Nathan Gavin Date: Tue, 25 Feb 2025 15:36:46 +1300 Subject: [PATCH 29/85] ad pwd to travis --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 66f05dc..cfea1a6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -23,6 +23,7 @@ before_script: - sudo chown -R travis:travis /var/lib/apache2/fastcgi - ~/.phpenv/versions/$(phpenv version-name)/sbin/php-fpm - sudo cp -f tests/travis/apache-vhost /etc/apache2/sites-available/000-default.conf + - pwd - sudo sed -e "s?%TRAVIS_BUILD_DIR%?$(pwd)?g" --in-place /etc/apache2/sites-available/000-default.conf - sudo service apache2 restart - cp tests/travis/config.php config.php From d612a3c7d6fc9f7f4f5caab389e5359e222deb17 Mon Sep 17 00:00:00 2001 From: Nathan Gavin Date: Tue, 25 Feb 2025 15:53:09 +1300 Subject: [PATCH 30/85] only 5.6 --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b8d0013..f4fa992 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - php-version: ['5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1'] + php-version: ['5.6'] steps: - name: Checkout repository uses: actions/checkout@v4 From 16af20106cf8d361be86f9247911adaaaa18ec5b Mon Sep 17 00:00:00 2001 From: Nathan Gavin Date: Tue, 25 Feb 2025 15:58:58 +1300 Subject: [PATCH 31/85] show error logs --- .github/workflows/main.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f4fa992..dc08762 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -49,3 +49,7 @@ jobs: run: composer install - name: PHPUnit / PHP ${{ matrix.php-version }} run: composer test + - name: Display Apache logs on failure + run: | + sudo cat /var/log/apache2/access.log + sudo cat /var/log/apache2/error.log From 6acb2705e69bd49c9db3c257adcfeebf17de2675 Mon Sep 17 00:00:00 2001 From: Nathan Gavin Date: Tue, 25 Feb 2025 16:03:21 +1300 Subject: [PATCH 32/85] add fastcgi back --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index dc08762..1bd914e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -31,7 +31,7 @@ jobs: echo 1 sudo apt-get install -y php$PHP_VERSION-fpm echo 2 - sudo a2enmod rewrite actions fcgid alias + sudo a2enmod rewrite actions fcgid fastcgi alias sudo sed -i -e "s,www-data,runner,g" /etc/apache2/envvars sudo cp -f tests/travis/apache-vhost /etc/apache2/sites-available/000-default.conf pwd From 05e4355e210ec8119ae41ed1bc84f94a45b0a344 Mon Sep 17 00:00:00 2001 From: Nathan Gavin Date: Tue, 25 Feb 2025 16:05:52 +1300 Subject: [PATCH 33/85] add fastcgi back --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1bd914e..0a71b56 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -24,7 +24,7 @@ jobs: - name: Update package lists run: sudo apt-get update - name: Install Apache and required modules - run: sudo apt-get install apache2 libapache2-mod-fcgid + run: sudo apt-get install apache2 libapache2-mod-fastcgi - name: Configure PHP-FPM run: | PHP_VERSION=$(php -r "echo PHP_MAJOR_VERSION.'.'.PHP_MINOR_VERSION;") From 1003d99055f300b54ca0453c9bc6b0bc65e37901 Mon Sep 17 00:00:00 2001 From: Nathan Gavin Date: Tue, 25 Feb 2025 16:12:44 +1300 Subject: [PATCH 34/85] replace everything --- .github/workflows/main.yml | 30 +++++++++++------------------- 1 file changed, 11 insertions(+), 19 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0a71b56..5c0abc0 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - php-version: ['5.6'] + php-version: ['7.4'] steps: - name: Checkout repository uses: actions/checkout@v4 @@ -23,24 +23,16 @@ jobs: php-version: ${{ matrix.php-version }} - name: Update package lists run: sudo apt-get update - - name: Install Apache and required modules - run: sudo apt-get install apache2 libapache2-mod-fastcgi - - name: Configure PHP-FPM - run: | - PHP_VERSION=$(php -r "echo PHP_MAJOR_VERSION.'.'.PHP_MINOR_VERSION;") - echo 1 - sudo apt-get install -y php$PHP_VERSION-fpm - echo 2 - sudo a2enmod rewrite actions fcgid fastcgi alias - sudo sed -i -e "s,www-data,runner,g" /etc/apache2/envvars - sudo cp -f tests/travis/apache-vhost /etc/apache2/sites-available/000-default.conf - pwd - sudo sed -e "s?%TRAVIS_BUILD_DIR%?$(pwd)?g" --in-place /etc/apache2/sites-available/000-default.conf - sudo chown -R runner:runner /var/lib/apache2/fcgid - sudo systemctl restart apache2 - echo 3 - echo "cgi.fix_pathinfo = 1" >> /etc/php/$PHP_VERSION/fpm/php.ini - sudo service php$PHP_VERSION-fpm start + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: '7.4' + - name: Setup Apache + uses: thunder/apache-shiva-php-action@v1 + with: + php-version: '7.4' + site-directory: /path/to/code + http-port: 800 - name: Copy config file run: cp tests/travis/config.php config.php - name: Composer update From c80e1e17e1c07d45b54b79f7fd70dbcb54ebb138 Mon Sep 17 00:00:00 2001 From: Nathan Gavin Date: Tue, 25 Feb 2025 16:17:25 +1300 Subject: [PATCH 35/85] fix port --- .github/workflows/main.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5c0abc0..b6981be 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -32,7 +32,7 @@ jobs: with: php-version: '7.4' site-directory: /path/to/code - http-port: 800 + http-port: 80 - name: Copy config file run: cp tests/travis/config.php config.php - name: Composer update @@ -42,6 +42,7 @@ jobs: - name: PHPUnit / PHP ${{ matrix.php-version }} run: composer test - name: Display Apache logs on failure + if: failure() run: | sudo cat /var/log/apache2/access.log sudo cat /var/log/apache2/error.log From 078f26168fe2aa9c5a46072d1241fbbf7cdca1d1 Mon Sep 17 00:00:00 2001 From: Nathan Gavin Date: Tue, 25 Feb 2025 16:22:15 +1300 Subject: [PATCH 36/85] fix path --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b6981be..03a8954 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -31,7 +31,7 @@ jobs: uses: thunder/apache-shiva-php-action@v1 with: php-version: '7.4' - site-directory: /path/to/code + site-directory: ./ http-port: 80 - name: Copy config file run: cp tests/travis/config.php config.php From 110cc12cf485600c51dcf286651056c3fdd4aef1 Mon Sep 17 00:00:00 2001 From: Nathan Gavin Date: Tue, 25 Feb 2025 16:31:10 +1300 Subject: [PATCH 37/85] github workspace --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 03a8954..a36aeb7 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -31,7 +31,7 @@ jobs: uses: thunder/apache-shiva-php-action@v1 with: php-version: '7.4' - site-directory: ./ + site-directory: ${{ github.workspace }} http-port: 80 - name: Copy config file run: cp tests/travis/config.php config.php From d211d89b254a40df72b4fafa708a920261844ac1 Mon Sep 17 00:00:00 2001 From: Nathan Gavin Date: Tue, 25 Feb 2025 16:34:28 +1300 Subject: [PATCH 38/85] 8080 --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a36aeb7..dd641b1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -32,7 +32,7 @@ jobs: with: php-version: '7.4' site-directory: ${{ github.workspace }} - http-port: 80 + http-port: 8080 - name: Copy config file run: cp tests/travis/config.php config.php - name: Composer update From 239ce11b036a9e53b466d1f87800e44c97723b2d Mon Sep 17 00:00:00 2001 From: Nathan Gavin Date: Tue, 25 Feb 2025 16:37:47 +1300 Subject: [PATCH 39/85] 8080 2 --- tests/travis/config.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/travis/config.php b/tests/travis/config.php index f40c6f5..3f43d99 100644 --- a/tests/travis/config.php +++ b/tests/travis/config.php @@ -1,7 +1,7 @@ Date: Tue, 25 Feb 2025 16:46:05 +1300 Subject: [PATCH 40/85] remove ipv6 stuff --- tests/ProxyTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/ProxyTest.php b/tests/ProxyTest.php index 5f670e1..f25511c 100644 --- a/tests/ProxyTest.php +++ b/tests/ProxyTest.php @@ -357,7 +357,7 @@ private function send($query = null, DateTime $modifiedSince = null, $matomoUrl if ($forceIpV6) { // on travis, using an ipv6 ip address causes an error when resolving localhost - $matomoUrl = str_replace("localhost", "127.0.0.1", $matomoUrl); + //$matomoUrl = str_replace("localhost", "127.0.0.1", $matomoUrl); } $client = new Client(); From e4456fb7e923fc74a939751811e05e1f6c65b040 Mon Sep 17 00:00:00 2001 From: Nathan Gavin Date: Wed, 26 Feb 2025 10:11:35 +1300 Subject: [PATCH 41/85] added PHP versions --- .github/workflows/main.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index dd641b1..15aee9b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - php-version: ['7.4'] + php-version: ['5.6','7.0','7.1','7.2','7.3','7.4','8.0','8.1'] steps: - name: Checkout repository uses: actions/checkout@v4 @@ -41,8 +41,3 @@ jobs: run: composer install - name: PHPUnit / PHP ${{ matrix.php-version }} run: composer test - - name: Display Apache logs on failure - if: failure() - run: | - sudo cat /var/log/apache2/access.log - sudo cat /var/log/apache2/error.log From ac22a49e7b039202b45cc59a329b25976abbfe6e Mon Sep 17 00:00:00 2001 From: Nathan Gavin Date: Wed, 26 Feb 2025 10:15:46 +1300 Subject: [PATCH 42/85] remove var_dump --- tests/ProxyTest.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/ProxyTest.php b/tests/ProxyTest.php index f25511c..f80b70b 100644 --- a/tests/ProxyTest.php +++ b/tests/ProxyTest.php @@ -394,8 +394,6 @@ private function send($query = null, DateTime $modifiedSince = null, $matomoUrl ]; } - var_dump($matomoUrl . $path . $query); - $request = $client->createRequest($method, $matomoUrl . $path . $query, $requestOptions); $response = $client->send($request); From de01d56822f870f157ad77eddf47526de3e2e2ac Mon Sep 17 00:00:00 2001 From: Nathan Gavin Date: Wed, 26 Feb 2025 10:16:52 +1300 Subject: [PATCH 43/85] Fix broken test --- tests/ProxyTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/ProxyTest.php b/tests/ProxyTest.php index f80b70b..422c5cf 100644 --- a/tests/ProxyTest.php +++ b/tests/ProxyTest.php @@ -240,7 +240,7 @@ public function test_debug_requests_are_scrubbed_properly() RESPONSE; $this->assertEquals(200, $response->getStatusCode()); - $this->assertEquals(132, $response->getHeader('content-length')); + $this->assertEquals(131, $response->getHeader('content-length')); $this->assertEquals($expected, $responseBody); } From a8cbe38e269d488904bc05f9ef31609444c63346 Mon Sep 17 00:00:00 2001 From: Nathan Gavin Date: Wed, 26 Feb 2025 10:42:33 +1300 Subject: [PATCH 44/85] removed some travis CI references --- .github/workflows/main.yml | 2 +- tests/{travis => github}/apache-vhost | 0 tests/{travis => github}/config.php | 0 3 files changed, 1 insertion(+), 1 deletion(-) rename tests/{travis => github}/apache-vhost (100%) rename tests/{travis => github}/config.php (100%) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 15aee9b..228e851 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -34,7 +34,7 @@ jobs: site-directory: ${{ github.workspace }} http-port: 8080 - name: Copy config file - run: cp tests/travis/config.php config.php + run: cp tests/github/config.php config.php - name: Composer update run: composer update - name: Composer install diff --git a/tests/travis/apache-vhost b/tests/github/apache-vhost similarity index 100% rename from tests/travis/apache-vhost rename to tests/github/apache-vhost diff --git a/tests/travis/config.php b/tests/github/config.php similarity index 100% rename from tests/travis/config.php rename to tests/github/config.php From 035304aa72a27866697667528919d45468eb986a Mon Sep 17 00:00:00 2001 From: Nathan Gavin Date: Wed, 26 Feb 2025 10:44:33 +1300 Subject: [PATCH 45/85] fix broken test --- tests/ProxyTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/ProxyTest.php b/tests/ProxyTest.php index 422c5cf..1f6cc03 100644 --- a/tests/ProxyTest.php +++ b/tests/ProxyTest.php @@ -234,7 +234,7 @@ public function test_debug_requests_are_scrubbed_properly() 'debug' => '1', ) HOST: proxy -URL: http://proxy/ +URL: http://proxy:8080/ TOKEN_AUTH: RESPONSE; From 3c162c7220ea4a5857b386f0e4742d3c39c008bd Mon Sep 17 00:00:00 2001 From: Nathan Gavin Date: Wed, 26 Feb 2025 10:46:54 +1300 Subject: [PATCH 46/85] remove travis CI files --- .travis.yml | 37 ------------------------------------- tests/github/apache-vhost | 21 --------------------- 2 files changed, 58 deletions(-) delete mode 100644 .travis.yml delete mode 100644 tests/github/apache-vhost diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index cfea1a6..0000000 --- a/.travis.yml +++ /dev/null @@ -1,37 +0,0 @@ -language: php - -matrix: - fast_finish: true - include: - - php: 8.1 - - php: 8.0 - - php: 7.4 - - php: 7.3 - - php: 7.2 - - php: 7.1 - - php: 7.0 - - php: 5.6 - -before_script: - - sudo apt-get update - # Set up the webserver - - sudo apt-get install apache2 libapache2-mod-fastcgi - - sudo cp ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf.default ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf - - sudo a2enmod rewrite actions fastcgi alias - - echo "cgi.fix_pathinfo = 1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini - - sudo sed -i -e "s,www-data,travis,g" /etc/apache2/envvars - - sudo chown -R travis:travis /var/lib/apache2/fastcgi - - ~/.phpenv/versions/$(phpenv version-name)/sbin/php-fpm - - sudo cp -f tests/travis/apache-vhost /etc/apache2/sites-available/000-default.conf - - pwd - - sudo sed -e "s?%TRAVIS_BUILD_DIR%?$(pwd)?g" --in-place /etc/apache2/sites-available/000-default.conf - - sudo service apache2 restart - - cp tests/travis/config.php config.php - - composer install --no-progress - -script: - - composer test - -after_script: - - sudo cat /var/log/apache2/access.log - - sudo cat /var/log/apache2/error.log diff --git a/tests/github/apache-vhost b/tests/github/apache-vhost deleted file mode 100644 index 6866a82..0000000 --- a/tests/github/apache-vhost +++ /dev/null @@ -1,21 +0,0 @@ - - DocumentRoot %TRAVIS_BUILD_DIR% - - - Options FollowSymLinks MultiViews ExecCGI - AllowOverride All - Require all granted - - - # Wire up Apache to use Travis CI's php-fpm. - - AddHandler php5-fcgi .php - Action php5-fcgi /php5-fcgi - Alias /php5-fcgi /usr/lib/cgi-bin/php5-fcgi - FastCgiExternalServer /usr/lib/cgi-bin/php5-fcgi -host 127.0.0.1:9000 -pass-header Authorization - - - Require all granted - - - From 4296df8dee23f05f58ea5945750a258554cc6c63 Mon Sep 17 00:00:00 2001 From: Nathan Gavin Date: Wed, 26 Feb 2025 13:55:31 +1300 Subject: [PATCH 47/85] added PHP versions and phpcs --- .github/workflows/main.yml | 12 +- composer.json | 1 + composer.lock | 1580 ------------------------------------ phpcs.xml | 21 + 4 files changed, 31 insertions(+), 1583 deletions(-) delete mode 100644 composer.lock create mode 100644 phpcs.xml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 228e851..20af543 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - php-version: ['5.6','7.0','7.1','7.2','7.3','7.4','8.0','8.1'] + php-version: ['5.6','7.0','7.1','7.2','7.3','7.4','8.0','8.1','8.4'] steps: - name: Checkout repository uses: actions/checkout@v4 @@ -26,11 +26,11 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: '7.4' + php-version: '${{ matrix.php-version }}' - name: Setup Apache uses: thunder/apache-shiva-php-action@v1 with: - php-version: '7.4' + php-version: '${{ matrix.php-version }}' site-directory: ${{ github.workspace }} http-port: 8080 - name: Copy config file @@ -39,5 +39,11 @@ jobs: run: composer update - name: Composer install run: composer install + - name: Check PHP code styles + id: phpcs + run: ./vendor/bin/phpcs --report-full --report-checkstyle=./phpcs-report.xml + - name: Show PHPCS results in PR + if: ${{ always() && steps.phpcs.outcome == 'failure' }} + run: cs2pr ./phpcs-report.xml - name: PHPUnit / PHP ${{ matrix.php-version }} run: composer test diff --git a/composer.json b/composer.json index 5cb7a1a..b84e7fd 100644 --- a/composer.json +++ b/composer.json @@ -11,6 +11,7 @@ } ], "require": { + "php": "7.2" }, "require-dev": { "phpunit/phpunit": "^4.8.36", diff --git a/composer.lock b/composer.lock deleted file mode 100644 index 9ba053e..0000000 --- a/composer.lock +++ /dev/null @@ -1,1580 +0,0 @@ -{ - "_readme": [ - "This file locks the dependencies of your project to a known state", - "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", - "This file is @generated automatically" - ], - "content-hash": "10d8296d2bbc98bed7a3b88540bfd54a", - "packages": [], - "packages-dev": [ - { - "name": "doctrine/instantiator", - "version": "1.4.1", - "source": { - "type": "git", - "url": "https://github.com/doctrine/instantiator.git", - "reference": "10dcfce151b967d20fde1b34ae6640712c3891bc" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/10dcfce151b967d20fde1b34ae6640712c3891bc", - "reference": "10dcfce151b967d20fde1b34ae6640712c3891bc", - "shasum": "" - }, - "require": { - "php": "^7.1 || ^8.0" - }, - "require-dev": { - "doctrine/coding-standard": "^9", - "ext-pdo": "*", - "ext-phar": "*", - "phpbench/phpbench": "^0.16 || ^1", - "phpstan/phpstan": "^1.4", - "phpstan/phpstan-phpunit": "^1", - "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", - "vimeo/psalm": "^4.22" - }, - "type": "library", - "autoload": { - "psr-4": { - "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com", - "homepage": "https://ocramius.github.io/" - } - ], - "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", - "homepage": "https://www.doctrine-project.org/projects/instantiator.html", - "keywords": [ - "constructor", - "instantiate" - ], - "support": { - "issues": "https://github.com/doctrine/instantiator/issues", - "source": "https://github.com/doctrine/instantiator/tree/1.4.1" - }, - "funding": [ - { - "url": "https://www.doctrine-project.org/sponsorship.html", - "type": "custom" - }, - { - "url": "https://www.patreon.com/phpdoctrine", - "type": "patreon" - }, - { - "url": "https://tidelift.com/funding/github/packagist/doctrine%2Finstantiator", - "type": "tidelift" - } - ], - "time": "2022-03-03T08:28:38+00:00" - }, - { - "name": "guzzlehttp/guzzle", - "version": "5.3.4", - "source": { - "type": "git", - "url": "https://github.com/guzzle/guzzle.git", - "reference": "b87eda7a7162f95574032da17e9323c9899cb6b2" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/b87eda7a7162f95574032da17e9323c9899cb6b2", - "reference": "b87eda7a7162f95574032da17e9323c9899cb6b2", - "shasum": "" - }, - "require": { - "guzzlehttp/ringphp": "^1.1", - "php": ">=5.4.0", - "react/promise": "^2.2" - }, - "require-dev": { - "ext-curl": "*", - "phpunit/phpunit": "^4.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "GuzzleHttp\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - } - ], - "description": "Guzzle is a PHP HTTP client library and framework for building RESTful web service clients", - "homepage": "http://guzzlephp.org/", - "keywords": [ - "client", - "curl", - "framework", - "http", - "http client", - "rest", - "web service" - ], - "support": { - "issues": "https://github.com/guzzle/guzzle/issues", - "source": "https://github.com/guzzle/guzzle/tree/5.3" - }, - "time": "2019-10-30T09:32:00+00:00" - }, - { - "name": "guzzlehttp/ringphp", - "version": "1.1.1", - "source": { - "type": "git", - "url": "https://github.com/guzzle/RingPHP.git", - "reference": "5e2a174052995663dd68e6b5ad838afd47dd615b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/RingPHP/zipball/5e2a174052995663dd68e6b5ad838afd47dd615b", - "reference": "5e2a174052995663dd68e6b5ad838afd47dd615b", - "shasum": "" - }, - "require": { - "guzzlehttp/streams": "~3.0", - "php": ">=5.4.0", - "react/promise": "~2.0" - }, - "require-dev": { - "ext-curl": "*", - "phpunit/phpunit": "~4.0" - }, - "suggest": { - "ext-curl": "Guzzle will use specific adapters if cURL is present" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1-dev" - } - }, - "autoload": { - "psr-4": { - "GuzzleHttp\\Ring\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - } - ], - "description": "Provides a simple API and specification that abstracts away the details of HTTP into a single PHP function.", - "support": { - "issues": "https://github.com/guzzle/RingPHP/issues", - "source": "https://github.com/guzzle/RingPHP/tree/1.1.1" - }, - "abandoned": true, - "time": "2018-07-31T13:22:33+00:00" - }, - { - "name": "guzzlehttp/streams", - "version": "3.0.0", - "source": { - "type": "git", - "url": "https://github.com/guzzle/streams.git", - "reference": "47aaa48e27dae43d39fc1cea0ccf0d84ac1a2ba5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/streams/zipball/47aaa48e27dae43d39fc1cea0ccf0d84ac1a2ba5", - "reference": "47aaa48e27dae43d39fc1cea0ccf0d84ac1a2ba5", - "shasum": "" - }, - "require": { - "php": ">=5.4.0" - }, - "require-dev": { - "phpunit/phpunit": "~4.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - }, - "autoload": { - "psr-4": { - "GuzzleHttp\\Stream\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - } - ], - "description": "Provides a simple abstraction over streams of data", - "homepage": "http://guzzlephp.org/", - "keywords": [ - "Guzzle", - "stream" - ], - "support": { - "issues": "https://github.com/guzzle/streams/issues", - "source": "https://github.com/guzzle/streams/tree/master" - }, - "abandoned": true, - "time": "2014-10-12T19:18:40+00:00" - }, - { - "name": "phpdocumentor/reflection-common", - "version": "2.2.0", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionCommon.git", - "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/1d01c49d4ed62f25aa84a747ad35d5a16924662b", - "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b", - "shasum": "" - }, - "require": { - "php": "^7.2 || ^8.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-2.x": "2.x-dev" - } - }, - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jaap van Otterdijk", - "email": "opensource@ijaap.nl" - } - ], - "description": "Common reflection classes used by phpdocumentor to reflect the code structure", - "homepage": "http://www.phpdoc.org", - "keywords": [ - "FQSEN", - "phpDocumentor", - "phpdoc", - "reflection", - "static analysis" - ], - "support": { - "issues": "https://github.com/phpDocumentor/ReflectionCommon/issues", - "source": "https://github.com/phpDocumentor/ReflectionCommon/tree/2.x" - }, - "time": "2020-06-27T09:03:43+00:00" - }, - { - "name": "phpdocumentor/reflection-docblock", - "version": "5.3.0", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "622548b623e81ca6d78b721c5e029f4ce664f170" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/622548b623e81ca6d78b721c5e029f4ce664f170", - "reference": "622548b623e81ca6d78b721c5e029f4ce664f170", - "shasum": "" - }, - "require": { - "ext-filter": "*", - "php": "^7.2 || ^8.0", - "phpdocumentor/reflection-common": "^2.2", - "phpdocumentor/type-resolver": "^1.3", - "webmozart/assert": "^1.9.1" - }, - "require-dev": { - "mockery/mockery": "~1.3.2", - "psalm/phar": "^4.8" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.x-dev" - } - }, - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Mike van Riel", - "email": "me@mikevanriel.com" - }, - { - "name": "Jaap van Otterdijk", - "email": "account@ijaap.nl" - } - ], - "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "support": { - "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", - "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.3.0" - }, - "time": "2021-10-19T17:43:47+00:00" - }, - { - "name": "phpdocumentor/type-resolver", - "version": "1.6.1", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "77a32518733312af16a44300404e945338981de3" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/77a32518733312af16a44300404e945338981de3", - "reference": "77a32518733312af16a44300404e945338981de3", - "shasum": "" - }, - "require": { - "php": "^7.2 || ^8.0", - "phpdocumentor/reflection-common": "^2.0" - }, - "require-dev": { - "ext-tokenizer": "*", - "psalm/phar": "^4.8" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-1.x": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Mike van Riel", - "email": "me@mikevanriel.com" - } - ], - "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", - "support": { - "issues": "https://github.com/phpDocumentor/TypeResolver/issues", - "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.6.1" - }, - "time": "2022-03-15T21:29:03+00:00" - }, - { - "name": "phpspec/prophecy", - "version": "v1.10.3", - "source": { - "type": "git", - "url": "https://github.com/phpspec/prophecy.git", - "reference": "451c3cd1418cf640de218914901e51b064abb093" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/451c3cd1418cf640de218914901e51b064abb093", - "reference": "451c3cd1418cf640de218914901e51b064abb093", - "shasum": "" - }, - "require": { - "doctrine/instantiator": "^1.0.2", - "php": "^5.3|^7.0", - "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0|^5.0", - "sebastian/comparator": "^1.2.3|^2.0|^3.0|^4.0", - "sebastian/recursion-context": "^1.0|^2.0|^3.0|^4.0" - }, - "require-dev": { - "phpspec/phpspec": "^2.5 || ^3.2", - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5 || ^7.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.10.x-dev" - } - }, - "autoload": { - "psr-4": { - "Prophecy\\": "src/Prophecy" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Konstantin Kudryashov", - "email": "ever.zet@gmail.com", - "homepage": "http://everzet.com" - }, - { - "name": "Marcello Duarte", - "email": "marcello.duarte@gmail.com" - } - ], - "description": "Highly opinionated mocking framework for PHP 5.3+", - "homepage": "https://github.com/phpspec/prophecy", - "keywords": [ - "Double", - "Dummy", - "fake", - "mock", - "spy", - "stub" - ], - "support": { - "issues": "https://github.com/phpspec/prophecy/issues", - "source": "https://github.com/phpspec/prophecy/tree/v1.10.3" - }, - "time": "2020-03-05T15:02:03+00:00" - }, - { - "name": "phpunit/php-code-coverage", - "version": "2.2.4", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/eabf68b476ac7d0f73793aada060f1c1a9bf8979", - "reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979", - "shasum": "" - }, - "require": { - "php": ">=5.3.3", - "phpunit/php-file-iterator": "~1.3", - "phpunit/php-text-template": "~1.2", - "phpunit/php-token-stream": "~1.3", - "sebastian/environment": "^1.3.2", - "sebastian/version": "~1.0" - }, - "require-dev": { - "ext-xdebug": ">=2.1.4", - "phpunit/phpunit": "~4" - }, - "suggest": { - "ext-dom": "*", - "ext-xdebug": ">=2.2.1", - "ext-xmlwriter": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.2.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" - } - ], - "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", - "homepage": "https://github.com/sebastianbergmann/php-code-coverage", - "keywords": [ - "coverage", - "testing", - "xunit" - ], - "support": { - "irc": "irc://irc.freenode.net/phpunit", - "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/2.2" - }, - "time": "2015-10-06T15:47:00+00:00" - }, - { - "name": "phpunit/php-file-iterator", - "version": "1.4.5", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/730b01bc3e867237eaac355e06a36b85dd93a8b4", - "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" - } - ], - "description": "FilterIterator implementation that filters files based on a list of suffixes.", - "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", - "keywords": [ - "filesystem", - "iterator" - ], - "support": { - "irc": "irc://irc.freenode.net/phpunit", - "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", - "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/1.4.5" - }, - "time": "2017-11-27T13:52:08+00:00" - }, - { - "name": "phpunit/php-text-template", - "version": "1.2.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", - "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Simple template engine.", - "homepage": "https://github.com/sebastianbergmann/php-text-template/", - "keywords": [ - "template" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/php-text-template/issues", - "source": "https://github.com/sebastianbergmann/php-text-template/tree/1.2.1" - }, - "time": "2015-06-21T13:50:34+00:00" - }, - { - "name": "phpunit/php-timer", - "version": "1.0.9", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", - "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", - "shasum": "" - }, - "require": { - "php": "^5.3.3 || ^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" - } - ], - "description": "Utility class for timing", - "homepage": "https://github.com/sebastianbergmann/php-timer/", - "keywords": [ - "timer" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/php-timer/issues", - "source": "https://github.com/sebastianbergmann/php-timer/tree/master" - }, - "time": "2017-02-26T11:10:40+00:00" - }, - { - "name": "phpunit/php-token-stream", - "version": "1.4.12", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "1ce90ba27c42e4e44e6d8458241466380b51fa16" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/1ce90ba27c42e4e44e6d8458241466380b51fa16", - "reference": "1ce90ba27c42e4e44e6d8458241466380b51fa16", - "shasum": "" - }, - "require": { - "ext-tokenizer": "*", - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.2" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Wrapper around PHP's tokenizer extension.", - "homepage": "https://github.com/sebastianbergmann/php-token-stream/", - "keywords": [ - "tokenizer" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/php-token-stream/issues", - "source": "https://github.com/sebastianbergmann/php-token-stream/tree/1.4" - }, - "abandoned": true, - "time": "2017-12-04T08:55:13+00:00" - }, - { - "name": "phpunit/phpunit", - "version": "4.8.36", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "46023de9a91eec7dfb06cc56cb4e260017298517" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/46023de9a91eec7dfb06cc56cb4e260017298517", - "reference": "46023de9a91eec7dfb06cc56cb4e260017298517", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-json": "*", - "ext-pcre": "*", - "ext-reflection": "*", - "ext-spl": "*", - "php": ">=5.3.3", - "phpspec/prophecy": "^1.3.1", - "phpunit/php-code-coverage": "~2.1", - "phpunit/php-file-iterator": "~1.4", - "phpunit/php-text-template": "~1.2", - "phpunit/php-timer": "^1.0.6", - "phpunit/phpunit-mock-objects": "~2.3", - "sebastian/comparator": "~1.2.2", - "sebastian/diff": "~1.2", - "sebastian/environment": "~1.3", - "sebastian/exporter": "~1.2", - "sebastian/global-state": "~1.0", - "sebastian/version": "~1.0", - "symfony/yaml": "~2.1|~3.0" - }, - "suggest": { - "phpunit/php-invoker": "~1.1" - }, - "bin": [ - "phpunit" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.8.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "The PHP Unit Testing framework.", - "homepage": "https://phpunit.de/", - "keywords": [ - "phpunit", - "testing", - "xunit" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/phpunit/issues", - "source": "https://github.com/sebastianbergmann/phpunit/tree/4.8.36" - }, - "time": "2017-06-21T08:07:12+00:00" - }, - { - "name": "phpunit/phpunit-mock-objects", - "version": "2.3.8", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", - "reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/ac8e7a3db35738d56ee9a76e78a4e03d97628983", - "reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983", - "shasum": "" - }, - "require": { - "doctrine/instantiator": "^1.0.2", - "php": ">=5.3.3", - "phpunit/php-text-template": "~1.2", - "sebastian/exporter": "~1.2" - }, - "require-dev": { - "phpunit/phpunit": "~4.4" - }, - "suggest": { - "ext-soap": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.3.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" - } - ], - "description": "Mock Object library for PHPUnit", - "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", - "keywords": [ - "mock", - "xunit" - ], - "support": { - "irc": "irc://irc.freenode.net/phpunit", - "issues": "https://github.com/sebastianbergmann/phpunit-mock-objects/issues", - "source": "https://github.com/sebastianbergmann/phpunit-mock-objects/tree/2.3" - }, - "abandoned": true, - "time": "2015-10-02T06:51:40+00:00" - }, - { - "name": "react/promise", - "version": "v2.9.0", - "source": { - "type": "git", - "url": "https://github.com/reactphp/promise.git", - "reference": "234f8fd1023c9158e2314fa9d7d0e6a83db42910" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/reactphp/promise/zipball/234f8fd1023c9158e2314fa9d7d0e6a83db42910", - "reference": "234f8fd1023c9158e2314fa9d7d0e6a83db42910", - "shasum": "" - }, - "require": { - "php": ">=5.4.0" - }, - "require-dev": { - "phpunit/phpunit": "^9.3 || ^5.7 || ^4.8.36" - }, - "type": "library", - "autoload": { - "files": [ - "src/functions_include.php" - ], - "psr-4": { - "React\\Promise\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jan Sorgalla", - "email": "jsorgalla@gmail.com", - "homepage": "https://sorgalla.com/" - }, - { - "name": "Christian Lück", - "email": "christian@clue.engineering", - "homepage": "https://clue.engineering/" - }, - { - "name": "Cees-Jan Kiewiet", - "email": "reactphp@ceesjankiewiet.nl", - "homepage": "https://wyrihaximus.net/" - }, - { - "name": "Chris Boden", - "email": "cboden@gmail.com", - "homepage": "https://cboden.dev/" - } - ], - "description": "A lightweight implementation of CommonJS Promises/A for PHP", - "keywords": [ - "promise", - "promises" - ], - "support": { - "issues": "https://github.com/reactphp/promise/issues", - "source": "https://github.com/reactphp/promise/tree/v2.9.0" - }, - "funding": [ - { - "url": "https://github.com/WyriHaximus", - "type": "github" - }, - { - "url": "https://github.com/clue", - "type": "github" - } - ], - "time": "2022-02-11T10:27:51+00:00" - }, - { - "name": "sebastian/comparator", - "version": "1.2.4", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", - "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", - "shasum": "" - }, - "require": { - "php": ">=5.3.3", - "sebastian/diff": "~1.2", - "sebastian/exporter": "~1.2 || ~2.0" - }, - "require-dev": { - "phpunit/phpunit": "~4.4" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.2.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Volker Dusch", - "email": "github@wallbash.com" - }, - { - "name": "Bernhard Schussek", - "email": "bschussek@2bepublished.at" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Provides the functionality to compare PHP values for equality", - "homepage": "http://www.github.com/sebastianbergmann/comparator", - "keywords": [ - "comparator", - "compare", - "equality" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/comparator/issues", - "source": "https://github.com/sebastianbergmann/comparator/tree/1.2" - }, - "time": "2017-01-29T09:50:25+00:00" - }, - { - "name": "sebastian/diff", - "version": "1.4.3", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/7f066a26a962dbe58ddea9f72a4e82874a3975a4", - "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4", - "shasum": "" - }, - "require": { - "php": "^5.3.3 || ^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Kore Nordmann", - "email": "mail@kore-nordmann.de" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Diff implementation", - "homepage": "https://github.com/sebastianbergmann/diff", - "keywords": [ - "diff" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/diff/issues", - "source": "https://github.com/sebastianbergmann/diff/tree/1.4" - }, - "time": "2017-05-22T07:24:03+00:00" - }, - { - "name": "sebastian/environment", - "version": "1.3.8", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "be2c607e43ce4c89ecd60e75c6a85c126e754aea" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/be2c607e43ce4c89ecd60e75c6a85c126e754aea", - "reference": "be2c607e43ce4c89ecd60e75c6a85c126e754aea", - "shasum": "" - }, - "require": { - "php": "^5.3.3 || ^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.8 || ^5.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.3.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Provides functionality to handle HHVM/PHP environments", - "homepage": "http://www.github.com/sebastianbergmann/environment", - "keywords": [ - "Xdebug", - "environment", - "hhvm" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/environment/issues", - "source": "https://github.com/sebastianbergmann/environment/tree/1.3" - }, - "time": "2016-08-18T05:49:44+00:00" - }, - { - "name": "sebastian/exporter", - "version": "1.2.2", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/42c4c2eec485ee3e159ec9884f95b431287edde4", - "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4", - "shasum": "" - }, - "require": { - "php": ">=5.3.3", - "sebastian/recursion-context": "~1.0" - }, - "require-dev": { - "ext-mbstring": "*", - "phpunit/phpunit": "~4.4" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.3.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Volker Dusch", - "email": "github@wallbash.com" - }, - { - "name": "Bernhard Schussek", - "email": "bschussek@2bepublished.at" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Adam Harvey", - "email": "aharvey@php.net" - } - ], - "description": "Provides the functionality to export PHP variables for visualization", - "homepage": "http://www.github.com/sebastianbergmann/exporter", - "keywords": [ - "export", - "exporter" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/exporter/issues", - "source": "https://github.com/sebastianbergmann/exporter/tree/master" - }, - "time": "2016-06-17T09:04:28+00:00" - }, - { - "name": "sebastian/global-state", - "version": "1.1.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bc37d50fea7d017d3d340f230811c9f1d7280af4", - "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.2" - }, - "suggest": { - "ext-uopz": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Snapshotting of global state", - "homepage": "http://www.github.com/sebastianbergmann/global-state", - "keywords": [ - "global state" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/global-state/issues", - "source": "https://github.com/sebastianbergmann/global-state/tree/1.1.1" - }, - "time": "2015-10-12T03:26:01+00:00" - }, - { - "name": "sebastian/recursion-context", - "version": "1.0.5", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "b19cc3298482a335a95f3016d2f8a6950f0fbcd7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/b19cc3298482a335a95f3016d2f8a6950f0fbcd7", - "reference": "b19cc3298482a335a95f3016d2f8a6950f0fbcd7", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.4" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Adam Harvey", - "email": "aharvey@php.net" - } - ], - "description": "Provides functionality to recursively process PHP variables", - "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "support": { - "issues": "https://github.com/sebastianbergmann/recursion-context/issues", - "source": "https://github.com/sebastianbergmann/recursion-context/tree/master" - }, - "time": "2016-10-03T07:41:43+00:00" - }, - { - "name": "sebastian/version", - "version": "1.0.6", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/version.git", - "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/58b3a85e7999757d6ad81c787a1fbf5ff6c628c6", - "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6", - "shasum": "" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Library that helps with managing the version number of Git-hosted PHP projects", - "homepage": "https://github.com/sebastianbergmann/version", - "support": { - "issues": "https://github.com/sebastianbergmann/version/issues", - "source": "https://github.com/sebastianbergmann/version/tree/1.0.6" - }, - "time": "2015-06-21T13:59:46+00:00" - }, - { - "name": "symfony/polyfill-ctype", - "version": "v1.25.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "30885182c981ab175d4d034db0f6f469898070ab" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/30885182c981ab175d4d034db0f6f469898070ab", - "reference": "30885182c981ab175d4d034db0f6f469898070ab", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "provide": { - "ext-ctype": "*" - }, - "suggest": { - "ext-ctype": "For best performance" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.23-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Ctype\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Gert de Pagter", - "email": "BackEndTea@gmail.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for ctype functions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "ctype", - "polyfill", - "portable" - ], - "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.25.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2021-10-20T20:35:02+00:00" - }, - { - "name": "symfony/yaml", - "version": "v3.4.47", - "source": { - "type": "git", - "url": "https://github.com/symfony/yaml.git", - "reference": "88289caa3c166321883f67fe5130188ebbb47094" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/88289caa3c166321883f67fe5130188ebbb47094", - "reference": "88289caa3c166321883f67fe5130188ebbb47094", - "shasum": "" - }, - "require": { - "php": "^5.5.9|>=7.0.8", - "symfony/polyfill-ctype": "~1.8" - }, - "conflict": { - "symfony/console": "<3.4" - }, - "require-dev": { - "symfony/console": "~3.4|~4.0" - }, - "suggest": { - "symfony/console": "For validating YAML files using the lint command" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\Yaml\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Yaml Component", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/yaml/tree/v3.4.47" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2020-10-24T10:57:07+00:00" - }, - { - "name": "webmozart/assert", - "version": "1.10.0", - "source": { - "type": "git", - "url": "https://github.com/webmozarts/assert.git", - "reference": "6964c76c7804814a842473e0c8fd15bab0f18e25" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/webmozarts/assert/zipball/6964c76c7804814a842473e0c8fd15bab0f18e25", - "reference": "6964c76c7804814a842473e0c8fd15bab0f18e25", - "shasum": "" - }, - "require": { - "php": "^7.2 || ^8.0", - "symfony/polyfill-ctype": "^1.8" - }, - "conflict": { - "phpstan/phpstan": "<0.12.20", - "vimeo/psalm": "<4.6.1 || 4.6.2" - }, - "require-dev": { - "phpunit/phpunit": "^8.5.13" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.10-dev" - } - }, - "autoload": { - "psr-4": { - "Webmozart\\Assert\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Bernhard Schussek", - "email": "bschussek@gmail.com" - } - ], - "description": "Assertions to validate method input/output with nice error messages.", - "keywords": [ - "assert", - "check", - "validate" - ], - "support": { - "issues": "https://github.com/webmozarts/assert/issues", - "source": "https://github.com/webmozarts/assert/tree/1.10.0" - }, - "time": "2021-03-09T10:59:23+00:00" - } - ], - "aliases": [], - "minimum-stability": "stable", - "stability-flags": [], - "prefer-stable": false, - "prefer-lowest": false, - "platform": [], - "platform-dev": [], - "plugin-api-version": "2.1.0" -} diff --git a/phpcs.xml b/phpcs.xml new file mode 100644 index 0000000..3edd2f1 --- /dev/null +++ b/phpcs.xml @@ -0,0 +1,21 @@ + + + + Matomo Core Coding Standard + + + + . + + + + + + + + + + + + + From ee4c47f0d5b3b52700e7b2ab64b90e3a96811667 Mon Sep 17 00:00:00 2001 From: Nathan Gavin Date: Wed, 26 Feb 2025 13:57:31 +1300 Subject: [PATCH 48/85] remove old php versions --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 20af543..3c752ac 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - php-version: ['5.6','7.0','7.1','7.2','7.3','7.4','8.0','8.1','8.4'] + php-version: ['7.2','7.3','7.4','8.0','8.1','8.4'] steps: - name: Checkout repository uses: actions/checkout@v4 From b9a120e70b9aaea2455d1ab14d1cf366153c07f2 Mon Sep 17 00:00:00 2001 From: Nathan Gavin Date: Wed, 26 Feb 2025 15:08:44 +1300 Subject: [PATCH 49/85] update composer version to greater than 7.2 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index b84e7fd..bf86580 100644 --- a/composer.json +++ b/composer.json @@ -11,7 +11,7 @@ } ], "require": { - "php": "7.2" + "php": ">=7.2" }, "require-dev": { "phpunit/phpunit": "^4.8.36", From 664b274bbede3b6eb0a5c1d053fac16359069d2e Mon Sep 17 00:00:00 2001 From: Nathan Gavin Date: Wed, 26 Feb 2025 15:11:33 +1300 Subject: [PATCH 50/85] added needed command --- .github/workflows/main.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3c752ac..d95f2a1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -21,6 +21,7 @@ jobs: uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php-version }} + tools: cs2pr - name: Update package lists run: sudo apt-get update - name: Setup PHP @@ -39,6 +40,8 @@ jobs: run: composer update - name: Composer install run: composer install + - name: test + run: ls -a - name: Check PHP code styles id: phpcs run: ./vendor/bin/phpcs --report-full --report-checkstyle=./phpcs-report.xml From 8f3a64de324ad8408d6365c4a6adc98d839c2d6d Mon Sep 17 00:00:00 2001 From: Nathan Gavin Date: Wed, 26 Feb 2025 15:14:29 +1300 Subject: [PATCH 51/85] add phpcs to composer --- composer.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index bf86580..1d981fa 100644 --- a/composer.json +++ b/composer.json @@ -15,7 +15,8 @@ }, "require-dev": { "phpunit/phpunit": "^4.8.36", - "guzzlehttp/guzzle": "^5.0" + "guzzlehttp/guzzle": "^5.0", + "squizlabs/php_codesniffer": "^3.9" }, "scripts": { "test": [ From 8c7fd3cb375bc7df77642ab751d3b9861a385bc4 Mon Sep 17 00:00:00 2001 From: Nathan Gavin Date: Wed, 26 Feb 2025 15:51:45 +1300 Subject: [PATCH 52/85] add matomo styling dependency --- composer.json | 1 + 1 file changed, 1 insertion(+) diff --git a/composer.json b/composer.json index 1d981fa..6c9499e 100644 --- a/composer.json +++ b/composer.json @@ -15,6 +15,7 @@ }, "require-dev": { "phpunit/phpunit": "^4.8.36", + "matomo-org/matomo-coding-standards": "dev-master", "guzzlehttp/guzzle": "^5.0", "squizlabs/php_codesniffer": "^3.9" }, From 4d209a79ff10ebe9da3f5eb30c1d1012266cca2b Mon Sep 17 00:00:00 2001 From: Nathan Gavin Date: Wed, 26 Feb 2025 15:55:41 +1300 Subject: [PATCH 53/85] add required repo --- composer.json | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/composer.json b/composer.json index 6c9499e..7180588 100644 --- a/composer.json +++ b/composer.json @@ -10,6 +10,12 @@ "homepage": "https://matomo.org/team/" } ], + "repositories": [ + { + "type": "vcs", + "url": "https://github.com/matomo-org/matomo-coding-standards.git" + } + ], "require": { "php": ">=7.2" }, From 6db4123afc967bb6d8c63f76ef9af6097abcf61c Mon Sep 17 00:00:00 2001 From: Nathan Gavin Date: Wed, 26 Feb 2025 15:58:16 +1300 Subject: [PATCH 54/85] add composer rule for allow plugins --- composer.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 7180588..676a228 100644 --- a/composer.json +++ b/composer.json @@ -31,6 +31,9 @@ ] }, "config": { - "sort-packages": true + "sort-packages": true, + "allow-plugins": { + "dealerdirect/phpcodesniffer-composer-installer": true + } } } From 47f80276834abe47b70a216da89141dbd5964551 Mon Sep 17 00:00:00 2001 From: Nathan Gavin Date: Wed, 26 Feb 2025 16:50:11 +1300 Subject: [PATCH 55/85] exclude test file from PHPCS --- phpcs.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/phpcs.xml b/phpcs.xml index 3edd2f1..5d0430a 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -7,6 +7,8 @@ . + tests/ProxyTest.php + From 1b62268ff03beff14e813ca50d2a5e8c273e9ae2 Mon Sep 17 00:00:00 2001 From: Nathan Gavin Date: Wed, 26 Feb 2025 16:59:12 +1300 Subject: [PATCH 56/85] Fix PHPCS --- matomo.php | 1 + piwik.php | 1 + plugins/HeatmapSessionRecording/configs.php | 3 ++- proxy.php | 5 ++--- tests/server/matomo.php | 3 ++- 5 files changed, 8 insertions(+), 5 deletions(-) diff --git a/matomo.php b/matomo.php index 5bcf955..70897bb 100644 --- a/matomo.php +++ b/matomo.php @@ -1,4 +1,5 @@ Date: Wed, 26 Feb 2025 17:04:22 +1300 Subject: [PATCH 57/85] fix PHPCS and exclude test files --- phpcs.xml | 2 +- plugins/HeatmapSessionRecording/configs.php | 1 - proxy.php | 11 ++++++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/phpcs.xml b/phpcs.xml index 5d0430a..93e87fc 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -7,7 +7,7 @@ . - tests/ProxyTest.php + tests/* diff --git a/plugins/HeatmapSessionRecording/configs.php b/plugins/HeatmapSessionRecording/configs.php index 0f66013..a76b5a0 100644 --- a/plugins/HeatmapSessionRecording/configs.php +++ b/plugins/HeatmapSessionRecording/configs.php @@ -7,4 +7,3 @@ $path = 'plugins/HeatmapSessionRecording/configs.php'; include dirname(__FILE__) . '/../../proxy.php'; - diff --git a/proxy.php b/proxy.php index bf8fbe4..076171b 100644 --- a/proxy.php +++ b/proxy.php @@ -160,7 +160,7 @@ function sanitizeContent($content) $content = str_replace($matomoHost, $proxyHost, $content); if (isset($VALID_FILES)) { - foreach($VALID_FILES as $filepath) { + foreach ($VALID_FILES as $filepath) { // replace file paths to match the proxy and discard cb $content = preg_replace('^' . $filepath . '(\?cb\=[a-z0-9]*)?^', $PROXY_URL . 'matomo-proxy.php?file=' . $filepath, $content); } @@ -202,8 +202,9 @@ function getVisitIp() 'HTTP_CLIENT_IP', 'HTTP_CF_CONNECTING_IP', ); - foreach($ipKeys as $ipKey) { - if (isset($_SERVER[$ipKey]) + foreach ($ipKeys as $ipKey) { + if ( + isset($_SERVER[$ipKey]) && filter_var($_SERVER[$ipKey], FILTER_VALIDATE_IP) !== false ) { return $_SERVER[$ipKey]; @@ -248,11 +249,11 @@ function getHttpContentAndStatus($url, $timeout, $user_agent) $header[] = sprintf("Accept-Language: %s", str_replace(array("\n", "\t", "\r"), "", arrayValue($_SERVER, 'HTTP_ACCEPT_LANGUAGE', ''))); // NOTE: any changes made to Piwik\Plugins\PrivacyManager\DoNotTrackHeaderChecker must be made here as well - if((isset($_SERVER['HTTP_X_DO_NOT_TRACK']) && $_SERVER['HTTP_X_DO_NOT_TRACK'] === '1')) { + if ((isset($_SERVER['HTTP_X_DO_NOT_TRACK']) && $_SERVER['HTTP_X_DO_NOT_TRACK'] === '1')) { $header[] = "X-Do-Not-Track: 1"; } - if((isset($_SERVER['HTTP_DNT']) && substr($_SERVER['HTTP_DNT'], 0, 1) === '1')) { + if ((isset($_SERVER['HTTP_DNT']) && substr($_SERVER['HTTP_DNT'], 0, 1) === '1')) { $header[] = "DNT: 1"; } From 760662ee44547e7050ec8b350880921cacd6054d Mon Sep 17 00:00:00 2001 From: Nathan Gavin Date: Wed, 26 Feb 2025 17:08:22 +1300 Subject: [PATCH 58/85] fix PHPCS --- matomo-proxy.php | 5 +++-- proxy.php | 12 ++++++------ 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/matomo-proxy.php b/matomo-proxy.php index d04ffa4..33c215e 100644 --- a/matomo-proxy.php +++ b/matomo-proxy.php @@ -6,7 +6,7 @@ $SUPPORTED_METHODS = [ 'CoreAdminHome.optOut', - 'CoreAdminHome.optOutJS' + 'CoreAdminHome.optOutJS' ]; $VALID_FILES = [ 'plugins/CoreAdminHome/javascripts/optOut.js' @@ -27,7 +27,8 @@ $filerequest = isset($_POST['file']) ? $_POST['file'] : null; } -if (!(isset($filerequest) && in_array($filerequest, $VALID_FILES)) +if ( + !(isset($filerequest) && in_array($filerequest, $VALID_FILES)) && !(isset($module) && isset($action) && in_array("$module.$action", $SUPPORTED_METHODS)) ) { http_response_code(404); diff --git a/proxy.php b/proxy.php index 076171b..6cff207 100644 --- a/proxy.php +++ b/proxy.php @@ -289,13 +289,13 @@ function getHttpContentAndStatus($url, $timeout, $user_agent) $stream_options['http']['header'][] = "Content-Length: " . strlen($postBody); $stream_options['http']['content'] = $postBody; - if(!empty($http_ip_forward_header)) { + if (!empty($http_ip_forward_header)) { $visitIp = getVisitIp(); $stream_options['http']['header'][] = "$http_ip_forward_header: $visitIp"; } } - if($useFopen) { + if ($useFopen) { $ctx = stream_context_create($stream_options); if ($DEBUG_PROXY) { @@ -311,7 +311,7 @@ function getHttpContentAndStatus($url, $timeout, $user_agent) $httpResponseHeaders = array_map('transformHeaderLine', $httpResponseHeaders); } } else { - if(!function_exists('curl_init')) { + if (!function_exists('curl_init')) { throw new Exception("You must either set allow_url_fopen=1 in your PHP configuration, or enable the PHP Curl extension."); } @@ -325,7 +325,8 @@ function getHttpContentAndStatus($url, $timeout, $user_agent) curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_HEADERFUNCTION, 'handleHeaderLine'); - if (!empty($stream_options['http']['method']) + if ( + !empty($stream_options['http']['method']) && $stream_options['http']['method'] == 'POST' ) { curl_setopt($ch, CURLOPT_POST, 1); @@ -342,7 +343,7 @@ function getHttpContentAndStatus($url, $timeout, $user_agent) $content = curl_exec($ch); $httpStatus = curl_getinfo($ch, CURLINFO_HTTP_CODE); - if(!empty($httpStatus)) { + if (!empty($httpStatus)) { $httpStatus = 'HTTP/1.1 ' . $httpStatus; } curl_close($ch); @@ -352,7 +353,6 @@ function getHttpContentAndStatus($url, $timeout, $user_agent) $content, $httpStatus, ); - } function sendHeader($header, $replace = true) From 91434d8bb2c9adcf1ebe89d43db8c755d0c716ea Mon Sep 17 00:00:00 2001 From: Nathan Gavin Date: Wed, 26 Feb 2025 17:11:10 +1300 Subject: [PATCH 59/85] fix phpcs --- tests/github/config.php | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/github/config.php b/tests/github/config.php index 3f43d99..65a6ad9 100644 --- a/tests/github/config.php +++ b/tests/github/config.php @@ -1,4 +1,5 @@ Date: Thu, 27 Feb 2025 10:35:58 +1300 Subject: [PATCH 60/85] made minor changes, moved phpcs to separate action --- {tests/github => .github}/config.php | 0 .github/workflows/main.yml | 17 +------------ .github/workflows/phpcs.yml | 38 ++++++++++++++++++++++++++++ composer.json | 4 +-- tests/ProxyTest.php | 5 ---- 5 files changed, 41 insertions(+), 23 deletions(-) rename {tests/github => .github}/config.php (100%) create mode 100644 .github/workflows/phpcs.yml diff --git a/tests/github/config.php b/.github/config.php similarity index 100% rename from tests/github/config.php rename to .github/config.php diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d95f2a1..be8a998 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -21,13 +21,8 @@ jobs: uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php-version }} - tools: cs2pr - name: Update package lists run: sudo apt-get update - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: '${{ matrix.php-version }}' - name: Setup Apache uses: thunder/apache-shiva-php-action@v1 with: @@ -35,18 +30,8 @@ jobs: site-directory: ${{ github.workspace }} http-port: 8080 - name: Copy config file - run: cp tests/github/config.php config.php - - name: Composer update - run: composer update + run: cp .github/config.php config.php - name: Composer install run: composer install - - name: test - run: ls -a - - name: Check PHP code styles - id: phpcs - run: ./vendor/bin/phpcs --report-full --report-checkstyle=./phpcs-report.xml - - name: Show PHPCS results in PR - if: ${{ always() && steps.phpcs.outcome == 'failure' }} - run: cs2pr ./phpcs-report.xml - name: PHPUnit / PHP ${{ matrix.php-version }} run: composer test diff --git a/.github/workflows/phpcs.yml b/.github/workflows/phpcs.yml new file mode 100644 index 0000000..3bf74e6 --- /dev/null +++ b/.github/workflows/phpcs.yml @@ -0,0 +1,38 @@ +name: PHPCS + +on: pull_request + +permissions: + actions: read + checks: read + contents: read + deployments: none + issues: read + packages: none + pull-requests: read + repository-projects: none + security-events: none + statuses: read + +jobs: + phpcs: + name: PHPCS + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + lfs: false + persist-credentials: false + - name: Install dependencies + run: composer install --dev --prefer-dist --no-progress --no-suggest + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: '7.2' + tools: cs2pr + - name: Check PHP code styles + id: phpcs + run: ./vendor/bin/phpcs --report-full --report-checkstyle=./phpcs-report.xml + - name: Show PHPCS results in PR + if: ${{ always() && steps.phpcs.outcome == 'failure' }} + run: cs2pr ./phpcs-report.xml diff --git a/composer.json b/composer.json index 676a228..fcb8821 100644 --- a/composer.json +++ b/composer.json @@ -20,9 +20,9 @@ "php": ">=7.2" }, "require-dev": { - "phpunit/phpunit": "^4.8.36", + "phpunit/phpunit": "^8.5 || ^8.3 || ^10.1", "matomo-org/matomo-coding-standards": "dev-master", - "guzzlehttp/guzzle": "^5.0", + "guzzlehttp/guzzle": "^6.5", "squizlabs/php_codesniffer": "^3.9" }, "scripts": { diff --git a/tests/ProxyTest.php b/tests/ProxyTest.php index 1f6cc03..f367ad9 100644 --- a/tests/ProxyTest.php +++ b/tests/ProxyTest.php @@ -355,11 +355,6 @@ private function send($query = null, DateTime $modifiedSince = null, $matomoUrl $matomoUrl = $this->getMatomoUrl(); } - if ($forceIpV6) { - // on travis, using an ipv6 ip address causes an error when resolving localhost - //$matomoUrl = str_replace("localhost", "127.0.0.1", $matomoUrl); - } - $client = new Client(); if (!$path) { From 43f0c9fc6262e9df478ad0e19702e95b3e21e4d1 Mon Sep 17 00:00:00 2001 From: Nathan Gavin Date: Thu, 27 Feb 2025 11:01:23 +1300 Subject: [PATCH 61/85] fix phpcs action --- .github/workflows/main.yml | 4 +--- .github/workflows/phpcs.yml | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index be8a998..c9c9627 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,8 +1,6 @@ name: PHPUnit -on: - pull_request: - push: +on: pull_request permissions: contents: read diff --git a/.github/workflows/phpcs.yml b/.github/workflows/phpcs.yml index 3bf74e6..69f35d1 100644 --- a/.github/workflows/phpcs.yml +++ b/.github/workflows/phpcs.yml @@ -23,13 +23,13 @@ jobs: with: lfs: false persist-credentials: false - - name: Install dependencies - run: composer install --dev --prefer-dist --no-progress --no-suggest - name: Setup PHP uses: shivammathur/setup-php@v2 with: php-version: '7.2' tools: cs2pr + - name: Install dependencies + run: composer install - name: Check PHP code styles id: phpcs run: ./vendor/bin/phpcs --report-full --report-checkstyle=./phpcs-report.xml From 54877de6683a0dd0109e9a41cb2714409aa934d8 Mon Sep 17 00:00:00 2001 From: Nathan Gavin Date: Thu, 27 Feb 2025 11:07:12 +1300 Subject: [PATCH 62/85] testing --- tests/ProxyTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/ProxyTest.php b/tests/ProxyTest.php index f367ad9..50e33ae 100644 --- a/tests/ProxyTest.php +++ b/tests/ProxyTest.php @@ -388,7 +388,7 @@ private function send($query = null, DateTime $modifiedSince = null, $matomoUrl 'curl' => [CURLOPT_IPRESOLVE => CURL_IPRESOLVE_V6], ]; } - + var_dump($requestOptions); $request = $client->createRequest($method, $matomoUrl . $path . $query, $requestOptions); $response = $client->send($request); From 498203495b5ae52d4108d04000b015af058b6477 Mon Sep 17 00:00:00 2001 From: Nathan Gavin Date: Thu, 27 Feb 2025 11:15:20 +1300 Subject: [PATCH 63/85] update client code to new version --- tests/ProxyTest.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/ProxyTest.php b/tests/ProxyTest.php index 50e33ae..231fc07 100644 --- a/tests/ProxyTest.php +++ b/tests/ProxyTest.php @@ -389,8 +389,7 @@ private function send($query = null, DateTime $modifiedSince = null, $matomoUrl ]; } var_dump($requestOptions); - $request = $client->createRequest($method, $matomoUrl . $path . $query, $requestOptions); - $response = $client->send($request); + $response = $client->request($method, $matomoUrl . $path . $query, $requestOptions); return $response; } From bcc92dc6220ed3d8b4af8ccb17d8a88e612edfaa Mon Sep 17 00:00:00 2001 From: Nathan Gavin Date: Thu, 27 Feb 2025 11:18:43 +1300 Subject: [PATCH 64/85] test --- tests/ProxyTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/ProxyTest.php b/tests/ProxyTest.php index 231fc07..d778298 100644 --- a/tests/ProxyTest.php +++ b/tests/ProxyTest.php @@ -388,9 +388,9 @@ private function send($query = null, DateTime $modifiedSince = null, $matomoUrl 'curl' => [CURLOPT_IPRESOLVE => CURL_IPRESOLVE_V6], ]; } - var_dump($requestOptions); $response = $client->request($method, $matomoUrl . $path . $query, $requestOptions); + var_dump($response); return $response; } From c0eff857c63c627b54736d9b92a3d22c6c940a53 Mon Sep 17 00:00:00 2001 From: Nathan Gavin Date: Thu, 27 Feb 2025 11:34:03 +1300 Subject: [PATCH 65/85] test --- tests/ProxyTest.php | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/ProxyTest.php b/tests/ProxyTest.php index d778298..854d130 100644 --- a/tests/ProxyTest.php +++ b/tests/ProxyTest.php @@ -13,6 +13,7 @@ public function get_without_parameters_should_forward_matomo_js_content() { $response = $this->send(); + var_dump($response->getHeader('Content-Type')); $this->assertEquals(200, $response->getStatusCode()); $this->assertEquals('this is matomo.js', $response->getBody()->getContents()); $this->assertEquals('application/javascript; charset=UTF-8', $response->getHeader('Content-Type')); From b2228360fdd10c65be29916f79b68db92f32d76a Mon Sep 17 00:00:00 2001 From: Nathan Gavin Date: Thu, 27 Feb 2025 11:36:52 +1300 Subject: [PATCH 66/85] test --- tests/ProxyTest.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/ProxyTest.php b/tests/ProxyTest.php index 854d130..cd37bd4 100644 --- a/tests/ProxyTest.php +++ b/tests/ProxyTest.php @@ -13,10 +13,10 @@ public function get_without_parameters_should_forward_matomo_js_content() { $response = $this->send(); - var_dump($response->getHeader('Content-Type')); + var_dump($response->getHeader('Content-Type')[0]); $this->assertEquals(200, $response->getStatusCode()); $this->assertEquals('this is matomo.js', $response->getBody()->getContents()); - $this->assertEquals('application/javascript; charset=UTF-8', $response->getHeader('Content-Type')); + $this->assertEquals('application/javascript; charset=UTF-8', $response->getHeader('Content-Type')[0]); } /** @@ -391,7 +391,6 @@ private function send($query = null, DateTime $modifiedSince = null, $matomoUrl } $response = $client->request($method, $matomoUrl . $path . $query, $requestOptions); - var_dump($response); return $response; } From 31d188e418d4385a1e4dc2c8d8b89506edaaca52 Mon Sep 17 00:00:00 2001 From: Nathan Gavin Date: Thu, 27 Feb 2025 11:41:20 +1300 Subject: [PATCH 67/85] updating tests --- tests/ProxyTest.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/tests/ProxyTest.php b/tests/ProxyTest.php index cd37bd4..58e9e8a 100644 --- a/tests/ProxyTest.php +++ b/tests/ProxyTest.php @@ -13,7 +13,6 @@ public function get_without_parameters_should_forward_matomo_js_content() { $response = $this->send(); - var_dump($response->getHeader('Content-Type')[0]); $this->assertEquals(200, $response->getStatusCode()); $this->assertEquals('this is matomo.js', $response->getBody()->getContents()); $this->assertEquals('application/javascript; charset=UTF-8', $response->getHeader('Content-Type')[0]); @@ -39,8 +38,8 @@ public function matomo_js_should_be_updated_if_more_than_1_day() $this->assertEquals(200, $response->getStatusCode()); $this->assertEquals('this is matomo.js', $response->getBody()->getContents()); - $this->assertEquals('application/javascript; charset=UTF-8', $response->getHeader('Content-Type')); - $this->assertNotNull($response->getHeader('Last-Modified')); + $this->assertEquals('application/javascript; charset=UTF-8', $response->getHeader('Content-Type')[0]); + $this->assertNotNull($response->getHeader('Last-Modified')[0]); } /** @@ -51,7 +50,7 @@ public function get_with_parameters_should_forward_matomo_php() $response = $this->send('foo=bar'); $this->assertEquals(200, $response->getStatusCode()); - $this->assertEquals('image/gif', $response->getHeader('Content-Type')); + $this->assertEquals('image/gif', $response->getHeader('Content-Type')[0]); } /** @@ -241,7 +240,7 @@ public function test_debug_requests_are_scrubbed_properly() RESPONSE; $this->assertEquals(200, $response->getStatusCode()); - $this->assertEquals(131, $response->getHeader('content-length')); + $this->assertEquals(131, $response->getHeader('content-length')[0]); $this->assertEquals($expected, $responseBody); } From 18d719c06b95018c1c926f70f7af3fdd3c50d850 Mon Sep 17 00:00:00 2001 From: Nathan Gavin Date: Thu, 27 Feb 2025 13:07:18 +1300 Subject: [PATCH 68/85] fix test bug --- tests/ProxyTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/ProxyTest.php b/tests/ProxyTest.php index 58e9e8a..ec2cd41 100644 --- a/tests/ProxyTest.php +++ b/tests/ProxyTest.php @@ -294,7 +294,7 @@ public function test_proxy_works_with_ipv6() /** * @expectedException GuzzleHttp\Exception\ClientException - * @expectedExceptionMessage 404 [reason phrase] Not Found + * @expectedExceptionMessage 404 Not Found */ public function test_indexphp_blocked_requests_are_not_proxied() { From 9f9aa692a85fb202d469ee18c5e51910eaf7805d Mon Sep 17 00:00:00 2001 From: Nathan Gavin Date: Thu, 27 Feb 2025 13:12:44 +1300 Subject: [PATCH 69/85] update tests --- tests/ProxyTest.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/ProxyTest.php b/tests/ProxyTest.php index ec2cd41..3f4c141 100644 --- a/tests/ProxyTest.php +++ b/tests/ProxyTest.php @@ -303,7 +303,7 @@ public function test_indexphp_blocked_requests_are_not_proxied() /** * @expectedException GuzzleHttp\Exception\ClientException - * @expectedExceptionMessage 404 [reason phrase] Not Found + * @expectedExceptionMessage 404 Not Found */ public function test_indexphp_blocked_post_requests_are_not_proxied() { @@ -312,7 +312,7 @@ public function test_indexphp_blocked_post_requests_are_not_proxied() /** * @expectedException GuzzleHttp\Exception\ClientException - * @expectedExceptionMessage 404 [reason phrase] Not Found + * @expectedExceptionMessage 404 Not Found */ public function test_indexphp_empty_requests_are_not_proxied() { @@ -321,7 +321,7 @@ public function test_indexphp_empty_requests_are_not_proxied() /** * @expectedException GuzzleHttp\Exception\ClientException - * @expectedExceptionMessage 404 [reason phrase] Not Found + * @expectedExceptionMessage 404 Not Found */ public function test_indexphp_empty_post_requests_are_not_proxied() { From 7e84d4c2ce13477d9ccb78d3bed60ad20b1a7c66 Mon Sep 17 00:00:00 2001 From: Nathan Gavin Date: Thu, 27 Feb 2025 13:16:48 +1300 Subject: [PATCH 70/85] test config file --- .github/workflows/main.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c9c9627..25861db 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -29,6 +29,8 @@ jobs: http-port: 8080 - name: Copy config file run: cp .github/config.php config.php + - name: test + run: ls -a - name: Composer install run: composer install - name: PHPUnit / PHP ${{ matrix.php-version }} From 75de0f94c4affff9fe6c716f60de5937034bfa0c Mon Sep 17 00:00:00 2001 From: Nathan Gavin Date: Thu, 27 Feb 2025 13:41:01 +1300 Subject: [PATCH 71/85] testing theory --- tests/config.php | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 tests/config.php diff --git a/tests/config.php b/tests/config.php new file mode 100644 index 0000000..e69de29 From 8c71d7ef015af9cc6674c0b3c8b2793001b00688 Mon Sep 17 00:00:00 2001 From: Nathan Gavin Date: Thu, 27 Feb 2025 13:44:32 +1300 Subject: [PATCH 72/85] test --- .github/workflows/main.yml | 2 +- tests/config.php | 0 2 files changed, 1 insertion(+), 1 deletion(-) delete mode 100644 tests/config.php diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 25861db..3949f50 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -30,7 +30,7 @@ jobs: - name: Copy config file run: cp .github/config.php config.php - name: test - run: ls -a + run: ls tests/ -a - name: Composer install run: composer install - name: PHPUnit / PHP ${{ matrix.php-version }} diff --git a/tests/config.php b/tests/config.php deleted file mode 100644 index e69de29..0000000 From f1a0cad5f5988ae8fece00c1020a0b6119461452 Mon Sep 17 00:00:00 2001 From: Nathan Gavin Date: Thu, 27 Feb 2025 14:06:07 +1300 Subject: [PATCH 73/85] testing --- tests/ProxyTest.php | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/ProxyTest.php b/tests/ProxyTest.php index 3f4c141..023a0a0 100644 --- a/tests/ProxyTest.php +++ b/tests/ProxyTest.php @@ -396,6 +396,7 @@ private function send($query = null, DateTime $modifiedSince = null, $matomoUrl private function getMatomoUrl() { $pathConfig = "./config.php"; + var_dump(dirname(__FILE__)); if(!file_exists($pathConfig)) { if(file_exists("./config.php.save")) { throw new Exception("Rename config.php.save to config.php and try again."); From 97b781e155589adc9b6fc0655a719ddcbc75cfa8 Mon Sep 17 00:00:00 2001 From: Nathan Gavin Date: Thu, 27 Feb 2025 14:08:33 +1300 Subject: [PATCH 74/85] fix config path --- tests/ProxyTest.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/ProxyTest.php b/tests/ProxyTest.php index 023a0a0..36acf1b 100644 --- a/tests/ProxyTest.php +++ b/tests/ProxyTest.php @@ -395,10 +395,10 @@ private function send($query = null, DateTime $modifiedSince = null, $matomoUrl private function getMatomoUrl() { - $pathConfig = "./config.php"; + $pathConfig = "../config.php"; var_dump(dirname(__FILE__)); if(!file_exists($pathConfig)) { - if(file_exists("./config.php.save")) { + if(file_exists("../config.php.save")) { throw new Exception("Rename config.php.save to config.php and try again."); } @@ -417,9 +417,9 @@ private function getMatomoUrl() private function getProxyUrl() { - $pathConfig = "./config.php"; + $pathConfig = "../config.php"; if(!file_exists($pathConfig)) { - if(file_exists("./config.php.save")) { + if(file_exists("../config.php.save")) { throw new Exception("Rename config.php.save to config.php and try again."); } From 8db5b15948bd0bbd5f6605495764c2d4e7911dc7 Mon Sep 17 00:00:00 2001 From: Nathan Gavin Date: Thu, 27 Feb 2025 14:15:36 +1300 Subject: [PATCH 75/85] update path --- tests/ProxyTest.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/tests/ProxyTest.php b/tests/ProxyTest.php index 36acf1b..fc05fbf 100644 --- a/tests/ProxyTest.php +++ b/tests/ProxyTest.php @@ -395,10 +395,9 @@ private function send($query = null, DateTime $modifiedSince = null, $matomoUrl private function getMatomoUrl() { - $pathConfig = "../config.php"; - var_dump(dirname(__FILE__)); + $pathConfig = __DIR__ . "../config.php"; if(!file_exists($pathConfig)) { - if(file_exists("../config.php.save")) { + if(file_exists(__DIR__ . "../config.php.save")) { throw new Exception("Rename config.php.save to config.php and try again."); } @@ -417,9 +416,9 @@ private function getMatomoUrl() private function getProxyUrl() { - $pathConfig = "../config.php"; + $pathConfig = __DIR__ . "../config.php"; if(!file_exists($pathConfig)) { - if(file_exists("../config.php.save")) { + if(file_exists(__DIR__ . "../config.php.save")) { throw new Exception("Rename config.php.save to config.php and try again."); } From 5ff488a319f67db73ba147ed8868b164cba6c9e8 Mon Sep 17 00:00:00 2001 From: Nathan Gavin Date: Thu, 27 Feb 2025 14:17:46 +1300 Subject: [PATCH 76/85] revert path --- tests/ProxyTest.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/ProxyTest.php b/tests/ProxyTest.php index fc05fbf..3f4c141 100644 --- a/tests/ProxyTest.php +++ b/tests/ProxyTest.php @@ -395,9 +395,9 @@ private function send($query = null, DateTime $modifiedSince = null, $matomoUrl private function getMatomoUrl() { - $pathConfig = __DIR__ . "../config.php"; + $pathConfig = "./config.php"; if(!file_exists($pathConfig)) { - if(file_exists(__DIR__ . "../config.php.save")) { + if(file_exists("./config.php.save")) { throw new Exception("Rename config.php.save to config.php and try again."); } @@ -416,9 +416,9 @@ private function getMatomoUrl() private function getProxyUrl() { - $pathConfig = __DIR__ . "../config.php"; + $pathConfig = "./config.php"; if(!file_exists($pathConfig)) { - if(file_exists(__DIR__ . "../config.php.save")) { + if(file_exists("./config.php.save")) { throw new Exception("Rename config.php.save to config.php and try again."); } From 2471f15d88d5f9481fa644cd5564b80660500bcf Mon Sep 17 00:00:00 2001 From: Nathan Gavin Date: Thu, 27 Feb 2025 16:15:48 +1300 Subject: [PATCH 77/85] update to new guzzle code --- tests/ProxyTest.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/ProxyTest.php b/tests/ProxyTest.php index 3f4c141..6d3c0f2 100644 --- a/tests/ProxyTest.php +++ b/tests/ProxyTest.php @@ -355,7 +355,9 @@ private function send($query = null, DateTime $modifiedSince = null, $matomoUrl $matomoUrl = $this->getMatomoUrl(); } - $client = new Client(); + $client = new Client([ + GuzzleHttp\RequestOptions::HTTP_ERRORS => false + ]); if (!$path) { $path = '/matomo.php'; @@ -441,4 +443,9 @@ private function getBody($response) // 127.0.0.1 may appear as ::1 return str_replace('::1', '127.0.0.1', $responseBody); } + + public function assertFileNotExists(string $filename): void + { + $this->assertFalse(file_exists($filename), "Failed asserting that file does not exist: $filename"); + } } From 6f5e046d24a14f3e90f0b100ff0f0ed0f3f2aca8 Mon Sep 17 00:00:00 2001 From: caddoo Date: Thu, 27 Feb 2025 16:45:24 +1300 Subject: [PATCH 78/85] Change assertion for file assertion --- tests/ProxyTest.php | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/tests/ProxyTest.php b/tests/ProxyTest.php index 6d3c0f2..10e0be8 100644 --- a/tests/ProxyTest.php +++ b/tests/ProxyTest.php @@ -114,7 +114,7 @@ public function get_return_matomoJs_without_error_when_server_down() // Remove config file -> matomo.php will use the default value 'http://your-matomo-domain.example.org/matomo/' rename(__DIR__ . '/../config.php', __DIR__ . '/../config.php.save'); - $this->assertFileNotExists('config.php'); + $this->assertFalse(file_exists('config.php'), "Failed asserting that file does not exist: config.php"); try { $response = $this->send(null, null, $matomoUrl); @@ -443,9 +443,4 @@ private function getBody($response) // 127.0.0.1 may appear as ::1 return str_replace('::1', '127.0.0.1', $responseBody); } - - public function assertFileNotExists(string $filename): void - { - $this->assertFalse(file_exists($filename), "Failed asserting that file does not exist: $filename"); - } } From 0942d6a935cf91d355c5d710cabfeb8fe6b0a0b1 Mon Sep 17 00:00:00 2001 From: caddoo Date: Thu, 27 Feb 2025 16:56:32 +1300 Subject: [PATCH 79/85] Change tests to not expect exceptions --- tests/ProxyTest.php | 44 ++++++++++++-------------------------------- 1 file changed, 12 insertions(+), 32 deletions(-) diff --git a/tests/ProxyTest.php b/tests/ProxyTest.php index 10e0be8..77b48fc 100644 --- a/tests/ProxyTest.php +++ b/tests/ProxyTest.php @@ -89,19 +89,11 @@ public function get_with_parameters_should_forward_response_code() */ public function error_should_forward_error_code() { - try { - $this->send('status=404'); - $this->fail('The proxy did not return a 404 response'); - } catch (RequestException $e) { - $this->assertEquals(404, $e->getResponse()->getStatusCode()); - } + $response = $this->send('status=404'); + $this->assertEquals(404, $response->getStatusCode()); - try { - $this->send('status=500'); - $this->fail('The proxy did not return a 500 response'); - } catch (RequestException $e) { - $this->assertEquals(500, $e->getResponse()->getStatusCode()); - } + $response = $this->send('status=500'); + $this->assertEquals(500, $response->getStatusCode()); } /** @@ -292,40 +284,28 @@ public function test_proxy_works_with_ipv6() $this->assertEquals($expected, $responseBody); } - /** - * @expectedException GuzzleHttp\Exception\ClientException - * @expectedExceptionMessage 404 Not Found - */ public function test_indexphp_blocked_requests_are_not_proxied() { - $this->send('module=Something&action=else', null, null, null, '/matomo-proxy.php'); + $response = $this->send('module=Something&action=else', null, null, null, '/matomo-proxy.php'); + $this->assertEquals(404, $response->getStatusCode()); } - /** - * @expectedException GuzzleHttp\Exception\ClientException - * @expectedExceptionMessage 404 Not Found - */ public function test_indexphp_blocked_post_requests_are_not_proxied() { - $this->send('module=Something&action=else', null, null, null, '/matomo-proxy.php', 'POST'); + $response = $this->send('module=Something&action=else', null, null, null, '/matomo-proxy.php', 'POST'); + $this->assertEquals(404, $response->getStatusCode()); } - /** - * @expectedException GuzzleHttp\Exception\ClientException - * @expectedExceptionMessage 404 Not Found - */ public function test_indexphp_empty_requests_are_not_proxied() { - $this->send('', null, null, null, '/matomo-proxy.php'); + $response = $this->send('', null, null, null, '/matomo-proxy.php'); + $this->assertEquals(404, $response->getStatusCode()); } - /** - * @expectedException GuzzleHttp\Exception\ClientException - * @expectedExceptionMessage 404 Not Found - */ public function test_indexphp_empty_post_requests_are_not_proxied() { - $this->send('', null, null, null, '/matomo-proxy.php', 'POST'); + $response = $this->send('', null, null, null, '/matomo-proxy.php', 'POST'); + $this->assertEquals(404, $response->getStatusCode()); } public function test_proxy_works_with_ipv6_in_header() From 7b77b902fe91b4257e19bcac5571997052a6fd01 Mon Sep 17 00:00:00 2001 From: caddoo Date: Thu, 27 Feb 2025 16:58:44 +1300 Subject: [PATCH 80/85] Remove Vagrantfile --- Vagrantfile | 12 ------------ 1 file changed, 12 deletions(-) delete mode 100644 Vagrantfile diff --git a/Vagrantfile b/Vagrantfile deleted file mode 100644 index d632b2a..0000000 --- a/Vagrantfile +++ /dev/null @@ -1,12 +0,0 @@ -VAGRANTFILE_API_VERSION = "2" - -Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| - - config.vm.box = "avenuefactory/lamp" - - config.vm.network "forwarded_port", guest: 80, host: 8080 - - config.vm.synced_folder ".", "/var/www/html" - config.vm.synced_folder ".", "/vagrant" - -end From 845dc4797c56ea29bb41064c6cf7b5c00e1c3bcd Mon Sep 17 00:00:00 2001 From: caddoo Date: Thu, 27 Feb 2025 17:07:35 +1300 Subject: [PATCH 81/85] Try run on PHP server --- .github/config.php | 2 +- .github/workflows/main.yml | 14 ++++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/.github/config.php b/.github/config.php index 65a6ad9..ebf3ae6 100644 --- a/.github/config.php +++ b/.github/config.php @@ -2,7 +2,7 @@ $MATOMO_URL = 'http://localhost:8080/tests/server/'; -$PROXY_URL = 'http://proxy:8080/'; +$PROXY_URL = 'http://localhost:8080/'; $TOKEN_AUTH = 'xyz'; diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3949f50..f4c316a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -21,12 +21,14 @@ jobs: php-version: ${{ matrix.php-version }} - name: Update package lists run: sudo apt-get update - - name: Setup Apache - uses: thunder/apache-shiva-php-action@v1 - with: - php-version: '${{ matrix.php-version }}' - site-directory: ${{ github.workspace }} - http-port: 8080 + - name: Run PHP server + run: php -S localhost:8080 -t ./ > phpd.log 2>&1 & +# - name: Setup Apache +# uses: thunder/apache-shiva-php-action@v1 +# with: +# php-version: '${{ matrix.php-version }}' +# site-directory: ${{ github.workspace }} +# http-port: 8080 - name: Copy config file run: cp .github/config.php config.php - name: test From 8ce8c31639c609456d6863259e25b257804a0110 Mon Sep 17 00:00:00 2001 From: caddoo Date: Thu, 27 Feb 2025 17:10:10 +1300 Subject: [PATCH 82/85] Revert "Try run on PHP server" This reverts commit 845dc4797c56ea29bb41064c6cf7b5c00e1c3bcd. --- .github/config.php | 2 +- .github/workflows/main.yml | 14 ++++++-------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/.github/config.php b/.github/config.php index ebf3ae6..65a6ad9 100644 --- a/.github/config.php +++ b/.github/config.php @@ -2,7 +2,7 @@ $MATOMO_URL = 'http://localhost:8080/tests/server/'; -$PROXY_URL = 'http://localhost:8080/'; +$PROXY_URL = 'http://proxy:8080/'; $TOKEN_AUTH = 'xyz'; diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f4c316a..3949f50 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -21,14 +21,12 @@ jobs: php-version: ${{ matrix.php-version }} - name: Update package lists run: sudo apt-get update - - name: Run PHP server - run: php -S localhost:8080 -t ./ > phpd.log 2>&1 & -# - name: Setup Apache -# uses: thunder/apache-shiva-php-action@v1 -# with: -# php-version: '${{ matrix.php-version }}' -# site-directory: ${{ github.workspace }} -# http-port: 8080 + - name: Setup Apache + uses: thunder/apache-shiva-php-action@v1 + with: + php-version: '${{ matrix.php-version }}' + site-directory: ${{ github.workspace }} + http-port: 8080 - name: Copy config file run: cp .github/config.php config.php - name: test From d0b6979d0dda3f98c32ed227386971802c21e6e2 Mon Sep 17 00:00:00 2001 From: caddoo Date: Thu, 27 Feb 2025 17:13:02 +1300 Subject: [PATCH 83/85] Pin action to specific commit --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3949f50..21557d9 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -22,7 +22,7 @@ jobs: - name: Update package lists run: sudo apt-get update - name: Setup Apache - uses: thunder/apache-shiva-php-action@v1 + uses: thunder/apache-shiva-php-action@81bccd449b62dcf7dae2b33a21749fceeb2401e8 with: php-version: '${{ matrix.php-version }}' site-directory: ${{ github.workspace }} From 7e729a9669df2cde6112ac238e41ef49c86df328 Mon Sep 17 00:00:00 2001 From: Nathan Gavin Date: Thu, 27 Feb 2025 17:30:04 +1300 Subject: [PATCH 84/85] remove test --- .github/workflows/main.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 21557d9..0e3013e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -29,8 +29,6 @@ jobs: http-port: 8080 - name: Copy config file run: cp .github/config.php config.php - - name: test - run: ls tests/ -a - name: Composer install run: composer install - name: PHPUnit / PHP ${{ matrix.php-version }} From 53971f83921d08ab03cb1f94068ebd51add0f1b9 Mon Sep 17 00:00:00 2001 From: Stefan Giehl Date: Thu, 27 Feb 2025 10:03:40 +0100 Subject: [PATCH 85/85] fix phpunit version requirement --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index fcb8821..12f59ea 100644 --- a/composer.json +++ b/composer.json @@ -20,7 +20,7 @@ "php": ">=7.2" }, "require-dev": { - "phpunit/phpunit": "^8.5 || ^8.3 || ^10.1", + "phpunit/phpunit": "^8.5 || ^9.3 || ^10.1", "matomo-org/matomo-coding-standards": "dev-master", "guzzlehttp/guzzle": "^6.5", "squizlabs/php_codesniffer": "^3.9"