Example #1
0
[tasks]
lifespan = 1

[database]
dsn = sqlite:tasks.sq3
username = 
password =
SETTINGS;
/*
	Main app below here.. don't go changing anything!
*/
require "Database.php";
require "Taskboard.php";
require "anonregkit.php";
$config = parse_ini_string($config_str, true);
Database::openDatabase('rw', $config['database']['dsn'], $config['database']['username'], $config['database']['password']);
// Decide what we're trying to do
$uri = isset($_GET['q']) ? $_GET['q'] : '/';
$uri_parts = explode('/', trim($uri, '/'));
// Since pretty muche very part of the site relies on the board, create it now
$board = new Taskboard();
$board->task_lifespan = $config['tasks']['lifespan'];
// Do stuff based on on the URI sent
// FORMAT: index.php?q=/['CASE NAME']
switch ($uri_parts[0]) {
    case 'init':
        // Insert test data if requested..
        // activate by typing ?q=/init
        $board->initDatabase();
        $board->createTask('23r34r', 'My first', 'This could be my second.. but blahh', array('first', 'misc'));
        $board->createTask('23r34r', 'Poster needed', 'I kinda need a poster making, gotta be x y z', array('graphics', 'first'));