Adrian Lang has uploaded a new change for review.

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

Change subject: Actually make resources work from vendor
......................................................................

Actually make resources work from vendor

Change-Id: Iaa6e344ea897a9a399dee7d4618389ce176c97b4
---
M client/WikibaseClient.hooks.php
M client/resources/Resources.php
M lib/resources/Resources.php
M lib/resources/api/resources.php
M lib/resources/entityChangers/resources.php
M lib/resources/experts/resources.php
M lib/resources/formatters/resources.php
M lib/resources/jquery.wikibase/resources.php
M lib/resources/jquery.wikibase/snakview/resources.php
M lib/resources/jquery.wikibase/toolbar/resources.php
M lib/resources/parsers/resources.php
M lib/resources/wikibase.RepoApi/resources.php
M lib/resources/wikibase.store/resources.php
M lib/resources/wikibase.utilities/resources.php
M repo/resources/Resources.php
15 files changed, 44 insertions(+), 44 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/38/171538/1

diff --git a/client/WikibaseClient.hooks.php b/client/WikibaseClient.hooks.php
index f60ec9d..9cfb4c6 100644
--- a/client/WikibaseClient.hooks.php
+++ b/client/WikibaseClient.hooks.php
@@ -502,8 +502,8 @@
                global $wgExtensionAssetsPath;
 
                 preg_match(
-                        '+^.*?' . preg_quote( DIRECTORY_SEPARATOR, '+' ) . 
'(?:vendor|extensions)' .
-                                preg_quote( DIRECTORY_SEPARATOR, '+' ) . 
'(.*)$+',
+                        '+^.*?' . preg_quote( DIRECTORY_SEPARATOR, '+' ) . 
'((?:vendor|extensions)' .
+                                preg_quote( DIRECTORY_SEPARATOR, '+' ) . 
'.*)$+',
                         __DIR__,
                         $remoteExtPathParts
                 );
diff --git a/client/resources/Resources.php b/client/resources/Resources.php
index c591f28..8ce8981 100644
--- a/client/resources/Resources.php
+++ b/client/resources/Resources.php
@@ -2,14 +2,14 @@
 
 return call_user_func( function() {
        preg_match(
-               '+^.*?' . preg_quote( DIRECTORY_SEPARATOR, '+' ) . 
'(?:vendor|extensions)' .
-                       preg_quote( DIRECTORY_SEPARATOR, '+' ) . '(.*)$+',
+               '+^.*?' . preg_quote( DIRECTORY_SEPARATOR, '+' ) . 
'((?:vendor|extensions)' .
+                       preg_quote( DIRECTORY_SEPARATOR, '+' ) . '.*)$+',
                __DIR__,
                $remoteExtPathParts
        );
        $moduleTemplate = array(
                'localBasePath' => __DIR__,
-               'remoteExtPath' => $remoteExtPathParts[1],
+               'remoteExtPath' => DIRECTORY_SEPARATOR . '..' . 
$remoteExtPathParts[1],
        );
 
        return array(
diff --git a/lib/resources/Resources.php b/lib/resources/Resources.php
index f2e85c4..48b6acf 100644
--- a/lib/resources/Resources.php
+++ b/lib/resources/Resources.php
@@ -12,14 +12,14 @@
  */
 return call_user_func( function() {
        preg_match(
-               '+^.*?' . preg_quote( DIRECTORY_SEPARATOR, '+' ) . 
'(?:vendor|extensions)' .
-                       preg_quote( DIRECTORY_SEPARATOR, '+' ) . '(.*)$+',
+               '+^.*?' . preg_quote( DIRECTORY_SEPARATOR, '+' ) . 
'((?:vendor|extensions)' .
+                       preg_quote( DIRECTORY_SEPARATOR, '+' ) . '.*)$+',
                __DIR__,
                $remoteExtPathParts
        );
        $moduleTemplate = array(
                'localBasePath' => __DIR__,
-               'remoteExtPath' => $remoteExtPathParts[1],
+               'remoteExtPath' => DIRECTORY_SEPARATOR . '..' . 
$remoteExtPathParts[1],
        );
 
        $modules = array(
diff --git a/lib/resources/api/resources.php b/lib/resources/api/resources.php
index 8379334..d483b9c 100644
--- a/lib/resources/api/resources.php
+++ b/lib/resources/api/resources.php
@@ -6,14 +6,14 @@
 return call_user_func( function() {
 
        preg_match(
-               '+^.*?' . preg_quote( DIRECTORY_SEPARATOR, '+' ) . 
'(?:vendor|extensions)' .
-                       preg_quote( DIRECTORY_SEPARATOR, '+' ) . '(.*)$+',
+               '+^.*?' . preg_quote( DIRECTORY_SEPARATOR, '+' ) . 
'((?:vendor|extensions)' .
+                       preg_quote( DIRECTORY_SEPARATOR, '+' ) . '.*)$+',
                __DIR__,
                $remoteExtPathParts
        );
        $moduleTemplate = array(
                'localBasePath' => __DIR__,
-               'remoteExtPath' => $remoteExtPathParts[1],
+               'remoteExtPath' => DIRECTORY_SEPARATOR . '..' . 
$remoteExtPathParts[1],
        );
 
        return array(
diff --git a/lib/resources/entityChangers/resources.php 
b/lib/resources/entityChangers/resources.php
index 6b0c1ed..985b09f 100644
--- a/lib/resources/entityChangers/resources.php
+++ b/lib/resources/entityChangers/resources.php
@@ -6,14 +6,14 @@
 return call_user_func( function() {
 
        preg_match(
-               '+^.*?' . preg_quote( DIRECTORY_SEPARATOR, '+' ) . 
'(?:vendor|extensions)' .
-                       preg_quote( DIRECTORY_SEPARATOR, '+' ) . '(.*)$+',
+               '+^.*?' . preg_quote( DIRECTORY_SEPARATOR, '+' ) . 
'((?:vendor|extensions)' .
+                       preg_quote( DIRECTORY_SEPARATOR, '+' ) . '.*)$+',
                __DIR__,
                $remoteExtPathParts
        );
        $moduleTemplate = array(
                'localBasePath' => __DIR__,
-               'remoteExtPath' => $remoteExtPathParts[1],
+               'remoteExtPath' => DIRECTORY_SEPARATOR . '..' . 
$remoteExtPathParts[1],
        );
 
        return array(
diff --git a/lib/resources/experts/resources.php 
b/lib/resources/experts/resources.php
index 50997cc..716d00c 100644
--- a/lib/resources/experts/resources.php
+++ b/lib/resources/experts/resources.php
@@ -8,14 +8,14 @@
 return call_user_func( function() {
 
        preg_match(
-               '+^.*?' . preg_quote( DIRECTORY_SEPARATOR, '+' ) . 
'(?:vendor|extensions)' .
-                       preg_quote( DIRECTORY_SEPARATOR, '+' ) . '(.*)$+',
+               '+^.*?' . preg_quote( DIRECTORY_SEPARATOR, '+' ) . 
'((?:vendor|extensions)' .
+                       preg_quote( DIRECTORY_SEPARATOR, '+' ) . '.*)$+',
                __DIR__,
                $remoteExtPathParts
        );
        $moduleTemplate = array(
                'localBasePath' => __DIR__,
-               'remoteExtPath' => $remoteExtPathParts[1],
+               'remoteExtPath' => DIRECTORY_SEPARATOR . '..' . 
$remoteExtPathParts[1],
        );
 
        return array(
diff --git a/lib/resources/formatters/resources.php 
b/lib/resources/formatters/resources.php
index c85d338..6610050 100644
--- a/lib/resources/formatters/resources.php
+++ b/lib/resources/formatters/resources.php
@@ -8,14 +8,14 @@
 return call_user_func( function() {
 
        preg_match(
-               '+^.*?' . preg_quote( DIRECTORY_SEPARATOR, '+' ) . 
'(?:vendor|extensions)' .
-                       preg_quote( DIRECTORY_SEPARATOR, '+' ) . '(.*)$+',
+               '+^.*?' . preg_quote( DIRECTORY_SEPARATOR, '+' ) . 
'((?:vendor|extensions)' .
+                       preg_quote( DIRECTORY_SEPARATOR, '+' ) . '.*)$+',
                __DIR__,
                $remoteExtPathParts
        );
        $moduleTemplate = array(
                'localBasePath' => __DIR__,
-               'remoteExtPath' => $remoteExtPathParts[1],
+               'remoteExtPath' => DIRECTORY_SEPARATOR . '..' . 
$remoteExtPathParts[1],
        );
 
        return array(
diff --git a/lib/resources/jquery.wikibase/resources.php 
b/lib/resources/jquery.wikibase/resources.php
index 2bd68f3..6143fcd 100644
--- a/lib/resources/jquery.wikibase/resources.php
+++ b/lib/resources/jquery.wikibase/resources.php
@@ -7,14 +7,14 @@
  */
 return call_user_func( function() {
        preg_match(
-               '+^.*?' . preg_quote( DIRECTORY_SEPARATOR, '+' ) . 
'(?:vendor|extensions)' .
-                       preg_quote( DIRECTORY_SEPARATOR, '+' ) . '(.*)$+',
+               '+^.*?' . preg_quote( DIRECTORY_SEPARATOR, '+' ) . 
'((?:vendor|extensions)' .
+                       preg_quote( DIRECTORY_SEPARATOR, '+' ) . '.*)$+',
                __DIR__,
                $remoteExtPathParts
        );
        $moduleTemplate = array(
                'localBasePath' => __DIR__,
-               'remoteExtPath' => $remoteExtPathParts[1],
+               'remoteExtPath' => DIRECTORY_SEPARATOR . '..' . 
$remoteExtPathParts[1],
        );
 
        $modules = array(
diff --git a/lib/resources/jquery.wikibase/snakview/resources.php 
b/lib/resources/jquery.wikibase/snakview/resources.php
index 11e053c..3ea4463 100644
--- a/lib/resources/jquery.wikibase/snakview/resources.php
+++ b/lib/resources/jquery.wikibase/snakview/resources.php
@@ -7,14 +7,14 @@
  */
 return call_user_func( function() {
        preg_match(
-               '+^.*?' . preg_quote( DIRECTORY_SEPARATOR, '+' ) . 
'(?:vendor|extensions)' .
-                       preg_quote( DIRECTORY_SEPARATOR, '+' ) . '(.*)$+',
+               '+^.*?' . preg_quote( DIRECTORY_SEPARATOR, '+' ) . 
'((?:vendor|extensions)' .
+                       preg_quote( DIRECTORY_SEPARATOR, '+' ) . '.*)$+',
                __DIR__,
                $remoteExtPathParts
        );
        $moduleTemplate = array(
                'localBasePath' => __DIR__,
-               'remoteExtPath' => $remoteExtPathParts[1],
+               'remoteExtPath' => DIRECTORY_SEPARATOR . '..' . 
$remoteExtPathParts[1],
        );
 
        $modules = array(
diff --git a/lib/resources/jquery.wikibase/toolbar/resources.php 
b/lib/resources/jquery.wikibase/toolbar/resources.php
index bc3def0..8be8768 100644
--- a/lib/resources/jquery.wikibase/toolbar/resources.php
+++ b/lib/resources/jquery.wikibase/toolbar/resources.php
@@ -7,14 +7,14 @@
  */
 return call_user_func( function() {
        preg_match(
-               '+^.*?' . preg_quote( DIRECTORY_SEPARATOR, '+' ) . 
'(?:vendor|extensions)' .
-                       preg_quote( DIRECTORY_SEPARATOR, '+' ) . '(.*)$+',
+               '+^.*?' . preg_quote( DIRECTORY_SEPARATOR, '+' ) . 
'((?:vendor|extensions)' .
+                       preg_quote( DIRECTORY_SEPARATOR, '+' ) . '.*)$+',
                __DIR__,
                $remoteExtPathParts
        );
        $moduleTemplate = array(
                'localBasePath' => __DIR__,
-               'remoteExtPath' => $remoteExtPathParts[1],
+               'remoteExtPath' => DIRECTORY_SEPARATOR . '..' . 
$remoteExtPathParts[1],
        );
 
        $modules = array(
diff --git a/lib/resources/parsers/resources.php 
b/lib/resources/parsers/resources.php
index 84b9b85..c8e9047 100644
--- a/lib/resources/parsers/resources.php
+++ b/lib/resources/parsers/resources.php
@@ -8,14 +8,14 @@
 return call_user_func( function() {
 
        preg_match(
-               '+^.*?' . preg_quote( DIRECTORY_SEPARATOR, '+' ) . 
'(?:vendor|extensions)' .
-                       preg_quote( DIRECTORY_SEPARATOR, '+' ) . '(.*)$+',
+               '+^.*?' . preg_quote( DIRECTORY_SEPARATOR, '+' ) . 
'((?:vendor|extensions)' .
+                       preg_quote( DIRECTORY_SEPARATOR, '+' ) . '.*)$+',
                __DIR__,
                $remoteExtPathParts
        );
        $moduleTemplate = array(
                'localBasePath' => __DIR__,
-               'remoteExtPath' => $remoteExtPathParts[1],
+               'remoteExtPath' => DIRECTORY_SEPARATOR . '..' . 
$remoteExtPathParts[1],
        );
 
        return array(
diff --git a/lib/resources/wikibase.RepoApi/resources.php 
b/lib/resources/wikibase.RepoApi/resources.php
index 7d8ee42..fec38f9 100644
--- a/lib/resources/wikibase.RepoApi/resources.php
+++ b/lib/resources/wikibase.RepoApi/resources.php
@@ -7,14 +7,14 @@
  */
 return call_user_func( function() {
        preg_match(
-               '+^.*?' . preg_quote( DIRECTORY_SEPARATOR, '+' ) . 
'(?:vendor|extensions)' .
-                       preg_quote( DIRECTORY_SEPARATOR, '+' ) . '(.*)$+',
+               '+^.*?' . preg_quote( DIRECTORY_SEPARATOR, '+' ) . 
'((?:vendor|extensions)' .
+                       preg_quote( DIRECTORY_SEPARATOR, '+' ) . '.*)$+',
                __DIR__,
                $remoteExtPathParts
        );
        $moduleTemplate = array(
                'localBasePath' => __DIR__,
-               'remoteExtPath' => $remoteExtPathParts[1],
+               'remoteExtPath' => DIRECTORY_SEPARATOR . '..' . 
$remoteExtPathParts[1],
        );
 
        $modules = array(
diff --git a/lib/resources/wikibase.store/resources.php 
b/lib/resources/wikibase.store/resources.php
index a250fba..d066a5f 100644
--- a/lib/resources/wikibase.store/resources.php
+++ b/lib/resources/wikibase.store/resources.php
@@ -7,14 +7,14 @@
  */
 return call_user_func( function() {
        preg_match(
-               '+^.*?' . preg_quote( DIRECTORY_SEPARATOR, '+' ) . 
'(?:vendor|extensions)' .
-                       preg_quote( DIRECTORY_SEPARATOR, '+' ) . '(.*)$+',
+               '+^.*?' . preg_quote( DIRECTORY_SEPARATOR, '+' ) . 
'((?:vendor|extensions)' .
+                       preg_quote( DIRECTORY_SEPARATOR, '+' ) . '.*)$+',
                __DIR__,
                $remoteExtPathParts
        );
        $moduleTemplate = array(
                'localBasePath' => __DIR__,
-               'remoteExtPath' => $remoteExtPathParts[1],
+               'remoteExtPath' => DIRECTORY_SEPARATOR . '..' . 
$remoteExtPathParts[1],
        );
 
        $modules = array(
diff --git a/lib/resources/wikibase.utilities/resources.php 
b/lib/resources/wikibase.utilities/resources.php
index bdf6b23..23df70a 100644
--- a/lib/resources/wikibase.utilities/resources.php
+++ b/lib/resources/wikibase.utilities/resources.php
@@ -7,14 +7,14 @@
  */
 return call_user_func( function() {
        preg_match(
-               '+^.*?' . preg_quote( DIRECTORY_SEPARATOR, '+' ) . 
'(?:vendor|extensions)' .
-                       preg_quote( DIRECTORY_SEPARATOR, '+' ) . '(.*)$+',
+               '+^.*?' . preg_quote( DIRECTORY_SEPARATOR, '+' ) . 
'((?:vendor|extensions)' .
+                       preg_quote( DIRECTORY_SEPARATOR, '+' ) . '.*)$+',
                __DIR__,
                $remoteExtPathParts
        );
        $moduleTemplate = array(
                'localBasePath' => __DIR__,
-               'remoteExtPath' => $remoteExtPathParts[1],
+               'remoteExtPath' => DIRECTORY_SEPARATOR . '..' . 
$remoteExtPathParts[1],
        );
 
        $modules = array(
diff --git a/repo/resources/Resources.php b/repo/resources/Resources.php
index a984f4f..e9b7a30 100644
--- a/repo/resources/Resources.php
+++ b/repo/resources/Resources.php
@@ -12,14 +12,14 @@
  */
 return call_user_func( function() {
        preg_match(
-               '+^.*?' . preg_quote( DIRECTORY_SEPARATOR, '+' ) . 
'(?:vendor|extensions)' .
-                       preg_quote( DIRECTORY_SEPARATOR, '+' ) . '(.*)$+',
+               '+^.*?' . preg_quote( DIRECTORY_SEPARATOR, '+' ) . 
'((?:vendor|extensions)' .
+                       preg_quote( DIRECTORY_SEPARATOR, '+' ) . '.*)$+',
                __DIR__,
                $remoteExtPathParts
        );
        $moduleTemplate = array(
                'localBasePath' => __DIR__,
-               'remoteExtPath' => $remoteExtPathParts[1],
+               'remoteExtPath' => DIRECTORY_SEPARATOR . '..' . 
$remoteExtPathParts[1],
                'position' => 'top' // reducing the time between DOM 
construction and JS initialisation
        );
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iaa6e344ea897a9a399dee7d4618389ce176c97b4
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Adrian Lang <[email protected]>

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

Reply via email to