jenkins-bot has submitted this change and it was merged.

Change subject: Detect when invoked via  maintenance/update.php
......................................................................


Detect when invoked via  maintenance/update.php

In case of the non-standard extension location
(different than $IP/extensions/....) this
script causes maintenance/update.php to bail
while trying to require Maintenance classes.

At this stage those classes are available via
the autoloader, therefore try searching for
them via various paths only when autoloading
fails (e.g. when invoked directly.)

Change-Id: I97b1c50bca47e338d32812d7a4dfcddcda8fb0fe
---
M maintenance/fixProofreadPagePagesContentModel.php
1 file changed, 5 insertions(+), 4 deletions(-)

Approvals:
  Tpt: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/maintenance/fixProofreadPagePagesContentModel.php 
b/maintenance/fixProofreadPagePagesContentModel.php
index 3054bf0..0924542 100644
--- a/maintenance/fixProofreadPagePagesContentModel.php
+++ b/maintenance/fixProofreadPagePagesContentModel.php
@@ -19,9 +19,10 @@
  * @ingroup ProofreadPage
  */
 
-$basePath = getenv( 'MW_INSTALL_PATH' ) !== false ? getenv( 'MW_INSTALL_PATH' 
) : __DIR__ . '/../../..';
-
-require_once $basePath . '/maintenance/Maintenance.php';
+if (!class_exists('LoggedUpdateMaintenance')) {
+       $basePath = getenv( 'MW_INSTALL_PATH' ) !== false ? getenv( 
'MW_INSTALL_PATH' ) : __DIR__ . '/../../..';
+       require_once $basePath . '/maintenance/Maintenance.php';
+}
 
  /**
   * Set the content model type for Page: pages
@@ -71,4 +72,4 @@
 }
 
 $maintClass = 'FixProofreadPagePagesContentModel';
-require_once( RUN_MAINTENANCE_IF_MAIN );
\ No newline at end of file
+require_once( RUN_MAINTENANCE_IF_MAIN );

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I97b1c50bca47e338d32812d7a4dfcddcda8fb0fe
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ProofreadPage
Gerrit-Branch: master
Gerrit-Owner: saper <[email protected]>
Gerrit-Reviewer: Aaron Schulz <[email protected]>
Gerrit-Reviewer: Krinkle <[email protected]>
Gerrit-Reviewer: Legoktm <[email protected]>
Gerrit-Reviewer: PleaseStand <[email protected]>
Gerrit-Reviewer: Tpt <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to