require_once INSTALLDIR . '/lib/framework.php';
try {
- GNUsocial::init(@$server, @$path, @$conffile);
+ GNUsocial::init();
} catch (NoConfigException $e) {
// XXX: Throw a conniption if database not installed
// XXX: Find a way to use htmlwriter for this instead of handcoded markup
{
global $_server, $_path, $config;
+ $config_files = [];
// From most general to most specific:
// server-wide, then vhost-wide, then for a path,
// finally for a dir (usually only need one of the last two).
if (isset($conffile)) {
$config_files = array($conffile);
} else {
- $config_files = array('/etc/gnusocial/config.php',
- '/etc/gnusocial/config.d/'.$_server.'.php');
+ if (realpath('/etc/gnusocial') !== false) {
+ $config_files[] = '/etc/gnusocial/config.php';
+ $config_files[] = '/etc/gnusocial/config.d/' . $_server . '.php';
- if (strlen($_path) > 0) {
- $config_files[] = '/etc/gnusocial/config.d/'.$_server.'_'.$_path.'.php';
+ if (strlen($_path) > 0) {
+ $config_files[] = '/etc/gnusocial/config.d/'.$_server.'_'.$_path.'.php';
+ }
}
$config_files[] = INSTALLDIR.'/config.php';