OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



Redundant code in classes/plugins/PaymethodPlugin.inc.php

OCS development discussion, enhancement requests, third-party patches and plug-ins.

Moderators: jmacgreg, michael

Forum rules
The Public Knowledge Project Support Forum is moving to http://forum.pkp.sfu.ca

This forum will be maintained permanently as an archived historical resource, but all new questions should be added to the new forum. Questions will no longer be monitored on this old forum after March 30, 2015.

Redundant code in classes/plugins/PaymethodPlugin.inc.php

Postby derekp » Mon Feb 18, 2008 3:29 pm

The methods
  • PaymethodPlugin::getInstallSchemaFile()
  • PaymethodPlugin::updateSchema()
  • PaymethodPlugin::getInstallDataFile()
  • PaymethodPlugin::installData()
are identical to those in the Plugin superclass, and should therefore be inherited. This goes for OCS 2.0.0-1 as well as CVS as of 2008-02-13.

Code: Select all
--- classes/plugins/PaymethodPlugin.inc.php.inherit     2008-02-16 04:46:19.930823000 -0800
+++ classes/plugins/PaymethodPlugin.inc.php     2008-02-18 14:17:29.074572000 -0800
@@ -63,49 +63,4 @@
        }

-       /**
-        * Get the filename of the ADODB schema for this plugin.
-        * Subclasses using SQL tables should override this.
-        */
-       function getInstallSchemaFile() {
-               return null;
-       }
-
-       function updateSchema(&$plugin, $args) {
-               $installer =& $args[0];
-               $result =& $args[1];
-
-               $schemaXMLParser = &new adoSchema($installer->dbconn, $installer->dbconn->charSet);
-               $sql = $schemaXMLParser->parseSchema($this->getInstallSchemaFile());
-               if ($sql) {
-                       $result = $installer->executeSQL($sql);
-               } else {
-                       $installer->setError(INSTALLER_ERROR_DB, str_replace('{$file}', $this->getInstallSchemaFile(), Locale::translate('installer.installParseDBFileError')));
-                       $result = false;
-               }
-               return false;
-       }
-
-       /**
-        * Get the filename of the install data for this plugin.
-        * Subclasses using SQL tables should override this.
-        */
-       function getInstallDataFile() {
-               return null;
-       }
-
-       function installData(&$plugin, $args) {
-               $installer =& $args[0];
-               $result =& $args[1];
-
-               $sql = $installer->dataXMLParser->parseData($this->getInstallDataFile());
-               if ($sql) {
-                       $result = $installer->executeSQL($sql);
-               } else {
-                       $installer->setError(INSTALLER_ERROR_DB, str_replace('{$file}', $this->getInstallDataFile(), Locale::translate('installer.installParseDBFileError')));
-                       $result = false;
-               }
-               return false;
-       }
-
        function displayPaymentForm($queuedPaymentId, $key, &$queuedPayment) {
                die('ABSTRACT METHOD');
derekp
 
Posts: 16
Joined: Wed Oct 10, 2007 12:45 am
Location: University of British Columbia

Re: Redundant code in classes/plugins/PaymethodPlugin.inc.php

Postby asmecher » Tue Feb 19, 2008 10:18 am

Hi derekp,

Thanks for contributing!

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 10015
Joined: Wed Aug 10, 2005 12:56 pm


Return to OCS Development

Who is online

Users browsing this forum: No registered users and 0 guests

cron