dokuwiki/doku.php
andi 8746e7272c session_write_close added #364
I just learned that PHP does lock it's session objects. This is realy
bad if you have multiple images in a page as each one will call fetch.php
which locks the session, so everything can only be loaded sequentially.
The fix for this is to close the session after using it which is after doing
the auth and the breadcrumbs. I added the needed calls everywhere.

darcs-hash:20050608213514-9977f-f2dfc467ebbd06406e10e33a386fa1db6cb32dba.gz
2005-06-08 23:35:14 +02:00

69 lines
1.7 KiB
PHP

<?php
/**
* DokuWiki mainscript
*
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
* @author Andreas Gohr <andi@splitbrain.org>
*/
// xdebug_start_profiling();
if(!defined('DOKU_INC')) define('DOKU_INC',realpath(dirname(__FILE__)).'/');
require_once(DOKU_INC.'inc/init.php');
require_once(DOKU_INC.'inc/common.php');
require_once(DOKU_INC.'inc/pageutils.php');
require_once(DOKU_INC.'inc/html.php');
require_once(DOKU_INC.'inc/auth.php');
require_once(DOKU_INC.'inc/actions.php');
//import variables
$QUERY = trim($_REQUEST['id']);
$ID = getID();
$REV = $_REQUEST['rev'];
$ACT = $_REQUEST['do'];
$IDX = $_REQUEST['idx'];
$DATE = $_REQUEST['date'];
$RANGE = $_REQUEST['lines'];
$HIGH = $_REQUEST['s'];
if(empty($HIGH)) $HIGH = getGoogleQuery();
$TEXT = cleanText($_POST['wikitext']);
$PRE = cleanText($_POST['prefix']);
$SUF = cleanText($_POST['suffix']);
$SUM = $_REQUEST['summary'];
//sanitize revision
$REV = preg_replace('/[^0-9]/','',$REV);
//we accept the do param as HTTP header, too:
if(!empty($_SERVER['HTTP_X_DOKUWIKI_DO'])){
$ACT = trim(strtolower($_SERVER['HTTP_X_DOKUWIKI_DO']));
}
if(!empty($IDX)) $ACT='index';
//set default #FIXME not needed here? done in actions?
if(empty($ACT)) $ACT = 'show';
if($ACT == 'debug'){
html_debug();
exit;
}
//make infos about the selected page available
$INFO = pageinfo();
//prepare breadcrumbs (initialize a static var)
breadcrumbs();
//close session
session_write_close();
//do the work
act_dispatch($ACT);
//restore old umask
umask($conf['oldumask']);
// xdebug_dump_function_profile(1);
?>