Skip to main content

Sensing some hostility in the friendica source code... when you request a URL, instead of checking for each kind of URL, and running a different function depending on if it's /follow, /login, etc, they...
  • create a "Dice" object, defined here as a "Dependency Injection Container" in a very unhinged way.
  • Then they add the rules in dependencies.config.php, which is a declaritive (spits) table of rules for what module has what implementation
  • App\Router (if you knew what to look for) then has code to load routes from... somewhere.
  • The documentation says "Actual routes are defined in App->collectRoutes."
  • That is the only place the word collectRoutes is written, anywhere in the source code or its dependencies.
  • Then it calls runFrontend on that router, which tells the Page to run (i.e. create a page).
  • The page loads a template, which generates code to generate a template that applies a template to itself.
  • It runs the code.
  • Your page appears!
There’s static/routes.config.php which you’d think is the table of URL kind to function, except that currently I’m looking at the URL “/follow” and there is no route for that. Friendica just sort of... magically knows what to do, and there’s no way to tell how.

This is why they call it abstraction hell, and whoever programmed this should feel bad for doing it.