This page describes broadly how PHP is used in our project:
- Main entry point
- Service classes
- Automatic service injection
- Conventions / Coding Style
For more specific explanations of the types of classes we use, make sure to check PHP Structure!
Main entry point
The main entry point for the web is
That means that
/index.php gets called whenever a
https://foodsharing.de-request gets sent to the website.
Another entry point is
xhr.php, which is used for routes starting with
https://foodsharing.de/xhr.php. These are
used for our legacy API (see Xhr). The same applies for
These three entry points are now just standard Symfony entry points.
The relevant (custom) code has been moved to
src/Entrypoint, where three respective controllers do the actual work.
IndexController, a large part of the code has been moved to
The fourth entry point is
restApi.php, which will be used whenever a URL starting with
requested. This is the route to our modern API following REST principles (see REST-API).
It is also a standard Symfony entry point.