-
Notifications
You must be signed in to change notification settings - Fork 1k
Developer Guide
Address any complaints, suggestions, fixes or vitriol to xisi @ freenode / #mpos or thanks :)
Last updated: Jan 18th, 2014
This guide is not intended to be documentation; this is a simple overview developers can reference for common tasks and learning the layout of MPOS.
This is written towards developers with a solid understanding of basic php/html/sql and a little smarty/css/js for good measure. If that does not describe you, proceed with caution.
This guide covers
- Development Cycle
- Adding a static page
- Adding a config option (file)
- Version incrementing
MPOS development cycles are simple:
- Create an issue report
- Create a new branch based on this issue
- Work on your branch solving the issue
- Create a pull request to merge your changes into next
Whenever you decide to work on something, make sure to reference the issue! We are reviewing all pull requests for changes and try to test them locally before accepting them.
There are 2 components you'll need to add for a new static page:
-
Template - A smarty template for the page
-
public/templates/mpos/type/[type]/default.tpl -
Page - A php controller for the page
-
public/include/pages/[type]/page.inc.php
If you need to add or change any functionality, you'll need to edit the related class files in:
public/include/classes
You'll have to add at least 1 thing, possibly 2:
-
Config option - The config option in your
global.inc.phpand inglobal.inc.dist.php -
public/include/config/global.inc.php -
public/include/config/global.inc.dist.php -
Smarty Globals - If you need to access the config option in a template, you need to add it to the smarty globals
-
public/include/smarty_globals.inc.php
If your update is ready to be pulled, there's a few things you need to check first:
-
If you inserted any new rows into the default tables or modified/added tables, you must update SQL version
-
If you added any config options into the dist config, you must update config version
-
DB Version
-
DB Version - If you updated the db, update
DB_VERSIONinpublic/include/version.inc.php -
Update SQL - Create
0XY_whatever_update.sqland update/insert any changes needed to fix existing installs -
DB Insert SQL -
DB_VERSION = '0.X.Y'in000_base_structure.sql- Check the
000_base_structure.sqlto see how this works
- Check the
-
DB Update SQL -
DB_VERSION = '0.X.Y'in your0XY_whatever_update.sql- Check an existing
0XY_whatever_update.sqlto see how this works
- Check an existing
-
Config Version
-
Config Version - if you updated the config, update
CONFIG_VERSIONinpublic/include/version.inc.php
-
Config Version - if you updated the config, update
-
- installation of Redis requires TCL 8.5 or newer TCL Download Page