diff --git a/extension.json b/extension.json index 3426b69..e5c0218 100644 --- a/extension.json +++ b/extension.json @@ -13,25 +13,25 @@ "callback": "MathHooks::registerExtension", "type": "parserhook", "AutoloadClasses": { - "MathMathSymbolsDataModule": "MathMathSymbolsDataModule.php", - "MathChemSymbolsDataModule": "MathChemSymbolsDataModule.php", - "MathHooks": "MathHooks.php", - "MathRenderer": "MathRenderer.php", - "MathRestbaseInterface": "MathRestbaseInterface.php", + "MathMathSymbolsDataModule": "src/MathMathSymbolsDataModule.php", + "MathChemSymbolsDataModule": "src/MathChemSymbolsDataModule.php", + "MathHooks": "src/MathHooks.php", + "MathRenderer": "src/MathRenderer.php", + "MathRestbaseInterface": "src/MathRestbaseInterface.php", "MathTexvc": "MathTexvc.php", - "MathSource": "MathSource.php", - "MathMathML": "MathMathML.php", - "MathMathMLCli": "MathMathMLCli.php", + "MathSource": "src/MathSource.php", + "MathMathML": "src/MathMathML.php", + "MathMathMLCli": "src/MathMathMLCli.php", "MathLaTeXML": "MathLaTeXML.php", - "MathInputCheck": "MathInputCheck.php", + "MathInputCheck": "src/MathInputCheck.php", "MathInputCheckTexvc": "MathInputCheckTexvc.php", - "MathInputCheckRestbase": "MathInputCheckRestbase.php", - "SpecialMathShowImage": "SpecialMathShowImage.php", - "SpecialMathStatus": "SpecialMathStatus.php", - "MathValidator": "MathValidator.php", - "MathFormatter": "MathFormatter.php", - "MathWikidataHook": "MathWikidataHook.php", - "MathMLRdfBuilder": "MathMLRdfBuilder.php" + "MathInputCheckRestbase": "src/MathInputCheckRestbase.php", + "SpecialMathShowImage": "src/SpecialMathShowImage.php", + "SpecialMathStatus": "src/SpecialMathStatus.php", + "MathValidator": "src/MathValidator.php", + "MathFormatter": "src/MathFormatter.php", + "MathWikidataHook": "src/MathWikidataHook.php", + "MathMLRdfBuilder": "src/MathMLRdfBuilder.php" }, "DefaultUserOptions": { "math": "mathml" diff --git a/MathChemSymbolsDataModule.php b/src/MathChemSymbolsDataModule.php similarity index 88% rename from MathChemSymbolsDataModule.php rename to src/MathChemSymbolsDataModule.php index 1b686ea..cc07666 100644 --- a/MathChemSymbolsDataModule.php +++ b/src/MathChemSymbolsDataModule.php @@ -13,8 +13,8 @@ class MathChemSymbolsDataModule extends ResourceLoaderModule { public function getScript( ResourceLoaderContext $context ) { return 've.ui.MWChemDialog.static.setSymbols(' . - file_get_contents( __DIR__ . '/modules/ve-math/chemSymbols.json' ) . - ');'; + file_get_contents( __DIR__ . '/../modules/ve-math/chemSymbols.json' ) . + ');'; } public function getDependencies( ResourceLoaderContext $context = null ) { diff --git a/MathFormatter.php b/src/MathFormatter.php similarity index 100% rename from MathFormatter.php rename to src/MathFormatter.php diff --git a/MathHooks.php b/src/MathHooks.php similarity index 97% rename from MathHooks.php rename to src/MathHooks.php index 46c80ea..c8e41fa 100644 --- a/MathHooks.php +++ b/src/MathHooks.php @@ -328,14 +328,14 @@ class MathHooks { if ( !in_array( $type, $map ) ) { throw new Exception( "Math extension does not currently support $type database." ); } - $sql = __DIR__ . '/db/math.' . $type . '.sql'; + $sql = __DIR__ . '/../db/math.' . $type . '.sql'; $updater->addExtensionTable( 'math', $sql ); if ( in_array( 'latexml', MathRenderer::getValidModes() ) ) { if ( in_array( $type, [ 'mysql', 'sqlite', 'postgres' ] ) ) { - $sql = __DIR__ . '/db/mathlatexml.' . $type . '.sql'; + $sql = __DIR__ . '/../db/mathlatexml.' . $type . '.sql'; $updater->addExtensionTable( 'mathlatexml', $sql ); if ( $type == 'mysql' ) { - $sql = __DIR__ . '/db/patches/mathlatexml.mathml-length-adjustment.mysql.sql'; + $sql = __DIR__ . '/../db/patches/mathlatexml.mathml-length-adjustment.mysql.sql'; $updater->modifyExtensionField( 'mathlatexml', 'math_mathml', $sql ); } } else { @@ -344,10 +344,10 @@ class MathHooks { } if ( in_array( 'mathml', MathRenderer::getValidModes() ) ) { if ( in_array( $type, [ 'mysql', 'sqlite', 'postgres' ] ) ) { - $sql = __DIR__ . '/db/mathoid.' . $type . '.sql'; + $sql = __DIR__ . '/../db/mathoid.' . $type . '.sql'; $updater->addExtensionTable( 'mathoid', $sql ); if ( $type == 'mysql' ) { - $sql = __DIR__ . '/db/patches/mathoid.add_png.mysql.sql'; + $sql = __DIR__ . '/../db/patches/mathoid.add_png.mysql.sql'; $updater->addExtensionField( 'mathoid', 'math_png', $sql ); } } else { diff --git a/MathInputCheck.php b/src/MathInputCheck.php similarity index 100% rename from MathInputCheck.php rename to src/MathInputCheck.php diff --git a/MathInputCheckRestbase.php b/src/MathInputCheckRestbase.php similarity index 100% rename from MathInputCheckRestbase.php rename to src/MathInputCheckRestbase.php diff --git a/MathMLRdfBuilder.php b/src/MathMLRdfBuilder.php similarity index 100% rename from MathMLRdfBuilder.php rename to src/MathMLRdfBuilder.php diff --git a/MathMathML.php b/src/MathMathML.php similarity index 100% rename from MathMathML.php rename to src/MathMathML.php diff --git a/MathMathMLCli.php b/src/MathMathMLCli.php similarity index 100% rename from MathMathMLCli.php rename to src/MathMathMLCli.php diff --git a/MathMathSymbolsDataModule.php b/src/MathMathSymbolsDataModule.php similarity index 88% rename from MathMathSymbolsDataModule.php rename to src/MathMathSymbolsDataModule.php index f755b19..dd89c3b 100644 --- a/MathMathSymbolsDataModule.php +++ b/src/MathMathSymbolsDataModule.php @@ -13,8 +13,8 @@ class MathMathSymbolsDataModule extends ResourceLoaderModule { public function getScript( ResourceLoaderContext $context ) { return 've.ui.MWMathDialog.static.setSymbols(' . - file_get_contents( __DIR__ . '/modules/ve-math/mathSymbols.json' ) . - ');'; + file_get_contents( __DIR__ . '/../modules/ve-math/mathSymbols.json' ) . + ');'; } public function getDependencies( ResourceLoaderContext $context = null ) { diff --git a/MathRenderer.php b/src/MathRenderer.php similarity index 100% rename from MathRenderer.php rename to src/MathRenderer.php diff --git a/MathRestbaseInterface.php b/src/MathRestbaseInterface.php similarity index 100% rename from MathRestbaseInterface.php rename to src/MathRestbaseInterface.php diff --git a/MathSource.php b/src/MathSource.php similarity index 100% rename from MathSource.php rename to src/MathSource.php diff --git a/MathValidator.php b/src/MathValidator.php similarity index 100% rename from MathValidator.php rename to src/MathValidator.php diff --git a/MathWikidataHook.php b/src/MathWikidataHook.php similarity index 100% rename from MathWikidataHook.php rename to src/MathWikidataHook.php diff --git a/SpecialMathShowImage.php b/src/SpecialMathShowImage.php similarity index 100% rename from SpecialMathShowImage.php rename to src/SpecialMathShowImage.php diff --git a/SpecialMathStatus.php b/src/SpecialMathStatus.php similarity index 97% rename from SpecialMathStatus.php rename to src/SpecialMathStatus.php index eaf53b1..89e248d 100644 --- a/SpecialMathStatus.php +++ b/src/SpecialMathStatus.php @@ -75,8 +75,8 @@ class SpecialMathStatus extends SpecialPage { * i.e. if the span element is generated right. */ public function testMathMLIntegration() { - $svgRef = file_get_contents( __DIR__ .'/images/reference.svg' ); - $svgRefNoSpeech = file_get_contents( __DIR__ .'/images/reference-nospeech.svg' ); + $svgRef = file_get_contents( __DIR__ . '/../images/reference.svg' ); + $svgRefNoSpeech = file_get_contents( __DIR__ . '/../images/reference-nospeech.svg' ); $renderer = MathRenderer::getRenderer( "a+b", [], 'mathml' ); $this->assertTrue( $renderer->render( true ), "Rendering of a+b in plain MathML mode" ); $real = str_replace( "\n", '', $renderer->getHtmlOutput() );