jenkins-bot has submitted this change and it was merged.
Change subject: Orphan rectification for Drush (SEE NOTES)
......................................................................
Orphan rectification for Drush (SEE NOTES)
Depends on DonationInterface @Ic73baedd1 .
DEPLOYMENT:
Requires /etc/fundraising/SmashPig.yaml to have logging and pending-db set up
and available to the Drush user.
Requires that /etc/fundraising/drupal_settings.php define the DonationInterface
globals mentioned in orphan_rectify.drush.inc, and *gotcha* declare them as
globals. TODO: Ask librarizers for a better best practice.
Bug: T141487
Bug: T131275
Change-Id: Idcc551d067822e895ebd51494a4a8c920ed1e8c0
---
A sites/all/modules/wmf_audit/ingenico/ingenico_audit.info
A sites/all/modules/wmf_audit/ingenico/ingenico_audit.module
A sites/all/modules/wmf_audit/ingenico/orphan_rectify.drush.inc
3 files changed, 74 insertions(+), 0 deletions(-)
Approvals:
Ejegg: Looks good to me, approved
jenkins-bot: Verified
diff --git a/sites/all/modules/wmf_audit/ingenico/ingenico_audit.info
b/sites/all/modules/wmf_audit/ingenico/ingenico_audit.info
new file mode 100644
index 0000000..a7657a2
--- /dev/null
+++ b/sites/all/modules/wmf_audit/ingenico/ingenico_audit.info
@@ -0,0 +1,6 @@
+name = Ingenico Audit
+description = Ingenico orphan rectification, and TODO audit
+core = 7.x
+dependencies[] = wmf_audit
+package = WMF Audit
+configure = admin/config/wmf_audit/ingenico_audit
diff --git a/sites/all/modules/wmf_audit/ingenico/ingenico_audit.module
b/sites/all/modules/wmf_audit/ingenico/ingenico_audit.module
new file mode 100644
index 0000000..68456ad
--- /dev/null
+++ b/sites/all/modules/wmf_audit/ingenico/ingenico_audit.module
@@ -0,0 +1,3 @@
+<?php
+
+// TODO: globalcollect_audit WX
diff --git a/sites/all/modules/wmf_audit/ingenico/orphan_rectify.drush.inc
b/sites/all/modules/wmf_audit/ingenico/orphan_rectify.drush.inc
new file mode 100644
index 0000000..940b9f4
--- /dev/null
+++ b/sites/all/modules/wmf_audit/ingenico/orphan_rectify.drush.inc
@@ -0,0 +1,65 @@
+<?php
+/**
+ * Detect and rectify recently orphaned Ingenico transactions
+ */
+
+use SmashPig\Core\Configuration;
+use SmashPig\Core\Context;
+
+/**
+ * Implementation of hook_drush_command()
+ */
+function orphan_rectify_drush_command() {
+ $items = array();
+
+ $items['orphan-rectify'] = array(
+ 'description' =>
+ 'Check for orphaned Ingenico transactions, and
resolve.',
+ 'examples' => array(
+ 'drush orphan-rectify' => '# Run the orphan rectifier.',
+ ),
+ 'options' => array(
+ ),
+ );
+
+ return $items;
+}
+
+/**
+ * Implementation of hook_drush_help()
+ */
+function orphan_rectify_drush_help($section) {
+ switch ($section) {
+ case 'orphan-rectify':
+ return dt("Check for orphaned Ingenico transactions,
and resolve.");
+ }
+}
+
+/**
+ * Note: You'll need to include a bunch of exciting MediaWiki globals in your
+ * Drupal settings.local.php, including default values that would normally be
+ * read from extension.json.
+ * $wgDonationInterfaceDefaultQueueServer
+ * $wgDonationInterfaceQueues
+ * $wgDonationInterfaceEnableQueue
+ * $wgDonationInterfaceQueueMirrors
+ * $wgDonationInterfaceOrphanCron
+ * $wgDonationInterfaceGatewayAdapters
+ * $wgDonationInterfaceForbiddenCountries
+ * $wgDonationInterface3DSRules
+ * $wgGlobalCollectGatewayEnabled
+ * $wgGlobalCollectGatewayAccountInfo
+ * $wgGlobalCollectGatewayURL
+ * $wgDonationInterfacePriceFloor
+ * $wgDonationInterfacePriceCeiling
+ * $wgDonationInterfaceRetryLoopCount
+ */
+function drush_orphan_rectify() {
+ // TODO: SmashPig and DI initialization should be reused from a higher
+ // level and integrated with app config
+ $config = new Configuration();
+ Context::init( $config );
+
+ $rectifier = new GlobalCollectOrphanRectifier();
+ $rectifier->processOrphans();
+}
--
To view, visit https://gerrit.wikimedia.org/r/300708
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Idcc551d067822e895ebd51494a4a8c920ed1e8c0
Gerrit-PatchSet: 20
Gerrit-Project: wikimedia/fundraising/crm
Gerrit-Branch: master
Gerrit-Owner: Awight <[email protected]>
Gerrit-Reviewer: Awight <[email protected]>
Gerrit-Reviewer: Ejegg <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits