]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - index.php
Merge branch '0.9.x'
[quix0rs-gnu-social.git] / index.php
index 6079d1f2c414db1593babff1ed935edcbba913ed..7f2afffb5a01b0cac1a36953f450152150ab20ea 100644 (file)
--- a/index.php
+++ b/index.php
  * @license  GNU Affero General Public License http://www.gnu.org/licenses/
  */
 
+$_startTime = microtime(true);
+$_perfCounters = array();
+
 define('INSTALLDIR', dirname(__FILE__));
 define('STATUSNET', true);
 define('LACONICA', true); // compatibility
 
 require_once INSTALLDIR . '/lib/common.php';
 
+register_shutdown_function('common_log_perf_counters');
+
 $user = null;
 $action = null;
 
@@ -189,7 +194,7 @@ function checkMirror($action_obj, $args)
 
 function isLoginAction($action)
 {
-    static $loginActions =  array('login', 'recoverpassword', 'api', 'doc', 'register', 'publicxrds', 'otp', 'opensearch', 'rsd');
+    static $loginActions =  array('login', 'recoverpassword', 'api', 'doc', 'register', 'publicxrds', 'otp', 'opensearch', 'rsd', 'hostmeta');
 
     $login = null;
 
@@ -204,7 +209,7 @@ function main()
 {
     // fake HTTP redirects using lighttpd's 404 redirects
     if (strpos($_SERVER['SERVER_SOFTWARE'], 'lighttpd') !== false) {
-        $_lighty_url = $base_url.$_SERVER['REQUEST_URI'];
+        $_lighty_url = $_SERVER['REQUEST_URI'];
         $_lighty_url = @parse_url($_lighty_url);
 
         if ($_lighty_url['path'] != '/index.php' && $_lighty_url['path'] != '/') {
@@ -272,11 +277,7 @@ function main()
         return;
     }
 
-    // Note the order here: arguments from the URL mapper will
-    // override request params that have been sent. This ensures
-    // that for instance an action parameter can't be overridden
-    // with an arbitrary action class.
-    $args = array_merge($_REQUEST, $args);
+    $args = array_merge($args, $_REQUEST);
 
     Event::handle('ArgsInitialize', array(&$args));