Skip to content
Open
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
28 changes: 20 additions & 8 deletions downloads-get-instructions.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,31 @@

switch ($options['os']) {
case 'linux':
$defaultOrCommunity = ($options['version'] !== 'default' || $multiversion) ? 'community' : 'default';
if ($defaultOrCommunity === 'community' && $options['version'] == 'default') {
$options['version'] = $latestPhpVersion;
}
if (str_starts_with("{$options['osvariant']}", 'linux-docker')) {
$file = "{$options['osvariant']}-{$defaultOrCommunity}";
if ($options['osvariant'] === 'linux-frankenphp') {
if ($options['version'] === 'default') {
$options['version'] = $latestPhpVersion;
}
$file = 'frankenphp';
} else {
$file = "{$options['osvariant']}-web-{$defaultOrCommunity}";
$defaultOrCommunity = ($options['version'] !== 'default' || $multiversion) ? 'community' : 'default';
if ($defaultOrCommunity === 'community' && $options['version'] == 'default') {
$options['version'] = $latestPhpVersion;
}
if (str_starts_with("{$options['osvariant']}", 'linux-docker')) {
$file = "{$options['osvariant']}-{$defaultOrCommunity}";
} else {
$file = "{$options['osvariant']}-web-{$defaultOrCommunity}";
}
}
break;
case 'osx':
case 'windows':
if ($options['osvariant'] === "{$options['os']}-scoop") {
if ($options['osvariant'] === "{$options['os']}-frankenphp") {
if ($options['version'] === 'default') {
$options['version'] = $latestPhpVersion;
}
$file = 'frankenphp';
} elseif ($options['osvariant'] === "{$options['os']}-scoop") {
$file = "{$options['osvariant']}-" . ($options['version'] == $latestPhpVersion ? 'main' : 'versions');
} else {
$file = "{$options['osvariant']}";
Expand Down
6 changes: 6 additions & 0 deletions downloads.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,10 @@ function option(string $value, string $desc, $attributes = []): string

$options = array_merge($defaults, $_GET);

$os['linux']['variants']['linux-frankenphp'] = 'FrankenPHP';
$os['osx']['variants']['osx-frankenphp'] = 'FrankenPHP';
$os['windows']['variants']['windows-frankenphp'] = 'FrankenPHP';

if ($auto_osvariant && (!array_key_exists('osvariant', $options) || !array_key_exists($options['osvariant'], $os[$options['os']]['variants']))) {
$options['osvariant'] = $auto_osvariant;
} elseif (!array_key_exists('osvariant', $options) || !array_key_exists($options['osvariant'], $os[$options['os']]['variants'])) {
Expand Down Expand Up @@ -169,6 +173,7 @@ function option(string $value, string $desc, $attributes = []): string
</select>
</div>

<?php if (!str_ends_with($options['osvariant'] ?? '', '-frankenphp')): ?>
<label for="multiversion" class="instructions-label">
I want to be able to use multiple PHP versions:
<input type="checkbox" id="multiversion" name="multiversion" value="Y"
Expand All @@ -180,6 +185,7 @@ function option(string $value, string $desc, $attributes = []): string
<input type="checkbox" id="source" name="source" value="Y"
<?= array_key_exists('source', $options) && $options['source'] === 'Y' ? 'checked' : '' ?>/>
</label>
<?php endif; ?>

<button type="submit" class="button">Update Instructions</button>
</form>
Expand Down
56 changes: 56 additions & 0 deletions include/download-instructions/frankenphp.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<?php if ($options['os'] === 'linux'): ?>
<p>
On the command line, run the following commands:
</p>
<pre><code class="language-bash line-numbers">
# Download and install FrankenPHP.
curl https://frankenphp.dev/install.sh | sh

# Serve the current directory.
frankenphp php-server
</code></pre>
<blockquote class="note"><p>
<strong class="note">Note</strong>:
The install script uses your distribution's packages (deb or RPM) when
available, and those receive updates through the system package manager.
If a standalone binary is installed instead, FrankenPHP does not update
automatically: its dependencies (such as OpenSSL) are statically compiled
into the binary, so you are responsible for updating FrankenPHP yourself,
including when security fixes are released for those dependencies. To
update the standalone binary, re-run the install script.
</p></blockquote>
<?php elseif ($options['os'] === 'osx'): ?>
<p>
On the command line, run the following commands:
</p>
<pre><code class="language-bash line-numbers">
# Install FrankenPHP using Homebrew.
brew install dunglas/frankenphp/frankenphp

# Serve the current directory.
frankenphp php-server
</code></pre>
<?php elseif ($options['os'] === 'windows'): ?>
<p>
In PowerShell, run the following commands:
</p>
<pre><code class="language-powershell line-numbers">
# Download and install FrankenPHP.
irm https://frankenphp.dev/install.ps1 | iex

# Serve the current directory.
frankenphp php-server
</code></pre>
<blockquote class="note"><p>
<strong class="note">Note</strong>:
The standalone binary installed by this script does not update
automatically: its dependencies (such as OpenSSL) are statically compiled
into the binary, so you are responsible for updating FrankenPHP yourself,
including when security fixes are released for those dependencies. To
update, re-run the install script in PowerShell.
</p></blockquote>
<?php endif; ?>

<p>
For more information, see the <a href="https://frankenphp.dev/docs/">FrankenPHP documentation</a>.
</p>