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
Developer Resources:

Documentation: The OJS Technical Reference and the OJS API Reference are both available from the OJS Documentation page. While these are OJS-specific, the OCS codebase is similar enough to OJS they should be of help. There is also an [url=http://pkp.sfu.ca/ocs_documentation[/url]OCS Documentation[/url] page with some more general documentation that might also be of interest.

Git: You can access our public Git Repository here. Comprehensive Git usage instructions are available on the wiki.

Bugzilla: You can access our Bugzilla report tracker here.

Search: You can use our Google Custom Search to search across our main website, the support forum, and Bugzilla.

Questions and discussion are welcome, but if you have a workflow or usability question you should probably post to the OCS Conference Support and Discussion subforum; if you have a technical support question, try the OCS Technical Support subforum.

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: 8425
Joined: Wed Aug 10, 2005 12:56 pm


Return to OCS Development

Who is online

Users browsing this forum: No registered users and 1 guest