Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure config.php is compatible with our supported PHP versions #299

Merged
merged 1 commit into from
Nov 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .github/workflows/validate-config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Validate that the example config.php has valid syntax

on:
pull_request:
paths:
- 'config.php'

jobs:
validate-config:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 1
- name: Set up PHP 8
uses: shivammathur/setup-php@c541c155eee45413f5b09a52248675b1a2575231 # v2.31.1
with:
php-version: 8.3
- name: Validate config.php syntax is compatible with PHP 8
run: php -l ./config.php
- name: Set up PHP 5.3
uses: shivammathur/setup-php@c541c155eee45413f5b09a52248675b1a2575231 # v2.31.1
with:
php-version: 5.3
- name: Validate config.php syntax is compatible with PHP 5.3
run: php -l ./config.php
14 changes: 5 additions & 9 deletions config.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,17 +136,13 @@
* then please contribute what you did back to the docker-dev repository :)
*/
// Ngrok uses a few different URLs, add if a new one is used
$ngrok_urls = [
'ngrok.io',
'ngrok-free.app',
'ngrok.app',
];
$ngrok_urls = array('ngrok-free.app', 'ngrok.app');
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: I removed the .io URL as ngrok no longer uses .io


// Depending on the Ngrok version its hostname is stored in different server vars
$ngrok_server_vars = [
$_SERVER['HTTP_X_FORWARDED_HOST'] ?? '',
$_SERVER['HTTP_X_ORIGINAL_HOST'] ?? '',
];
$ngrok_server_vars = array(
$_SERVER['HTTP_X_FORWARDED_HOST'] ?: '',
$_SERVER['HTTP_X_ORIGINAL_HOST'] ?: '',
);

$ngrok_hostname = '';
foreach ($ngrok_server_vars as $server_var) {
Expand Down