Index: trunk/phase3/includes/Article.php |
— | — | @@ -3674,19 +3674,6 @@ |
3675 | 3675 | * @param $cache Boolean |
3676 | 3676 | */ |
3677 | 3677 | public function outputWikiText( $text, $cache = true ) { |
3678 | | - global $wgOut; |
3679 | | - |
3680 | | - $parserOutput = $this->outputFromWikitext( $text, $cache ); |
3681 | | - |
3682 | | - $wgOut->addParserOutput( $parserOutput ); |
3683 | | - } |
3684 | | - |
3685 | | - /** |
3686 | | - * This does all the heavy lifting for outputWikitext, except it returns the parser |
3687 | | - * output instead of sending it straight to $wgOut. Makes things nice and simple for, |
3688 | | - * say, embedding thread pages within a discussion system (LiquidThreads) |
3689 | | - */ |
3690 | | - public function outputFromWikitext( $text, $cache = true ) { |
3691 | 3678 | global $wgParser, $wgOut, $wgEnableParserCache, $wgUseFileCache; |
3692 | 3679 | |
3693 | 3680 | $popts = $wgOut->parserOptions(); |
— | — | @@ -3749,8 +3736,8 @@ |
3750 | 3737 | $u->doUpdate(); |
3751 | 3738 | } |
3752 | 3739 | } |
3753 | | - |
3754 | | - return $parserOutput; |
| 3740 | + |
| 3741 | + $wgOut->addParserOutput( $parserOutput ); |
3755 | 3742 | } |
3756 | 3743 | |
3757 | 3744 | /** |
— | — | @@ -3809,51 +3796,4 @@ |
3810 | 3797 | ); |
3811 | 3798 | } |
3812 | 3799 | } |
3813 | | - |
3814 | | - function tryParserCache( $parserOptions ) { |
3815 | | - $parserCache = ParserCache::singleton(); |
3816 | | - $parserOutput = $parserCache->get( $article, $parserOptions ); |
3817 | | - if ( $parserOutput !== false ) { |
3818 | | - return $parserOutput; |
3819 | | - } else { |
3820 | | - return false; |
3821 | | - } |
3822 | | - } |
3823 | | - |
3824 | | - function getParserOutput( $oldid = null ) { |
3825 | | - global $wgEnableParserCache, $wgUser, $wgOut; |
3826 | | - |
3827 | | - // Should the parser cache be used? |
3828 | | - $pcache = $wgEnableParserCache && |
3829 | | - intval( $wgUser->getOption( 'stubthreshold' ) ) == 0 && |
3830 | | - $this->exists() && |
3831 | | - $oldid === null; |
3832 | | - |
3833 | | - wfDebug( __METHOD__.': using parser cache: ' . ( $pcache ? 'yes' : 'no' ) . "\n" ); |
3834 | | - if ( $wgUser->getOption( 'stubthreshold' ) ) { |
3835 | | - wfIncrStats( 'pcache_miss_stub' ); |
3836 | | - } |
3837 | | - |
3838 | | - $parserOutput = false; |
3839 | | - if ( $pcache ) { |
3840 | | - $parserOutput = $this->tryParserCache( $wgOut->parserOptions() ); |
3841 | | - } |
3842 | | - |
3843 | | - if ( $parserOutput === false ) { |
3844 | | - // Cache miss; parse and output it. |
3845 | | - $rev = Revision::newFromTitle( $post->getTitle(), $oldid ); |
3846 | | - |
3847 | | - if ( $rev && $oldid ) { |
3848 | | - // don't save oldids in the parser cache. |
3849 | | - } |
3850 | | - else if ( $rev ) { |
3851 | | - $post->outputWikiText( $rev->getText(), true ); |
3852 | | - return true; |
3853 | | - } else { |
3854 | | - return false; |
3855 | | - } |
3856 | | - } else { |
3857 | | - return true; |
3858 | | - } |
3859 | | - } |
3860 | 3800 | } |