Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 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
2 changes: 1 addition & 1 deletion .github/workflows/windows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ jobs:
- name: Build FrankenPHP
run: |
$customVersion = "FrankenPHP $env:FRANKENPHP_VERSION PHP $env:PHP_VERSION Caddy"
go build -ldflags="-extldflags=-fuse-ld=lld -X 'github.com/caddyserver/caddy/v2.CustomVersion=$customVersion' -X 'github.com/caddyserver/caddy/v2/modules/caddyhttp.ServerHeader=FrankenPHP Caddy'"
go build -ldflags="-extldflags=-fuse-ld=lld -X 'github.com/caddyserver/caddy/v2.CustomVersion=$customVersion' -X 'github.com/caddyserver/caddy/v2.CustomBinaryName=frankenphp' -X 'github.com/caddyserver/caddy/v2/modules/caddyhttp.ServerHeader=FrankenPHP Caddy'"
working-directory: frankenphp\caddy\frankenphp

- name: Create Directory
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/caddy/frankenphp/Build
/caddy/frankenphp/frankenphp
/caddy/frankenphp/frankenphp.exe
/dist
/github_conf
/internal/testserver/testserver
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ ENV CGO_LDFLAGS="-L/usr/local/lib -lssl -lcrypto -lreadline -largon2 -lcurl -lon

WORKDIR /go/src/app/caddy/frankenphp
RUN GOBIN=/usr/local/bin \
../../go.sh install -ldflags "-w -s -X 'github.com/caddyserver/caddy/v2.CustomVersion=FrankenPHP $FRANKENPHP_VERSION PHP $PHP_VERSION Caddy' -X 'github.com/caddyserver/caddy/v2/modules/caddyhttp.ServerHeader=FrankenPHP Caddy'" -buildvcs=true && \
../../go.sh install -ldflags "-w -s -X 'github.com/caddyserver/caddy/v2.CustomVersion=FrankenPHP $FRANKENPHP_VERSION PHP $PHP_VERSION Caddy' -X 'github.com/caddyserver/caddy/v2.CustomBinaryName=frankenphp' -X 'github.com/caddyserver/caddy/v2/modules/caddyhttp.ServerHeader=FrankenPHP Caddy'" -buildvcs=true && \
setcap cap_net_bind_service=+ep /usr/local/bin/frankenphp && \
cp Caddyfile /etc/frankenphp/Caddyfile && \
frankenphp version && \
Expand Down
2 changes: 1 addition & 1 deletion alpine.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ ENV CGO_LDFLAGS="-lssl -lcrypto -lreadline -largon2 -lcurl -lonig -lz $PHP_LDFLA

WORKDIR /go/src/app/caddy/frankenphp
RUN GOBIN=/usr/local/bin \
../../go.sh install -ldflags "-w -s -extldflags '-Wl,-z,stack-size=0x80000' -X 'github.com/caddyserver/caddy/v2.CustomVersion=FrankenPHP $FRANKENPHP_VERSION PHP $PHP_VERSION Caddy' -X 'github.com/caddyserver/caddy/v2/modules/caddyhttp.ServerHeader=FrankenPHP Caddy'" -buildvcs=true && \
../../go.sh install -ldflags "-w -s -extldflags '-Wl,-z,stack-size=0x80000' -X 'github.com/caddyserver/caddy/v2.CustomVersion=FrankenPHP $FRANKENPHP_VERSION PHP $PHP_VERSION Caddy' -X 'github.com/caddyserver/caddy/v2.CustomBinaryName=frankenphp' -X 'github.com/caddyserver/caddy/v2/modules/caddyhttp.ServerHeader=FrankenPHP Caddy'" -buildvcs=true && \
setcap cap_net_bind_service=+ep /usr/local/bin/frankenphp && \
([ -z "${NO_COMPRESS}" ] && upx --best /usr/local/bin/frankenphp || true) && \
frankenphp version && \
Expand Down
72 changes: 72 additions & 0 deletions docs/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -348,3 +348,75 @@ docker run -v $PWD:/app/public \
-p 80:80 -p 443:443 -p 443:443/udp \
dunglas/frankenphp
```

## Shell Completion

FrankenPHP provides built-in shell completion support for Bash, Zsh, Fish, and PowerShell. This enables autocompletion for all commands (including custom commands like `php-server`, `php-cli`, and `extension-init`) and their flags.

### Bash

To load completions in your current shell session:

```console
source <(frankenphp completion bash)
```

To load completions for every new session, run:

**Linux:**

```console
frankenphp completion bash > /etc/bash_completion.d/frankenphp
Comment thread
alexandre-daubois marked this conversation as resolved.
Outdated
```

**macOS:**

```console
frankenphp completion bash > $(brew --prefix)/etc/bash_completion.d/frankenphp
Comment thread
alexandre-daubois marked this conversation as resolved.
Outdated
```

### Zsh

If shell completion is not already enabled in your environment, you will need to enable it. You can execute the following once:

```console
echo "autoload -U compinit; compinit" >> ~/.zshrc
```

To load completions for each session, execute once:

```console
frankenphp completion zsh > "${fpath[1]}/_frankenphp"
```

You will need to start a new shell for this setup to take effect.

### Fish

To load completions in your current shell session:

```console
frankenphp completion fish | source
```

To load completions for every new session, execute once:

```console
frankenphp completion fish > ~/.config/fish/completions/frankenphp.fish
```

### PowerShell

To load completions in your current shell session:

```powershell
frankenphp completion powershell | Out-String | Invoke-Expression
```

To load completions for every new session, execute once:

```powershell
frankenphp completion powershell >> $PROFILE
```

You will need to start a new shell for this setup to take effect.
72 changes: 72 additions & 0 deletions docs/fr/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -342,3 +342,75 @@ docker run -v $PWD:/app/public \
-p 80:80 -p 443:443 -p 443:443/udp \
dunglas/frankenphp
```

## Autocomplétion Shell

FrankenPHP fournit un support d'autocomplétion intégré pour Bash, Zsh, Fish et PowerShell. Cela permet l'autocomplétion de toutes les commandes (y compris les commandes personnalisées comme `php-server`, `php-cli` et `extension-init`) ainsi que leurs options.

### Bash

Pour charger l'autocomplétion dans votre session shell actuelle :

```console
source <(frankenphp completion bash)
```

Pour charger l'autocomplétion à chaque nouvelle session, exécutez :

**Linux :**

```console
frankenphp completion bash > /etc/bash_completion.d/frankenphp
Comment thread
alexandre-daubois marked this conversation as resolved.
Outdated
Comment thread
alexandre-daubois marked this conversation as resolved.
Outdated
```

**macOS :**

```console
frankenphp completion bash > $(brew --prefix)/etc/bash_completion.d/frankenphp
Comment thread
alexandre-daubois marked this conversation as resolved.
Outdated
```

### Zsh

Si l'autocomplétion shell n'est pas déjà activée dans votre environnement, vous devrez l'activer. Vous pouvez exécuter la commande suivante une fois :

```console
echo "autoload -U compinit; compinit" >> ~/.zshrc
```

Pour charger l'autocomplétion à chaque session, exécutez une fois :

```console
frankenphp completion zsh > "${fpath[1]}/_frankenphp"
```

Vous devrez démarrer un nouveau shell pour que cette configuration prenne effet.

### Fish

Pour charger l'autocomplétion dans votre session shell actuelle :

```console
frankenphp completion fish | source
```

Pour charger l'autocomplétion à chaque nouvelle session, exécutez une fois :

```console
frankenphp completion fish > ~/.config/fish/completions/frankenphp.fish
```

### PowerShell

Pour charger l'autocomplétion dans votre session shell actuelle :

```powershell
frankenphp completion powershell | Out-String | Invoke-Expression
```

Pour charger l'autocomplétion à chaque nouvelle session, voici la commande à exécuter :

```powershell
frankenphp completion powershell >> $PROFILE
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think it would be a better idea to create a file next to $PROFILE and tell $PROFILE to load it.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Used Claude to help me on this one, I don't have a Windows computer. If someone has one, I'd be happy to know if the command is correct 👍

```

Vous devrez ensuite démarrer un nouveau shell pour que cette configuration prenne effet.
Loading