Skip to content

Commit

Permalink
Ensure config.php is compatible with our supported PHP versions
Browse files Browse the repository at this point in the history
  • Loading branch information
markmetcalfe authored and derschatta committed Nov 24, 2024
1 parent b89c0ea commit 0c5a561
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 9 deletions.
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');

// 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

0 comments on commit 0c5a561

Please sign in to comment.