]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - index.php
Apply upstream fix to MSN library for darkip
[quix0rs-gnu-social.git] / index.php
index 8617780be7593ec8b6a9687a6395eaa7fed696d8..3534739bface4334914d14a07dbb700363d3f974 100644 (file)
--- a/index.php
+++ b/index.php
@@ -107,20 +107,18 @@ function handleError($error)
 
             $msg = sprintf(
                 // TRANS: Database error message.
-                _(
-                    'The database for %1$s is not responding correctly, '.
-                    'so the site will not work properly. '.
-                    'The site admins probably know about the problem, '.
-                    'but you can contact them at %2$s to make sure. '.
-                    'Otherwise, wait a few minutes and try again.'
+                _('The database for %1$s is not responding correctly, '.
+                  'so the site will not work properly. '.
+                  'The site admins probably know about the problem, '.
+                  'but you can contact them at %2$s to make sure. '.
+                  'Otherwise, wait a few minutes and try again.'
                 ),
                 common_config('site', 'name'),
                 common_config('site', 'email')
             );
         } else {
             // TRANS: Error message.
-            $msg = _(
-                'An important error occured, probably related to email setup. '.
+            $msg = _('An important error occured, probably related to email setup. '.
                 'Check logfiles for more info.'
             );
         }
@@ -177,15 +175,24 @@ function setupRW()
 
     static $alwaysRW = array('session', 'remember_me');
 
-    // We ensure that these tables always are used
-    // on the master DB
+    $rwdb = $config['db']['database'];
 
-    $config['db']['database_rw'] = $config['db']['database'];
-    $config['db']['ini_rw'] = INSTALLDIR.'/classes/statusnet.ini';
+    if (Event::handle('StartReadWriteTables', array(&$alwaysRW, &$rwdb))) {
 
-    foreach ($alwaysRW as $table) {
-        $config['db']['table_'.$table] = 'rw';
+        // We ensure that these tables always are used
+        // on the master DB
+
+        $config['db']['database_rw'] = $rwdb;
+        $config['db']['ini_rw'] = INSTALLDIR.'/classes/statusnet.ini';
+
+        foreach ($alwaysRW as $table) {
+            $config['db']['table_'.$table] = 'rw';
+        }
+
+        Event::handle('EndReadWriteTables', array($alwaysRW, $rwdb));
     }
+
+    return;
 }
 
 function checkMirror($action_obj, $args)
@@ -254,9 +261,8 @@ function main()
     if (!_have_config()) {
         $msg = sprintf(
             // TRANS: Error message displayed when there is no StatusNet configuration file.
-            _(
-                "No configuration file found. Try running ".
-                "the installation program first."
+            _("No configuration file found. Try running ".
+              "the installation program first."
             )
         );
         $sac = new ServerErrorAction($msg);