server/php/basic/resources/config.php.tmpl
author rougeronj
Wed, 16 Sep 2015 17:36:46 +0200
changeset 524 904effa4b6d7
parent 444 19f0b7803aed
permissions -rw-r--r--
improve view management: - we can pass a negative view index, in this case we count from the end of the list of view - before creating/changing the view representation, we remove the previous one and reinitialize the node visibility - each time we save a view, it creates a new one at the end of the list - "restore" view loads the last view of the list

<?php

$config = [
    "db" => [
        "dsn" => "sqlite:".realpath(dirname(__FILE__))."/../data/renkan.sqlite",
        "user" => "dbUser",
        "password" => "pa$$"
    ],
];

/*
   I will usually place the following in a bootstrap file or some type of environment
   setup file (code that is run at the start of every page request), but they work
   just as well in your config file if it's in php (some alternatives to php are xml or ini files).
*/

/*
   Creating constants for heavily used paths makes things a lot easier.
   ex. require_once(LIBRARY_PATH . "Paginator.php")
*/
defined("LIBRARY_PATH")
    or define("LIBRARY_PATH", realpath(dirname(__FILE__) . '/library/'));

defined("TEMPLATES_PATH")
    or define("TEMPLATES_PATH", realpath(dirname(__FILE__) . '/templates/'));

defined("RENKAN_PROJECT_TABLE")
    or define("RENKAN_PROJECT_TABLE", "renkan_project");

/*
   Error reporting.
*/
ini_set("error_reporting", "true");
error_reporting(E_ALL|E_STRCT);