Ejemplo n.º 1
0
 static function shutdown()
 {
     if (self::$log_queries) {
         uasort(self::$log_queries, function ($a, $b) {
             return $a[1] - $b[1];
         });
         $msg = true;
         foreach (self::$log_queries as $where => $what) {
             if (self::$log_queries_limit > $what[1]) {
                 break;
             }
             if ($msg) {
                 error_log("Query log for " . Navigation::self());
                 $msg = false;
             }
             error_log("  {$where}: #{$what['1']}: {$what['0']}");
         }
     }
     self::$log_queries = false;
 }
Ejemplo n.º 2
0
        if (@(include "{$ConfSitePATH}/conf/options.php") !== false || @(include "{$ConfSitePATH}/conf/options.inc") !== false || @(include "{$ConfSitePATH}/Code/options.inc") !== false) {
            $Opt["loaded"] = true;
        }
    }
    if (get($Opt, "multiconference")) {
        Multiconference::init();
    }
    if (get($Opt, "include")) {
        read_included_options($Opt["include"]);
    }
}
if (!get($Opt, "loaded") || get($Opt, "missing")) {
    Multiconference::fail_bad_options();
}
if (get($Opt, "dbLogQueries")) {
    Dbl::log_queries($Opt["dbLogQueries"]);
}
// Allow lots of memory
function set_memory_limit()
{
    global $Opt;
    if (!get($Opt, "memoryLimit")) {
        $suf = array("" => 1, "k" => 1 << 10, "m" => 1 << 20, "g" => 1 << 30);
        if (preg_match(',\\A(\\d+)\\s*([kmg]?)\\z,', strtolower(ini_get("memory_limit")), $m) && $m[1] * $suf[$m[2]] < 128 << 20) {
            $Opt["memoryLimit"] = "128M";
        }
    }
    if (get($Opt, "memoryLimit")) {
        ini_set("memory_limit", $Opt["memoryLimit"]);
    }
}