Skip to content
This repository was archived by the owner on Jan 2, 2025. It is now read-only.

Development Tips & Tricks

Andrew edited this page Jul 31, 2021 · 4 revisions

So, Symfony can itself be complex sometimes, and M&F adds a whole layer of complexity on top of it, so this page is for all the little things you think it might be handy to pass along. Feel free to add to it as you see fit. There are no things "too simple" or "too specific" for this page. If you forgot it once and spent time looking it up (again?), add it here. Add categories as you see fit.

Prototyping

  • This should go without saying, but if you know the game already does something similar, go see how it works and copy it. Not only does it cut down on time, it also means the code is more standardized. Don't let that stop you from trying to optimize though.
  • Do not prototype off the menu for sieges. That entire system, while functional now, and, in Andrew's opinion, neat, is a troubleshooting mess. It basically condenses what would otherwise be 6 or 7 controller routes into a single one, while still using the same security systems as those several routes and then some embedded into that single route. Just don't.

Wikilinks (or that code that creates object links in textboxes)

  • If you add new entities, you should update these with the appropriate lines so the game knows that it can link them, and how to link them properly. How it handles publications is a good example for non-traditional entity ID/Name relations.

Symfony Itself

  • Forms: If you're using the query builder to grab a list, make sure to include a use statement for "Doctrine\ORM\EntityRepository"
  • Don't add deprecations. If you're adding code, make it as future-proof as you can. We understand that this means parts of the code look different in different areas, with forms being a good example of this, but if Symfony is telling you it's deprecated, figure out the correct way to do it. It'll save us all time later.

Web Servers

  • Update the game only to have a wall of text in a red box saying you're missing a database column that should no longer be referenced? Delete the symfony cache, rebuild the symfony cache, reassign rights for the web user to said cache, restart Apache2. The first 2 reset Symfony2's awareness of it's code, the last step makes sure Apache2 has the right code in memory.
  • That didn't fix it: re-upload a bare bone entity file for whatever had the value you removed, rebuild the entity files for the game, and then do the steps above.
  • Still not working: restart the server.
  • That still didn't work: Contact Andrew.
  • Update the game only to have a white page after submitting login credentials with no errors otherwise? Restart the server to clear the doctrine cache.

Major Server Upgrades

  • Follow the instructions of your OS for OS upgrades.
  • For DB upgrades, especially for postgres, do not use pg_restore. The game's existing pg_dump functions just fine, but for rebuilding use psql -d [db] -va -f [file].sql. Due to how postgis works, you'll probably have to drop the database and restore from a backup. Just accept it.

Clone this wiki locally