2016-08-18 21:02:49 -04:00
|
|
|
<?php
|
|
|
|
|
|
|
|
require __DIR__.'/../vendor/autoload.php';
|
|
|
|
|
2017-01-02 18:34:11 -05:00
|
|
|
$dbUrlParser = new PicoDb\UrlParser();
|
|
|
|
|
|
|
|
if ($dbUrlParser->isEnvironmentVariableDefined()) {
|
|
|
|
$dbSettings = $dbUrlParser->getSettings();
|
|
|
|
|
|
|
|
define('DB_DRIVER', $dbSettings['driver']);
|
|
|
|
define('DB_USERNAME', $dbSettings['username']);
|
|
|
|
define('DB_PASSWORD', $dbSettings['password']);
|
|
|
|
define('DB_HOSTNAME', $dbSettings['hostname']);
|
|
|
|
define('DB_PORT', $dbSettings['port']);
|
|
|
|
define('DB_NAME', $dbSettings['database']);
|
|
|
|
}
|
|
|
|
|
2016-08-18 21:02:49 -04:00
|
|
|
if (file_exists(__DIR__.'/../config.php')) {
|
|
|
|
require __DIR__.'/../config.php';
|
|
|
|
}
|
|
|
|
|
2016-12-26 09:44:53 -05:00
|
|
|
require_once __DIR__.'/constants.php';
|
|
|
|
require_once __DIR__.'/check_setup.php';
|
|
|
|
require_once __DIR__.'/functions.php';
|
2016-08-18 21:02:49 -04:00
|
|
|
|
2016-12-26 15:07:18 -05:00
|
|
|
PicoDb\Database::setInstance('db', function () {
|
|
|
|
try {
|
|
|
|
return Miniflux\Database\get_connection();
|
|
|
|
} catch (Exception $e) {
|
|
|
|
die($e->getMessage());
|
2016-08-18 21:02:49 -04:00
|
|
|
}
|
|
|
|
});
|