Skip to content

Commit b758b4d

Browse files
committed
Add MacPorts instructions for switching PHP versions
1 parent 10ff798 commit b758b4d

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

downloads-get-instructions.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
<?php
22
$file = 'unknown';
33
$latestPhpVersion = '8.4';
4+
$priorPhpVersion = '8.3';
45

56
if (!isset($options)) {
67
$options = [
78
'os' => '',
89
'usage' => '',
910
'version' => '',
11+
'priorVersion' => $priorPhpVersion,
1012
];
1113
}
1214

@@ -65,6 +67,8 @@
6567

6668
$version = $options['version'];
6769
$versionNoDot = str_replace('.', '', $version);
70+
$priorVersion = $options['priorVersion'];
71+
$priorVersionNoDot = str_replace('.', '', $priorPhpVersion);
6872

6973
if (file_exists(__DIR__ . "/include/download-instructions/{$file}.php")) {
7074
include __DIR__ . "/include/download-instructions/{$file}.php";

include/download-instructions/osx-macports.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,10 @@
44
<pre><code class="language-bash line-numbers">
55
# Please refer to https://guide.macports.org/chunked/installing.macports.html for installing MacPorts.
66
sudo port install php<?= $versionNoDot; ?>
7+
8+
# To install a previous version:
9+
sudo port install php<?= $priorVersionNoDot; ?>
10+
11+
# To switch to a different version:
12+
sudo port select php php<?= $priorVersionNoDot; ?>
713
</code></pre>

0 commit comments

Comments
 (0)