This page displays the README.md
file of the GitHub repository (This text comes from config/services.php
).
MicroSymfony is a Symfony 7.2 application skeleton on steroids, ready to use.
I have made a long blog post explaining the philosophy behind and how to use it:
If you want to use the last Symfony 6.4 LTS version in your composer.json
file, replace all occurrences of 7.1
with 6.4
and run composer up
.
Because a live demo is always better than all explanations:
You must have the Symfony binary and composer installed locally.
To create a new project from the GitHub template, run:
composer create-project strangebuzz/microsymfony && cd microsymfony
Then start the PHP server with make:
make start
Or with Castor:
castor start
Open https://127.0.0.1:8000 (considering your 8000 port is free) and enjoy! 🙂
We can also use FrankenPHP to run MicroSymfony. You must have Docker installed locally.
Create a new project from the GitHub template, run:
docker run --rm -it -v $PWD:/app composer:latest create-project strangebuzz/microsymfony && cd microsymfony
Install the FrankenPHP Symfony runtime:
docker run --rm -it -v $PWD:/app composer:latest require runtime/frankenphp-symfony
Then run:
docker run \
-e FRANKENPHP_CONFIG="worker ./public/index.php" \
-e APP_RUNTIME=Runtime\\FrankenPhpSymfony\\Runtime \
-v $PWD:/app \
-p 80:80 -p 443:443 \
-d \
dunglas/frankenphp
Open https://localhost and enjoy! 🙂
PS: On Windows, replace $PWD
with "%cd%"
.
You can also directly use the FrankenPHP branch.
PS: A fork of BareCSS was created to fix some issues as the project is not maintained anymore.
MicroSymfony ships these features, ready to use:
Feature branches
are not merged in the main branch but are used to test the integration of a new
vendor library or make a POC.
For example, have you ever dreamed of testing Eloquent,
the Laravel ORM, on a Symfony project?
Then clone the eloquent
branch, and run composer install && make load-fixtures
.
These « database » branches aim to display a list of records from a SQLite database.
One will rebase those branches regularly so they are always up to date.
Turbo forms are disabled in assets/app.js.
To enable the feature for a given form, add the data-turbo="true"
attribute to it.
Or change the parameter Turbo.setFormMode
to on
to activate the feature globally.
In both cases, your controller code has to be modified accordingly.
If you install a new Symfony library, the flex recipes can add YAML files to your
project.
These YAML files are loaded, but you can convert them to PHP like the other configuration
files.
For example, to convert the messenger
YAML configuration to PHP with Simplify,
run:
vendor/bin/config-transformer convert config/packages/messenger.yaml
Please see CONTRIBUTING and CODE_OF_CONDUCT for details.
Please see SECURITY for details.
The MIT License (MIT). Please see License File for more information.