Skip to content

How it works: state the rule before the shortcut - #13

Merged
zelti merged 1 commit into
mainfrom
docs/how-it-works-order
Aug 24, 2026
Merged

zelti merged 1 commit into
mainfrom
docs/how-it-works-order

Conversation

@zelti

@zelti zelti commented Aug 24, 2026

Copy link
Copy Markdown
Owner

The first section anyone reads after the badges opened with the sites/ folder and a host name like v2--api.phpforge.dev — path segments reversed and joined with -- — before saying what the rule was.

Now:

Every folder under ~/php-devforge/ is a site. The host name is its path, read
from the inside out and joined with --:

    ~/php-devforge/projects/my-app/public/
                         ↓
    https://public--my-app--projects.phpforge.dev

Long first is deliberate: it is what the rule actually produces, and it is what makes the next part worth reading. A new subsection — Want a shorter URL? — then carries forge link and the sites/ tree.

The half that was not reported

The section showed my-app.phpforge.dev at the top and my-app--sites.phpforge.dev eight lines later, for the same project, with nothing saying why. It read as two different systems.

The version examples now use the short name throughout, and the section says plainly that both URLs reach the same folder — which is what resolve_docroot.lua:73-79 does: try sites/<path>, fall back to the full path.

https://my-app.phpforge.dev          # your default
https://my-app--p83.phpforge.dev     # this request on PHP 8.3

The first URL you open

welcome--sites.<domain> → welcome.<domain>, in both READMEs and install.sh. Sending someone to the long form before they have read the rule is the same mistake in miniature.

Checked, not assumed

Every URL the section prints was requested against a running stack — which is how the two-spellings problem should have been caught the first time:

public--my-app--projects  ->  my-app on PHP 8.4.24
my-app                    ->  my-app on PHP 8.4.24
my-app--sites             ->  my-app on PHP 8.4.24
my-app--p83               ->  my-app on PHP 8.3.33
v2--api                   ->  nested ok
welcome                   ->  PHP DevForge is running

CI keeps every long-form assertion — the claim that both spellings work is only true while both are tested — and gains welcome beside them.

Headings stay one-to-one across the two languages: 24 each, including the new subsection.

The first section after the badges opened with the sites/ folder and a
reversed host name, before saying what the rule was. It now opens with
the rule and the URL that rule produces, and a new subsection introduces
sites/ as what you reach for when that URL gets long.

It also showed my-app.phpforge.dev at the top and my-app--sites.phpforge
.dev eight lines later, for the same project, with nothing saying why.
The version examples now use the short name throughout, and the section
says both URLs reach the same folder.

The first URL a new user opens becomes welcome.<domain> instead of
welcome--sites.<domain>, in both READMEs and the installer: the long
form teaches the reversal before the reader needs it.

Every URL the section prints was checked against a running stack. CI
keeps asserting the long forms and now asserts the short welcome too.
@zelti
zelti merged commit 9cac1fd into main Aug 24, 2026
4 checks passed
@zelti
zelti deleted the docs/how-it-works-order branch August 24, 2026 02:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant