From 998ec797404f546fde553aa1589c5133bf4bc6ff Mon Sep 17 00:00:00 2001 From: Marcin Kurczewski <mkurczew@gmail.com> Date: Wed, 9 Oct 2013 19:23:39 +0200 Subject: [PATCH] Internals --- src/core.php | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 src/core.php diff --git a/src/core.php b/src/core.php new file mode 100644 index 00000000..51fc6eda --- /dev/null +++ b/src/core.php @@ -0,0 +1,25 @@ +<?php +require_once 'lib/redbean/RedBean/redbean.inc.php'; +require_once 'lib/chibi-core/Facade.php'; + +date_default_timezone_set('UTC'); +setlocale(LC_CTYPE, 'en_US.UTF-8'); +define('DS', DIRECTORY_SEPARATOR); + +function configFactory() +{ + $config = new \Chibi\Config(); + $configPaths = + [ + __DIR__ . DS . '../config.ini', + __DIR__ . DS . '../local.ini' + ]; + $configPaths = array_filter($configPaths, 'file_exists'); + + foreach ($configPaths as $path) + { + $config->loadIni($path); + } + + return $config; +}