This repository has been archived by the owner on Jun 7, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 151
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for loading shared modules
- Loading branch information
1 parent
cf05ed8
commit 50d3302
Showing
1 changed file
with
13 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -314,12 +314,21 @@ function loadPackage( $name ) { | |
return array( $init ); | ||
} | ||
|
||
$title = Title::newFromText( $name ); | ||
if ( !$title || $title->getNamespace() != NS_MODULE ) { | ||
return array(); | ||
if ( preg_match( "/^Dev:/", $name ) ) { | ||
This comment has been minimized.
Sorry, something went wrong. |
||
$sDevName = preg_replace( "/^Dev:/", "", $name ); | ||
This comment has been minimized.
Sorry, something went wrong.
Grunny
Member
|
||
$title = GlobalTitle::newFromText( $sDevName, NS_MODULE, 7931 ); | ||
This comment has been minimized.
Sorry, something went wrong.
Grunny
Member
|
||
if ( !$title ) { | ||
return array(); | ||
} | ||
$module = $this->fetchSharedModule( $title ); | ||
} else { | ||
This comment has been minimized.
Sorry, something went wrong. |
||
$title = Title::newFromText( $name ); | ||
if ( !$title || $title->getNamespace() != NS_MODULE ) { | ||
return array(); | ||
} | ||
$module = $this->fetchModuleFromParser( $title ); | ||
} | ||
|
||
$module = $this->fetchModuleFromParser( $title ); | ||
if ( $module ) { | ||
return array( $module->getInitChunk() ); | ||
} else { | ||
|
1 comment
on commit 50d3302
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs "Wikia change" comments too.
The prefix should probably be in a constant, also you don't need regex, so just use
strpos
.