]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/common.php
PostgreSQL - some more fixes to make queries compatible with both databases. (submitt...
[quix0rs-gnu-social.git] / lib / common.php
index 4fc749ca06540095b258e9ab4871a7e842855e00..917fdeafa47f9d4dd646fea2d9265695f6307980 100644 (file)
@@ -73,6 +73,7 @@ $config =
               'theme' => 'default',
               'path' => $_path,
               'logfile' => null,
+              'logdebug' => false,
               'fancy' => false,
               'locale_path' => INSTALLDIR.'/locale',
               'language' => 'en_US',
@@ -84,7 +85,8 @@ $config =
               'broughtbyurl' => null,
               'closed' => false,
               'inviteonly' => false,
-              'private' => false),
+              'private' => false,
+              'dupelimit' => 60), # default for same person saying the same thing
         'syslog' =>
         array('appname' => 'laconica', # for syslog
               'priority' => 'debug'), # XXX: currently ignored
@@ -143,6 +145,8 @@ $config =
         array('enabled' => false,
               'server' => 'localhost',
               'port' => 11211),
+               'ping' =>
+        array('notify' => array()),
         'inboxes' =>
         array('enabled' => true), # on by default for new sites
         );
@@ -178,12 +182,31 @@ if (strlen($_path) > 0) {
 
 $_config_files[] = INSTALLDIR.'/config.php';
 
+$_have_a_config = false;
+
 foreach ($_config_files as $_config_file) {
     if (file_exists($_config_file)) {
         include_once($_config_file);
+        $_have_a_config = true;
     }
 }
 
+function _have_config()
+{
+    global $_have_a_config;
+    return $_have_a_config;
+}
+
+// XXX: Throw a conniption if database not installed
+
+// Fixup for laconica.ini
+
+$_db_name = substr($config['db']['database'], strrpos($config['db']['database'], '/') + 1);
+
+if ($_db_name != 'laconica' && !array_key_exists('ini_'.$_db_name, $config['db'])) {
+    $config['db']['ini_'.$_db_name] = INSTALLDIR.'/classes/laconica.ini';
+}
+
 // XXX: how many of these could be auto-loaded on use?
 
 require_once('Validate.php');