mj-zana / skeleton-web
A starting point for a Zana website: pages in two languages, templates, security headers, and release archives for shared hosting
Requires
- php: ^8.5
- mj-zana/cache: ^2.3
- mj-zana/console: ^2.3
- mj-zana/core: ^2.3
- mj-zana/http: ^2.3
- mj-zana/routing: ^2.3
- mj-zana/security: ^2.3
- mj-zana/translation: ^2.3
- mj-zana/view: ^2.3
Requires (Dev)
- mj-zana/testing: ^2.3
- phpunit/phpunit: ^11.5
Suggests
- ext-zip: Needed by release:build to write the upload archives
Provides
None
Conflicts
None
Replaces
None
README
A starting point for a website on Zana: pages in English and French, templates, page metadata, versioned assets, security headers, translated error pages, and upload archives for shared hosting.
composer create-project mj-zana/skeleton-web my-site
cd my-site
composer serve
Open http://localhost:8000. composer create-project writes .env with a fresh secret.
What is where
| Path | |
|---|---|
src/Bootstrap.php |
The framework's providers |
config/ |
Settings; APP_A__B in the environment or .env overrides a.b |
modules/Site/ |
The pages: routes in SiteModule, PageController, templates and translations |
templates/ |
The layout and the error pages |
translations/ |
Texts shared by every module |
public/ |
The document root: index.php, assets, 503.html |
tests/ |
Browser tests: composer test |
Add pages with the maker (composer require --dev mj-zana/maker):
php bin/console make:page Site Services
Going live
- On the server, set
APP_ENV=production,APP_APP__URLandAPP_SECURITY__SECRET, in the environment or in.env. - Make
var/writable. - Check the server:
php bin/console doctor.
The document root is public/. When the hosting fixes the document root to the project folder,
the root .htaccess sends every request into public/, so .env, config/ and vendor/ cannot be
reached.
Shared hosting without SSH (cPanel and the like, where public_html is fixed and Composer cannot
run):
php bin/console release:build
It writes two archives from the last commit, with the production dependencies installed:
build/website.zip: unpack it besidepublic_html, so the project is in~/website;build/public_html.zip: unpack it intopublic_html. Itsindex.phpfinds the project in../website(--folderpicks another name).
Create ~/website/.env on the server, and delete ~/website/var/cache after each upload so the
container is compiled again.
The deployment guide covers all of it.
License
MIT