Skip to content
Zen00 edited this page Jan 23, 2014 · 9 revisions

Disclaimers

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

Address any complaints, suggestions, fixes, vitriol, or thanks to xisi @ freenode / #mpos

Development Cycle

MPOS development cycles are simple:

  • Create an issue report
  • Create a new branch based on this issue
  • Work on a branch solving the issue
  • Create a pull request to merge the changes into next

Whenever an issue is worked on, it must be referenced. All pull requests are reviewed for changes and locally tested before acceptance.

Adding a static page

There are 2 components needed 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 functionality is added or changed, the related class files must be edited in:

  • public/include/classes

Adding a config option (file)

Add at least one of the following, possibly two:

  • Config option - The config option in your global.inc.php and in global.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

Version incrementing

When an update is ready to be pulled, these must be updated before doing so:

  • DB Version

  • DB Version - If a database was updated, update DB_VERSION in public/include/version.inc.php

  • 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' in 000_base_structure.sql

    • Check the 000_base_structure.sql to see how this works
  • DB Update SQL - DB_VERSION = '0.X.Y' in 0XY_whatever_update.sql

    • Check an existing 0XY_whatever_update.sql to see how this works
  • Config Version

    • Config Version - if the config was updated, update CONFIG_VERSION in public/include/version.inc.php
Clone this wiki locally