Paladox has uploaded a new change for review.

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

Change subject: Use $wgAutoloadClasses to load classes
......................................................................

Use $wgAutoloadClasses to load classes

Also remove jquery as dependacy from resourceloader because it is always
loaded first and causes the tests to fail.

Change-Id: I5c3b84229aa0112b61632d8a5e56ff9564bdd776
---
M XMLContentExtension.body.php
M XMLContentExtension.hooks.php
M XMLContentExtension.php
M XMLContentExtension.resources.php
M XMLContentExtension.routes.php
M include/XMLDocument.class.php
6 files changed, 34 insertions(+), 45 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/XMLContentExtension 
refs/changes/47/271147/1

diff --git a/XMLContentExtension.body.php b/XMLContentExtension.body.php
index 722ca11..3ff9ee9 100644
--- a/XMLContentExtension.body.php
+++ b/XMLContentExtension.body.php
@@ -128,5 +128,3 @@
     //wfDebugLog('xml', 'To add :' . print_r($wgXMLContentNamespaces, true));
     return true;
   };*/
-
-?>
diff --git a/XMLContentExtension.hooks.php b/XMLContentExtension.hooks.php
index 0589f9b..1644d46 100644
--- a/XMLContentExtension.hooks.php
+++ b/XMLContentExtension.hooks.php
@@ -562,5 +562,3 @@
   }
 
 }
-
-?>
diff --git a/XMLContentExtension.php b/XMLContentExtension.php
index da37baa..b70bf1d 100644
--- a/XMLContentExtension.php
+++ b/XMLContentExtension.php
@@ -18,11 +18,11 @@
 
 require_once(__DIR__ . '/XMLContentExtension.body.php');
 
-require_once(__DIR__ . '/include/XmlContent.class.php');
-require_once(__DIR__ . '/include/XmlContentHandler.class.php');
-require_once(__DIR__ . '/include/XMLDocument.class.php');
+$wgAutoloadClasses['XMLDocument'] = __DIR__ . '/include/XmlContent.class.php';
+$wgAutoloadClasses['XmlContentHandler'] = __DIR__ . 
'/include/XmlContentHandler.class.php';
+$wgAutoloadClasses['XMLDocument'] = __DIR__ . '/include/XMLDocument.class.php';
 
 require_once(__DIR__ . '/XMLContentExtension.resources.php');
 
-require_once(__DIR__ . '/XMLContentExtension.hooks.php');
-require_once(__DIR__ . '/XMLContentExtension.routes.php');
+$wgAutoloadClasses['XMLContentExtensionHooks'] = __DIR__ . 
'/XMLContentExtension.hooks.php';
+$wgAutoloadClasses['XMLContentExtensionRoutes'] = __DIR__ . 
'/XMLContentExtension.routes.php';
diff --git a/XMLContentExtension.resources.php 
b/XMLContentExtension.resources.php
index 01fd340..cc79591 100644
--- a/XMLContentExtension.resources.php
+++ b/XMLContentExtension.resources.php
@@ -3,48 +3,45 @@
 $wgResourceLoaderDebug = true; //$wgDebugToolbar ?: false;
 
 $wgResourceModules['ace-mode-xml'] = array(
-  'scripts' => array(
-    'js/ace/mode-xml.js',
-  ),
-  'localBasePath' => __DIR__ . '/assets/',
-  'remoteExtPath' => 'XMLContentExtension/assets',
-  'dependencies' => array('require'),
+       'scripts' => array(
+               'js/ace/mode-xml.js',
+       ),
+       'localBasePath' => __DIR__ . '/assets/',
+       'remoteExtPath' => 'XMLContentExtension/assets',
+       'dependencies' => array('require'),
 );
 
 $wgResourceModules['autosize'] = array(
-  'scripts' => array(
-    'js/jquery.autosize.min.js',
-  ),
-  'localBasePath' => __DIR__ . '/assets/',
-  'remoteExtPath' => 'XMLContentExtension/assets',
-  'dependencies' => array('jquery'),
+       'scripts' => array(
+               'js/jquery.autosize.min.js',
+       ),
+       'localBasePath' => __DIR__ . '/assets/',
+       'remoteExtPath' => 'XMLContentExtension/assets',
 );
 
 $wgResourceModules['ace'] = array(
-  'scripts' => array(
-    'js/ace/ace.js',
-  ),
-  'localBasePath' => __DIR__ . '/assets/',
-  'remoteExtPath' => 'XMLContentExtension/assets',
-  'dependencies' => array('ace-mode-xml'),
+       'scripts' => array(
+               'js/ace/ace.js',
+       ),
+       'localBasePath' => __DIR__ . '/assets/',
+       'remoteExtPath' => 'XMLContentExtension/assets',
+       'dependencies' => array('ace-mode-xml'),
 );
 
 $wgResourceModules['require'] = array(
-  'scripts' => array(
-    'js/require/require.js',
-  ),
-  'localBasePath' => __DIR__ . '/assets/',
-  'remoteExtPath' => 'XMLContentExtension/assets'
+       'scripts' => array(
+               'js/require/require.js',
+       ),
+       'localBasePath' => __DIR__ . '/assets/',
+       'remoteExtPath' => 'XMLContentExtension/assets'
 );
 
 $wgResourceModules['ext.XMLContentExtension'] = array(
-  'scripts' => array(
-    'js/XMLContentExtension.js',
-  ),
-  'styles' => 'css/XMLContentExtension.css',
-  'localBasePath' => __DIR__ . '/assets/',
-  'remoteExtPath' => 'XMLContentExtension/assets',
-  'dependencies' => array('jquery.ui.tabs', 'jquery.ui.datepicker', 
'autosize', 'ace')
+       'scripts' => array(
+               'js/XMLContentExtension.js',
+       ),
+       'styles' => 'css/XMLContentExtension.css',
+       'localBasePath' => __DIR__ . '/assets/',
+       'remoteExtPath' => 'XMLContentExtension/assets',
+       'dependencies' => array('jquery.ui.tabs', 'jquery.ui.datepicker', 
'autosize', 'ace')
 );
-
-?>
diff --git a/XMLContentExtension.routes.php b/XMLContentExtension.routes.php
index 73ebef2..3db2833 100644
--- a/XMLContentExtension.routes.php
+++ b/XMLContentExtension.routes.php
@@ -26,5 +26,3 @@
   }
 
 }
-
-?>
diff --git a/include/XMLDocument.class.php b/include/XMLDocument.class.php
index df0096f..44d9dee 100644
--- a/include/XMLDocument.class.php
+++ b/include/XMLDocument.class.php
@@ -250,5 +250,3 @@
   }
 
 }
-
-?>

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5c3b84229aa0112b61632d8a5e56ff9564bdd776
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/XMLContentExtension
Gerrit-Branch: master
Gerrit-Owner: Paladox <[email protected]>

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

Reply via email to