Skip to content

Commit

Permalink
docs: add more docs (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
dunglas committed Oct 14, 2022
1 parent acc4883 commit b8177a0
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 7 deletions.
24 changes: 21 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,35 @@
# FrankenPHP: Modern App Server for PHP

<h1 align="center"><a href="https://frankenphp.dev"><img src="frankenphp.png" alt="FrankenPHP" width="600"></a></h1>

FrankenPHP is a modern application server for PHP built on top of the [Caddy](https://caddyserver.com/) web server.

FrankenPHP gives superpowers to your PHP apps thanks to its stunning features: [*Early Hints*](docs/early-hints.md), [worker mode](docs/worker.md), [real-time capabilities](docs/mercure.rocks), automatic HTTPS, HTTP/2 and HTTP/3 support...

FrankenPHP works with any PHP app and makes your Symfony projects faster than ever thanks to provided integration with the worker mode (Laravel Octane support coming).

FrankenPHP can also be used as a standalone Go library to embed PHP in any app using `net/http`.

[**Learn more** on *frankenphp.dev*](https://frankenphp.dev)

## Getting Started

☢️ FrankenPHP is very experimental, don't use it in production yet, [fill bugs](https://github.com/dunglas/frankenphp/issues) and write patches! ☢️

```
docker run -v $PWD:/app/public \
-p 80:80 -p 443:443 \
dunglas/frankenphp
```

Your app is served at https://localhost!
Go to `https://localhost`, and enjoy!

## Docs

* [worker mode](docs/worker.md)
* [The worker mode](docs/worker.md)
* [Early Hints support (103 HTTP status code)](docs/early-hints.md)
* [compile from sources](docs/compile.md)
* [Real-time](docs/mercure.md)
* [Configuration](docs/config.md)
* [Demo app (Symfony) and benchmarks](https://github.com/dunglas/frankenphp-demo)
* [Compile from sources](docs/compile.md)
* [Go library documentation](https://pkg.go.dev/github.com/dunglas/frankenphp)
3 changes: 1 addition & 2 deletions docs/compile.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@

To use FrankenPHP, you currently need to compile a fork of PHP.
Patches have been contributed upstream, and some have already
been merged. It will be possible to use the vanilla version of PHP
starting with version 8.3.
been merged. It will be possible to use the vanilla PHP interpreter starting with version 8.3.

First, get our PHP fork and prepare it:

Expand Down
9 changes: 9 additions & 0 deletions docs/config.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Configuration

FrankenPHP, Caddy as well the Mercure and Vulcain modules can be configured using [the formats supported by Caddy](https://caddyserver.com/docs/getting-started#your-first-config).

In the Docker image, the `Caddyfile` is located at `/etc/Caddyfile`.

You can also configure PHP using `php.ini` as usual.

In the Docker image, the `php.ini` file is located at `/usr/local/lib/php.ini`.
4 changes: 2 additions & 2 deletions docs/early-hints.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Early Hints

FrankenPHP natively supports the [103 Early Hints status code]().
FrankenPHP natively supports the [103 Early Hints status code](https://developer.chrome.com/blog/early-hints/).
Using Early Hints can improve the load of your web pages by 30%.

```php
Expand All @@ -18,4 +18,4 @@ echo <<<'HTML'
HTML;
```

Early Hints are supported by the normal and the [worker](worker.md) mode.
Early Hints are supported by the normal and the [worker](worker.md) mode.
12 changes: 12 additions & 0 deletions docs/mercure.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Real-time

FrankenPHP comes with a built-in Mercure hub!
Mercure allows to push event in real-time to all the connected devices: they will receive instantly a JavaScript event.

No JS library or SDK required!

![Mercure](https://mercure.rocks/static/main.png)

To enable the Mercure hub, update the `Caddyfile` as described [on Mercure's website](https://mercure.rocks/docs/hub/config).

To push Mercure updates from your code, we recommend the [Symfony Mercure Component](https://symfony.com/components/Mercure) (you don't need the Symfony full stack framework to use it).
3 changes: 3 additions & 0 deletions docs/worker.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Using FrankenPHP Workers

Boot your application once and keep it in memory.
FrankenPHP will handle incoming requests in a few milliseconds.

## Custom Apps

```php
Expand Down
Binary file added frankenphp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit b8177a0

Please sign in to comment.