Jeroen De Dauw has submitted this change and it was merged. Change subject: Update dependency checks and magic loading ......................................................................
Update dependency checks and magic loading Change-Id: If3720f0e914ff97f0a16c2487065fda42889f076 --- M Maps.php 1 file changed, 23 insertions(+), 3 deletions(-) Approvals: Netbrain: Looks good to me, but someone else must approve MathiasLidal: Looks good to me, but someone else must approve Jeroen De Dauw: Looks good to me, approved jenkins-bot: Verified diff --git a/Maps.php b/Maps.php index 3a7005b..1806339 100644 --- a/Maps.php +++ b/Maps.php @@ -45,8 +45,18 @@ } // Attempt to include the DataValues lib if that has not been loaded yet. -if ( !defined( 'DataValues_VERSION' ) && file_exists( __DIR__ . '/../DataValues/DataValues.php' ) ) { +if ( !defined( 'DATAVALUES_VERSION' ) && is_readable( __DIR__ . '/../DataValues/DataValues.php' ) ) { include_once( __DIR__ . '/../DataValues/DataValues.php' ); +} + +// Include the DataValuesInterfaces library if that hasn't been done yet. +if ( !defined( 'DATAVALUES_INTERFACES_VERSION' ) ) { + @include_once( __DIR__ . '/../DataValues/DataValuesInterfaces/DataValuesInterfaces.php' ); +} + +// Include the DataValuesCommon library if that hasn't been done yet. +if ( !defined( 'DATAVALUES_COMMON_VERSION' ) ) { + @include_once( __DIR__ . '/../DataValues/DataValuesCommon/DataValuesCommon.php' ); } // Only initialize the extension when all dependencies are present. @@ -55,8 +65,18 @@ } // Only initialize the extension when all dependencies are present. -if ( !defined( 'DataValues_VERSION' ) ) { - throw new Exception( 'You need to have DataValues installed in order to use Maps' ); +if ( !defined( 'DATAVALUES_VERSION' ) ) { + throw new Exception( 'You need to have DataValues loaded in order to use Maps' ); +} + +// Only initialize the extension when all dependencies are present. +if ( !defined( 'DATAVALUES_INTERFACES_VERSION' ) ) { + throw new Exception( 'You need to have DataValuesInterfaces loaded in order to use Maps' ); +} + +// Only initialize the extension when all dependencies are present. +if ( !defined( 'DATAVALUES_COMMON_VERSION' ) ) { + throw new Exception( 'You need to have DataValuesCommon loaded in order to use Maps' ); } if ( version_compare( $GLOBALS['wgVersion'], '1.18c' , '<' ) ) { -- To view, visit https://gerrit.wikimedia.org/r/85339 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: If3720f0e914ff97f0a16c2487065fda42889f076 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Maps Gerrit-Branch: master Gerrit-Owner: Jeroen De Dauw <jeroended...@gmail.com> Gerrit-Reviewer: Daniel Werner <daniel.wer...@wikimedia.de> Gerrit-Reviewer: Jeroen De Dauw <jeroended...@gmail.com> Gerrit-Reviewer: MathiasLidal <mathiasli...@gmail.com> Gerrit-Reviewer: Netbrain <k...@heldig.org> Gerrit-Reviewer: Nischayn22 <nischay...@gmail.com> Gerrit-Reviewer: Pastakhov <pastak...@yandex.ru> Gerrit-Reviewer: jenkins-bot _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits