Ejemplo n.º 1
0
require INC_DIR . 'ControllerDispatcher.php';
Config::load(defined('CONFIG_FILE_PATH') ? CONFIG_FILE_PATH : CONFIG_DIR . 'cfg.php');
$baseUrl = Config::get('baseurl');
if (!$baseUrl) {
    throw new \Exception('Invalid configuration. Missing "baseurl" definition.');
}
// $basePath = Config::get('basepath');
// if ( !$basePath )
//   throw new \Exception('Invalid configuration. Missing "basepath" definition.');
Localizer::load(LOCALES_DIR);
Router::init($baseUrl, '');
/* Setup propel
---------------------------------------------*/
set_include_path(get_include_path() . PATH_SEPARATOR . ENTITIES_CLASSES_DIR . LIB_DIR . PATH_SEPARATOR . BASE_DIR . PATH_SEPARATOR);
require_once LIB_DIR . '/propel/runtime/lib/Propel.php';
try {
    \Propel::init(ENTITIES_DIR . 'build' . DIRECTORY_SEPARATOR . 'conf' . DIRECTORY_SEPARATOR . PROJECT_NAME . '-conf.php');
    \Propel::getDB()->setCharset(\Propel::getConnection(), 'UTF8');
    \Transaction::initAmounts(Config::get('amounts', TYPE_ARRAY), Config::get('member_fee', TYPE_FLOAT), Config::get('base_currency'));
} catch (\Exception $e) {
    // Do NOT output stacktrace because it holds the plain pg password.
    echo $e->getMessage();
    error_log($e->__toString());
    exit;
}
define('BOOTSTRAP_DONE', true);
define('DEVELOPER_MODE', Config::get('devmode', TYPE_BOOL, false));
define('EXTEND_MARKTING_SYSTEM', Config::get('extended.marketing.member', TYPE_BOOL, false));
\Member::loadStrategy(EXTEND_MARKTING_SYSTEM);
MailHelper::$MAILS_DISABLED = Config::get('disable_email_distribution', TYPE_BOOL, false);
require VENDOR_DIR . 'autoload.php';