http://www.mediawiki.org/wiki/Special:Code/MediaWiki/70128

Revision: 70128
Author:   reedy
Date:     2010-07-29 07:20:02 +0000 (Thu, 29 Jul 2010)

Log Message:
-----------
Replace self with PPFrame to define proper location of some constants

Modified Paths:
--------------
    trunk/phase3/includes/parser/Preprocessor_DOM.php
    trunk/phase3/includes/parser/Preprocessor_Hash.php

Modified: trunk/phase3/includes/parser/Preprocessor_DOM.php
===================================================================
--- trunk/phase3/includes/parser/Preprocessor_DOM.php   2010-07-29 04:18:10 UTC 
(rev 70127)
+++ trunk/phase3/includes/parser/Preprocessor_DOM.php   2010-07-29 07:20:02 UTC 
(rev 70128)
@@ -975,7 +975,7 @@
                                        $titles = $xpath->query( 'title', 
$contextNode );
                                        $title = $titles->item( 0 );
                                        $parts = $xpath->query( 'part', 
$contextNode );
-                                       if ( $flags & self::NO_TEMPLATES ) {
+                                       if ( $flags & PPFrame::NO_TEMPLATES ) {
                                                $newIterator = 
$this->virtualBracketedImplode( '{{', '|', '}}', $title, $parts );
                                        } else {
                                                $lineStart = 
$contextNode->getAttribute( 'lineStart' );
@@ -996,7 +996,7 @@
                                        $titles = $xpath->query( 'title', 
$contextNode );
                                        $title = $titles->item( 0 );
                                        $parts = $xpath->query( 'part', 
$contextNode );
-                                       if ( $flags & self::NO_ARGS ) {
+                                       if ( $flags & PPFrame::NO_ARGS ) {
                                                $newIterator = 
$this->virtualBracketedImplode( '{{{', '|', '}}}', $title, $parts );
                                        } else {
                                                $params = array(
@@ -1014,13 +1014,13 @@
                                        # Remove it in HTML, pre+remove and 
STRIP_COMMENTS modes
                                        if ( $this->parser->ot['html']
                                                || ( $this->parser->ot['pre'] 
&& $this->parser->mOptions->getRemoveComments() )
-                                               || ( $flags & 
self::STRIP_COMMENTS ) )
+                                               || ( $flags & 
PPFrame::STRIP_COMMENTS ) )
                                        {
                                                $out .= '';
                                        }
                                        # Add a strip marker in PST mode so 
that pstPass2() can run some old-fashioned regexes on the result
                                        # Not in RECOVER_COMMENTS mode 
(extractSections) though
-                                       elseif ( $this->parser->ot['wiki'] && ! 
( $flags & self::RECOVER_COMMENTS ) ) {
+                                       elseif ( $this->parser->ot['wiki'] && ! 
( $flags & PPFrame::RECOVER_COMMENTS ) ) {
                                                $out .= 
$this->parser->insertStripItem( $contextNode->textContent );
                                        }
                                        # Recover the literal comment in 
RECOVER_COMMENTS and pre+no-remove
@@ -1032,7 +1032,7 @@
                                        # OT_WIKI will only respect <ignore> in 
substed templates.
                                        # The other output types respect it 
unless NO_IGNORE is set.
                                        # extractSections() sets NO_IGNORE and 
so never respects it.
-                                       if ( ( !isset( $this->parent ) && 
$this->parser->ot['wiki'] ) || ( $flags & self::NO_IGNORE ) ) {
+                                       if ( ( !isset( $this->parent ) && 
$this->parser->ot['wiki'] ) || ( $flags & PPFrame::NO_IGNORE ) ) {
                                                $out .= 
$contextNode->textContent;
                                        } else {
                                                $out .= '';
@@ -1335,7 +1335,7 @@
                }
                if ( !isset( $this->numberedExpansionCache[$index] ) ) {
                        # No trimming for unnamed arguments
-                       $this->numberedExpansionCache[$index] = 
$this->parent->expand( $this->numberedArgs[$index], self::STRIP_COMMENTS );
+                       $this->numberedExpansionCache[$index] = 
$this->parent->expand( $this->numberedArgs[$index], PPFrame::STRIP_COMMENTS );
                }
                return $this->numberedExpansionCache[$index];
        }
@@ -1347,7 +1347,7 @@
                if ( !isset( $this->namedExpansionCache[$name] ) ) {
                        # Trim named arguments post-expand, for backwards 
compatibility
                        $this->namedExpansionCache[$name] = trim(
-                               $this->parent->expand( $this->namedArgs[$name], 
self::STRIP_COMMENTS ) );
+                               $this->parent->expand( $this->namedArgs[$name], 
PPFrame::STRIP_COMMENTS ) );
                }
                return $this->namedExpansionCache[$name];
        }

Modified: trunk/phase3/includes/parser/Preprocessor_Hash.php
===================================================================
--- trunk/phase3/includes/parser/Preprocessor_Hash.php  2010-07-29 04:18:10 UTC 
(rev 70127)
+++ trunk/phase3/includes/parser/Preprocessor_Hash.php  2010-07-29 07:20:02 UTC 
(rev 70128)
@@ -942,7 +942,7 @@
                                if ( $contextNode->name == 'template' ) {
                                        # Double-brace expansion
                                        $bits = $contextNode->splitTemplate();
-                                       if ( $flags & self::NO_TEMPLATES ) {
+                                       if ( $flags & PPFrame::NO_TEMPLATES ) {
                                                $newIterator = 
$this->virtualBracketedImplode( '{{', '|', '}}', $bits['title'], $bits['parts'] 
);
                                        } else {
                                                $ret = 
$this->parser->braceSubstitution( $bits, $this );
@@ -955,7 +955,7 @@
                                } elseif ( $contextNode->name == 'tplarg' ) {
                                        # Triple-brace expansion
                                        $bits = $contextNode->splitTemplate();
-                                       if ( $flags & self::NO_ARGS ) {
+                                       if ( $flags & PPFrame::NO_ARGS ) {
                                                $newIterator = 
$this->virtualBracketedImplode( '{{{', '|', '}}}', $bits['title'], 
$bits['parts'] );
                                        } else {
                                                $ret = 
$this->parser->argSubstitution( $bits, $this );
@@ -970,13 +970,13 @@
                                        # Remove it in HTML, pre+remove and 
STRIP_COMMENTS modes
                                        if ( $this->parser->ot['html']
                                                || ( $this->parser->ot['pre'] 
&& $this->parser->mOptions->getRemoveComments() )
-                                               || ( $flags & 
self::STRIP_COMMENTS ) )
+                                               || ( $flags & 
PPFrame::STRIP_COMMENTS ) )
                                        {
                                                $out .= '';
                                        }
                                        # Add a strip marker in PST mode so 
that pstPass2() can run some old-fashioned regexes on the result
                                        # Not in RECOVER_COMMENTS mode 
(extractSections) though
-                                       elseif ( $this->parser->ot['wiki'] && ! 
( $flags & self::RECOVER_COMMENTS ) ) {
+                                       elseif ( $this->parser->ot['wiki'] && ! 
( $flags & PPFrame::RECOVER_COMMENTS ) ) {
                                                $out .= 
$this->parser->insertStripItem( $contextNode->firstChild->value );
                                        }
                                        # Recover the literal comment in 
RECOVER_COMMENTS and pre+no-remove
@@ -988,7 +988,7 @@
                                        # OT_WIKI will only respect <ignore> in 
substed templates.
                                        # The other output types respect it 
unless NO_IGNORE is set.
                                        # extractSections() sets NO_IGNORE and 
so never respects it.
-                                       if ( ( !isset( $this->parent ) && 
$this->parser->ot['wiki'] ) || ( $flags & self::NO_IGNORE ) ) {
+                                       if ( ( !isset( $this->parent ) && 
$this->parser->ot['wiki'] ) || ( $flags & PPFrame::NO_IGNORE ) ) {
                                                $out .= 
$contextNode->firstChild->value;
                                        } else {
                                                //$out .= '';
@@ -1285,7 +1285,7 @@
                }
                if ( !isset( $this->numberedExpansionCache[$index] ) ) {
                        # No trimming for unnamed arguments
-                       $this->numberedExpansionCache[$index] = 
$this->parent->expand( $this->numberedArgs[$index], self::STRIP_COMMENTS );
+                       $this->numberedExpansionCache[$index] = 
$this->parent->expand( $this->numberedArgs[$index], PPFrame::STRIP_COMMENTS );
                }
                return $this->numberedExpansionCache[$index];
        }
@@ -1297,7 +1297,7 @@
                if ( !isset( $this->namedExpansionCache[$name] ) ) {
                        # Trim named arguments post-expand, for backwards 
compatibility
                        $this->namedExpansionCache[$name] = trim(
-                               $this->parent->expand( $this->namedArgs[$name], 
self::STRIP_COMMENTS ) );
+                               $this->parent->expand( $this->namedArgs[$name], 
PPFrame::STRIP_COMMENTS ) );
                }
                return $this->namedExpansionCache[$name];
        }



_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to