r69736 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r69735‎ | r69736 | r69737 >
Date:17:23, 22 July 2010
Author:awjrichards
Status:reverted (Comments)
Tags:
Comment:
Added ability to specify the path to Maintenance.php as a CLI argument in stompPFPPendingProcessor.php
Also updated the inline documentation for clarity.
Modified paths:
  • /trunk/extensions/DonationInterface/payflowpro_gateway/stompPFPPendingProcessor.php (modified) (history)

Diff [purge]

Index: trunk/extensions/DonationInterface/payflowpro_gateway/stompPFPPendingProcessor.php
@@ -2,8 +2,15 @@
33 /**
44 * Processes pending PayflowPro transactions in a queueing service using Stomp
55 *
6 - * Uses the MediaWiki maintenance system for command line execution. Requires MW > 1.16
 6+ * Uses the MediaWiki maintenance system for command line execution. Requires, at the
 7+ * very least, the Maintenance.php file found in Mediawiki > 1.16. If you are running
 8+ * MW < 1.16, you can grab a copy of Maintenance.php and place it somewhere accessible
 9+ * and run this script with:
 10+ * php stompPFPPendingProcessor.php -m "/path/to/Maintenance.php"
711 *
 12+ * Also note all the other config options that can be passed in via the CLI arguments
 13+ * below.
 14+ *
815 * This was built to verify pending PayflowPro transactions in an ActiveMQ queue system.
916 * It pulls a transaction out of a 'pending' queue and submits the message to PayflowPro
1017 * for verification. If PayflowPro verifies the transaction, it is then passed off to a
@@ -32,8 +39,13 @@
3340 *
3441 * @author: Arthur Richards <arichards@wikimedia.org>
3542 */
36 -require_once( dirname(__FILE__) . "/../../../maintenance/Maintenance.php" );
3743
 44+// add optional Maintenance.php argument for cli (useful for systems < 1.16)
 45+$opts = getopt( "m:" );
 46+// if the path is not specified from CLI, default Maintenance.php path
 47+$maint = ( $opts['m'] ) ? $opts['m'] : dirname(__FILE__) . "/../.././maintenance/Maintenance.php";
 48+require_once( $maint );
 49+
3850 // load necessary stomp files from DonationInterface/active_mq
3951 //require_once( dirname( __FILE__ ) . "/../extensions/DonationInterface/activemq_stomp/Stomp.php" );
4052 require_once('/var/www/sites/all/modules/queue2civicrm/Stomp.php'); // why are these Stomps different?!

Comments

#Comment by Tim Starling (talk | contribs)   06:22, 13 August 2010

I suggest using the environment variable MW_INSTALL_PATH for this, like what other extensions do, instead of inventing your own solution.

#Comment by Awjrichards (talk | contribs)   19:06, 25 August 2010

Updated in r71647

#Comment by Awjrichards (talk | contribs)   19:22, 25 August 2010

Acutally, this file was also removed as of r71653. It provided rather custom functionality which is now handled outside of MW.

#Comment by 😂 (talk | contribs)   19:41, 23 October 2010

Marking reverted, since the whole file was deleted.

Status & tagging log