Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3cfe194

Browse files
authored
Remove safe_mode check in curl client (#435)
* Remove safe_mode check in curl client INI directive 'safe_mode' is deprecated since PHP 5.3 and removed since PHP 5.4 * Update Dockerfile to make it build * Remove upload to scrutinizer-ci We no longer seem to have access to it * Fix ci BC action At the moment the code gets checked out by a user with the uid 1001 but the nyholm/roave-bc-check-ga runs as root which triggers the fatal: detected dubious ownership in repository at '/github/workspace' error. Running the commands in that container as a user with the user id 1001 is, to my understanding, not possible using default GitHub Actions config so the workaround of using addnab/docker-run-action@v3 is used to allow for defining the user id uding -u 1001 (and setting then not available, GITHUB_REPOSITORY variable). * Add missing symfony and php version to test matrix
1 parent 67c7373 commit 3cfe194

5 files changed

Lines changed: 10 additions & 11 deletions

File tree

.github/workflows/checks.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,8 @@ jobs:
1212
uses: actions/checkout@v2
1313

1414
- name: Roave BC Check
15-
uses: docker://nyholm/roave-bc-check-ga
15+
uses: "addnab/docker-run-action@v3"
16+
with:
17+
image: "nyholm/roave-bc-check-ga"
18+
options: "--env GITHUB_REPOSITORY=${{ github.repository }} --user 1001 --volume ${{ github.workspace }}:/app"
19+
run: "/entrypoint.sh"

.github/workflows/ci.yml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ jobs:
1010
strategy:
1111
max-parallel: 10
1212
matrix:
13-
php: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3']
14-
sf_version: ['3.4.*', '4.4.*', '5.0.*', '6.4.*', '7.0.*']
13+
php: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5']
14+
sf_version: ['3.4.*', '4.4.*', '5.0.*', '6.4.*', '7.4.*', '8.0.*']
1515

1616
steps:
1717
- name: Set up PHP
@@ -91,11 +91,6 @@ jobs:
9191
- name: Run tests
9292
run: ./vendor/bin/phpunit --coverage-text --coverage-clover=coverage.xml
9393

94-
- name: Upload coverage
95-
run: |
96-
wget https://scrutinizer-ci.com/ocular.phar
97-
php ocular.phar code-coverage:upload --format=php-clover coverage.xml || true
98-
9994
h2push:
10095
name: HTTP/2 Server Push
10196
runs-on: ubuntu-latest

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM php:7.4-fpm-buster
1+
FROM php:7.4-fpm-bullseye
22

33
# Install Nginx
44
RUN apt-get update -qq && apt-get install -y --no-install-recommends -qq nginx

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"psr/http-message": "^1.1 || ^2.0",
2323
"psr/http-client": "^1.0",
2424
"php-http/httplug": "^1.1 || ^2.0",
25-
"symfony/options-resolver": "^3.4 || ^4.0 || ^5.0 || ^6.0 || ^7.0",
25+
"symfony/options-resolver": "^3.4 || ^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0",
2626
"psr/http-factory": "^1.0"
2727
},
2828
"require-dev": {

lib/Client/AbstractCurl.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ private function setOptionsFromParameterBag($curl, ParameterBag $options): void
193193
curl_setopt($curl, \CURLOPT_PROXY, $proxy);
194194
}
195195

196-
$canFollow = !\ini_get('safe_mode') && !\ini_get('open_basedir') && $options->get('allow_redirects');
196+
$canFollow = !\ini_get('open_basedir') && $options->get('allow_redirects');
197197
curl_setopt($curl, \CURLOPT_FOLLOWLOCATION, $canFollow);
198198
curl_setopt($curl, \CURLOPT_MAXREDIRS, $canFollow ? $options->get('max_redirects') : 0);
199199
curl_setopt($curl, \CURLOPT_SSL_VERIFYPEER, $options->get('verify') ? 1 : 0);

0 commit comments

Comments
 (0)