-
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 16th, 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
- Adding a static page
- Adding a config option (file)
- Version incrementing
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.php
and 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:
-
Update SQL - Create
0XY_whatever_update.sql
and 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.sql
to see how this works -
DB Update SQL -
DB_VERSION = '0.X.Y'
anddb_upgrade_required = 0
in your0XY_whatever_update.sql
-
Check an existing
0XY_whatever_update.sql
to see how this works -
DB Version - If you updated the db, update
DB_VERSION
inpublic/include/version.inc.php
-
Config Version - if you updated the config, update
CONFIG_VERSION
inpublic/include/version.inc.php
-
- installation of Redis requires TCL 8.5 or newer TCL Download Page