Physikerwelt has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/105474


Change subject: Fix merge problems
......................................................................

Fix merge problems

manual correction of merge problems

Change-Id: Id68e70a17159fbf3336c985860d6b080bb22e982
---
M Math.hooks.php
M MathLaTeXML.php
M MathRenderer.php
M MathTexvc.php
M tests/MathLaTeXMLTest.php
5 files changed, 29 insertions(+), 28 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Math 
refs/changes/74/105474/1

diff --git a/Math.hooks.php b/Math.hooks.php
index 221663d..2fc4c34 100644
--- a/Math.hooks.php
+++ b/Math.hooks.php
@@ -211,17 +211,6 @@
                return true;
        }
 
-       /**
-        * Links to the unit test files for the test cases.
-        *
-        * @param string $files
-        * @return boolean (true)
-        */
-       static function onRegisterUnitTests( &$files ) {
-               $testDir = __DIR__ . '/tests/';
-               $files = array_merge( $files, glob( "$testDir/*Test.php" ) );
-               return true;
-       }
 
        /**
         * Hack to fake a default $wgMathPath value so parser test output
diff --git a/MathLaTeXML.php b/MathLaTeXML.php
index 843ed41..2e8d0af 100644
--- a/MathLaTeXML.php
+++ b/MathLaTeXML.php
@@ -62,6 +62,27 @@
                $this->LaTeXMLSettings = $settings;
        }
 
+       /**
+        * Gets the allowed root elements the rendered math tag might have.
+        *
+        * @return array
+        */
+       public function getAllowedRootElements() {
+               if ( $this->allowedRootElements ) {
+                       return $this->allowedRootElements;
+               } else {
+                       return self::$DEFAULT_ALLOWED_ROOT_ELEMENTS;
+               }
+       }
+
+       /**
+        * Sets the allowed root elements the rendered math tag might have.
+        * An empty value indicates to use the default settings.
+        * @param array $settings
+        */
+       public function setAllowedRootElments( $settings ) {
+               $this->allowedRootElements = $settings;
+       }
 
        /**
         * Performs a HTTP Post request to the given host.
@@ -162,7 +183,6 @@
                }
                $res = '';
                $host = self::pickHost();
-               $this->setLaTeXMLSettings( $wgMathDefaultLaTeXMLSetting );
                $post = $this->getPostData();
                $this->lastError = '';
                $requestResult = $this->makeRequest( $host, $post, $res, 
$this->lastError );
diff --git a/MathRenderer.php b/MathRenderer.php
index 856aa4e..c0d7b89 100644
--- a/MathRenderer.php
+++ b/MathRenderer.php
@@ -551,11 +551,11 @@
         */
        public function setDisplayStyle( $displayStyle = true ){
                $this->changed = true; //Discuss if this is a change
-               $this->displaytyle = $displayStyle;
+               $this->displayStyle = $displayStyle;
        }
 
        public function getDisplayStyle(){
-               return $this->displaytyle;
+               return $this->displayStyle;
        }
 
        /**
diff --git a/MathTexvc.php b/MathTexvc.php
index 33db1f8..e1d500e 100644
--- a/MathTexvc.php
+++ b/MathTexvc.php
@@ -285,7 +285,6 @@
                        return $this->getError( 'math_output_error' );
                }
                // Store the file at the final storage path...
-<<<<<<< HEAD
                // Bug 56769: buffer the writes and do them at the end.
                if ( !isset( $wgHooks['ParserAfterParse']['FlushMathBackend'] ) 
) {
                        $backend->mathBufferedWrites = array();
@@ -295,17 +294,6 @@
                                $backend->doQuickOperations( 
$backend->mathBufferedWrites );
                                unset( $backend->mathBufferedWrites );
                        };
-=======
-               if ( @(!$backend->quickStore( array(
-                       'src' => "$tmpDir/{$this->getHash()}.png", 'dst' => 
"$hashpath/{$this->getHash()}.png"
-               ) )->isOK())
-               ) {
-                       wfProfileOut( __METHOD__ );
-                       if ( $wgMathDebug ){
-                               wfDebugLog('Math','problem storing image' . 
$php_errormsg );
-                       }
-                       return $this->getError( 'math_output_error' );
->>>>>>> Math 2.0
                }
                $backend->mathBufferedWrites[] = array(
                        'op'  => 'store',
diff --git a/tests/MathLaTeXMLTest.php b/tests/MathLaTeXMLTest.php
index 634322e..47ab456 100644
--- a/tests/MathLaTeXMLTest.php
+++ b/tests/MathLaTeXMLTest.php
@@ -25,7 +25,11 @@
                self::$html = $html;
                self::$timeout = $timeout;
        }
-
+       protected function setUp() {
+               global $wgMathValidModes;
+               $wgMathValidModes[]=MW_MATH_LATEXML;
+               parent::setUp();
+       }
        /**
         * Test rendering the string '0' see
         * https://trac.mathweb.org/LaTeXML/ticket/1752
@@ -33,6 +37,7 @@
        public function testSpecialCase0() {
                global $wgMathFastDisplay;
                $wgMathFastDisplay = false;
+               //FIXME:
                $this->markTestSkipped( "Bug in LaTeXML" );
                $renderer = MathRenderer::getRenderer( '0', array( ), 
MW_MATH_LATEXML );
                $expected = '0</cn>';
@@ -174,7 +179,6 @@
        public function testIntegration() {
                global $wgMathLaTeXMLTimeout;
                global $wgMathFastDisplay;
-                $this->markTestSkipped( 'currently no live LaTeXML server 
availible' );
                $wgMathFastDisplay = false;
                $wgMathLaTeXMLTimeout = 20;
                $renderer = MathRenderer::getRenderer( "a+b", array( ), 
MW_MATH_LATEXML );

-- 
To view, visit https://gerrit.wikimedia.org/r/105474
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id68e70a17159fbf3336c985860d6b080bb22e982
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Math
Gerrit-Branch: dev
Gerrit-Owner: Physikerwelt <w...@physikerwelt.de>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to