<?php
/**
 * Boot code for TeamBuddy
 */

// General error handling
function exception_error_handler($errno, $errstr, $errfile, $errline ) {
    throw new ErrorException($errstr, 0, $errno, $errfile, $errline);
}
set_error_handler("exception_error_handler");

// Include Francis FW
$dependencies = './../../../../dependencies';
require $dependencies . '/Francis/config/boot_francis.php';

// Construct paths
Francis_Utils_Config::set( 'path.root', realpath( dirname( __FILE__ ) . '/../../..' ) );

// Set autoloader
Francis_Core_Autoloader::attachLocator( new Francis_Core_Locator( 'TB', Francis_Utils_Config::get( 'path.root' ) . '/src' ) );

// Global shortcut function
// @todo Replace later
function _lc( $txt, array $params = NULL ) {
    return vsprintf( $txt, $params );
}