From 141455aa33aa115ed3fa1df1fd20030aa394f7f3 Mon Sep 17 00:00:00 2001 From: Kunal Mehta Date: Thu, 15 Feb 2018 14:21:52 -0800 Subject: [PATCH] Move classes into includes/ Change-Id: Ie26b5be1bb2551ed339fdb4a587a89823c609b2e --- .phpcs.xml | 3 --- extension.json | 12 ++++++------ GeSHi.php => includes/GeSHi.php | 0 ...sourceLoaderSyntaxHighlightVisualEditorModule.php | 2 +- SyntaxHighlight.php => includes/SyntaxHighlight.php | 6 +++--- .../SyntaxHighlightAce.php | 0 .../SyntaxHighlightGeSHiCompat.php | 0 7 files changed, 10 insertions(+), 13 deletions(-) rename GeSHi.php => includes/GeSHi.php (100%) rename ResourceLoaderSyntaxHighlightVisualEditorModule.php => includes/ResourceLoaderSyntaxHighlightVisualEditorModule.php (97%) rename SyntaxHighlight.php => includes/SyntaxHighlight.php (98%) rename SyntaxHighlightAce.php => includes/SyntaxHighlightAce.php (100%) rename SyntaxHighlightGeSHiCompat.php => includes/SyntaxHighlightGeSHiCompat.php (100%) diff --git a/.phpcs.xml b/.phpcs.xml index 370d4a08..c4d7096f 100644 --- a/.phpcs.xml +++ b/.phpcs.xml @@ -6,9 +6,6 @@ - - */maintenance/* - . diff --git a/extension.json b/extension.json index 8554f8aa..c5c15eb1 100644 --- a/extension.json +++ b/extension.json @@ -22,12 +22,12 @@ ] }, "AutoloadClasses": { - "SyntaxHighlight": "SyntaxHighlight.php", - "SyntaxHighlight_GeSHi": "SyntaxHighlight.php", - "GeSHi": "GeSHi.php", - "SyntaxHighlightAce": "SyntaxHighlightAce.php", - "SyntaxHighlightGeSHiCompat": "SyntaxHighlightGeSHiCompat.php", - "ResourceLoaderSyntaxHighlightVisualEditorModule": "ResourceLoaderSyntaxHighlightVisualEditorModule.php" + "SyntaxHighlight": "includes/SyntaxHighlight.php", + "SyntaxHighlight_GeSHi": "includes/SyntaxHighlight.php", + "GeSHi": "includes/GeSHi.php", + "SyntaxHighlightAce": "includes/SyntaxHighlightAce.php", + "SyntaxHighlightGeSHiCompat": "includes/SyntaxHighlightGeSHiCompat.php", + "ResourceLoaderSyntaxHighlightVisualEditorModule": "includes/ResourceLoaderSyntaxHighlightVisualEditorModule.php" }, "ResourceFileModulePaths": { "localBasePath": "modules", diff --git a/GeSHi.php b/includes/GeSHi.php similarity index 100% rename from GeSHi.php rename to includes/GeSHi.php diff --git a/ResourceLoaderSyntaxHighlightVisualEditorModule.php b/includes/ResourceLoaderSyntaxHighlightVisualEditorModule.php similarity index 97% rename from ResourceLoaderSyntaxHighlightVisualEditorModule.php rename to includes/ResourceLoaderSyntaxHighlightVisualEditorModule.php index 11198e18..720cfd22 100644 --- a/ResourceLoaderSyntaxHighlightVisualEditorModule.php +++ b/includes/ResourceLoaderSyntaxHighlightVisualEditorModule.php @@ -60,7 +60,7 @@ class ResourceLoaderSyntaxHighlightVisualEditorModule extends ResourceLoaderFile * @return array */ private function getPygmentsLanguages() { - $lexers = require __DIR__ . '/SyntaxHighlight.lexers.php'; + $lexers = require __DIR__ . '/../SyntaxHighlight.lexers.php'; return $lexers; } diff --git a/SyntaxHighlight.php b/includes/SyntaxHighlight.php similarity index 98% rename from SyntaxHighlight.php rename to includes/SyntaxHighlight.php index b276266c..612ff0e9 100644 --- a/SyntaxHighlight.php +++ b/includes/SyntaxHighlight.php @@ -53,7 +53,7 @@ class SyntaxHighlight { } if ( !$lexers ) { - $lexers = require __DIR__ . '/SyntaxHighlight.lexers.php'; + $lexers = require __DIR__ . '/../SyntaxHighlight.lexers.php'; } $lexer = strtolower( $lang ); @@ -184,7 +184,7 @@ class SyntaxHighlight { // If $wgPygmentizePath is unset, use the bundled copy. if ( $wgPygmentizePath === false ) { - $wgPygmentizePath = __DIR__ . '/pygments/pygmentize'; + $wgPygmentizePath = __DIR__ . '/../pygments/pygmentize'; } return $wgPygmentizePath; @@ -492,7 +492,7 @@ class SyntaxHighlight { $resourceLoader->register( 'ext.geshi.visualEditor', [ 'class' => ResourceLoaderSyntaxHighlightVisualEditorModule::class, - 'localBasePath' => __DIR__ . DIRECTORY_SEPARATOR . 'modules', + 'localBasePath' => __DIR__ . '/../modules', 'remoteExtPath' => 'SyntaxHighlight_GeSHi/modules', 'scripts' => [ 've-syntaxhighlight/ve.dm.MWSyntaxHighlightNode.js', diff --git a/SyntaxHighlightAce.php b/includes/SyntaxHighlightAce.php similarity index 100% rename from SyntaxHighlightAce.php rename to includes/SyntaxHighlightAce.php diff --git a/SyntaxHighlightGeSHiCompat.php b/includes/SyntaxHighlightGeSHiCompat.php similarity index 100% rename from SyntaxHighlightGeSHiCompat.php rename to includes/SyntaxHighlightGeSHiCompat.php