getVal( 'maxlag' ); if ( !is_null( $maxLag ) ) { if ( !$mediaWiki->checkMaxLag( $maxLag ) ) { exit; } } //if ($wgRequest->getVal( 'printable' ) == 'yes') { // $wgOut->setPrintable(); //} //if ($wgRequest->getVal( 'pdf' ) == 'yes') { // define("FPDF_FONTPATH", "extensions/html2fpdf/font/"); // define("RELATIVE_PATH", "extensions/html2fpdf/"); // require_once('extensions/html2fpdf/html2fpdf.php'); // // activate Output-Buffer: // ob_start(); //} # Query string fields $action = $wgRequest->getVal( 'action', 'view' ); $title = $wgRequest->getVal( 'title' ); $wgTitle = $mediaWiki->checkInitialQueries( $title,$action,$wgOut, $wgRequest, $wgContLang ); if ($wgTitle == NULL) { unset( $wgTitle ); } # # Send Ajax requests to the Ajax dispatcher. # if ( $wgUseAjax && $action == 'ajax' ) { require_once( $IP . '/includes/AjaxDispatcher.php' ); $dispatcher = new AjaxDispatcher(); $dispatcher->performAction(); $mediaWiki->restInPeace( $wgLoadBalancer ); exit; } wfProfileOut( 'main-misc-setup' ); # Setting global variables in mediaWiki $mediaWiki->setVal( 'Server', $wgServer ); $mediaWiki->setVal( 'DisableInternalSearch', $wgDisableInternalSearch ); $mediaWiki->setVal( 'action', $action ); $mediaWiki->setVal( 'SquidMaxage', $wgSquidMaxage ); $mediaWiki->setVal( 'EnableDublinCoreRdf', $wgEnableDublinCoreRdf ); $mediaWiki->setVal( 'EnableCreativeCommonsRdf', $wgEnableCreativeCommonsRdf ); $mediaWiki->setVal( 'CommandLineMode', $wgCommandLineMode ); $mediaWiki->setVal( 'UseExternalEditor', $wgUseExternalEditor ); $mediaWiki->setVal( 'DisabledActions', $wgDisabledActions ); $wgArticle = $mediaWiki->initialize ( $wgTitle, $wgOut, $wgUser, $wgRequest ); $mediaWiki->finalCleanup ( $wgDeferredUpdateList, $wgLoadBalancer, $wgOut ); # Not sure when $wgPostCommitUpdateList gets set, so I keep this separate from finalCleanup $mediaWiki->doUpdates( $wgPostCommitUpdateList ); $mediaWiki->restInPeace( $wgLoadBalancer ); //if ($wgRequest->getVal( 'pdf' ) == 'yes') { // // activate Output-Buffer: // // Output-Buffer in variable: // $html=ob_get_contents(); // //these 4 lines where added for utf-8 compatibility: // global $wgOutputEncoding; // if (strcasecmp($wgOutputEncoding, 'utf-8')==0) { // $html=utf8_decode($html); // } // // delete Output-Buffer // ob_end_clean(); // // $pdf = new HTML2FPDF(); // $pdf->DisplayPreferences('HideWindowUI'); // $pdf->AddPage(); // $pdf->WriteHTML($html); // $pdf->Close(); // // ini_set("session.cache_limiter", "none"); // // header("Content-Type: application/pdf"); // header('Cache-Control: public'); // header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); // header('Pragma: public'); // header("Expires: 0"); //// header("Content-Type: application/force-download"); //// if(isset($HTTP_SERVER_VARS['HTTP_USER_AGENT']) and strpos($HTTP_SERVER_VARS['HTTP_USER_AGENT'],'MSIE')) //// Header('Content-Type: application/force-download'); //// else //// Header('Content-Type: application/octet-stream'); //// if(headers_sent()) //// $this->Error('Some data has already been output to browser, can\'t send PDF file'); //// header('Content-Length: '.strlen($pdf->buffer)); //// header('Content-Disposition: attachment; filename=doc.pdf'); // header('Content-Disposition: attachment; filename=doc.pdf'); // echo $pdf->buffer; // //// echo $pdf->buffer; ////var_dump($pdf);exit; ////// var_dump($pdf->buffer); //// $pdf->Output('doc.pdf','D'); //}