Skip to content

Commit

Permalink
pkp#25 Drop PEAR/Archive_Tar requirement
Browse files Browse the repository at this point in the history
  • Loading branch information
jonasraoni committed Jun 15, 2022
1 parent fcfc3e9 commit 918f7f1
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 31 deletions.
4 changes: 0 additions & 4 deletions PLNGatewayPlugin.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@

define('PLN_PLUGIN_PING_ARTICLE_COUNT', 12);

// Archive/Tar.php may not be installed, so supress possible error.
@include_once('Archive/Tar.php');

class PLNGatewayPlugin extends GatewayPlugin {
/** @var $parentPluginName string Name of parent plugin */
var $parentPluginName;
Expand Down Expand Up @@ -126,7 +123,6 @@ public function fetch($args, $request) {
$prerequisites = array(
'phpVersion' => PHP_VERSION,
'zipInstalled' => class_exists('ZipArchive') ? 'yes' : 'no',
'tarInstalled' => class_exists('Archive_Tar') ? 'yes' : 'no',
'acron' => isset($products['acron']) ? 'yes' : 'no',
//'tasks' => Config::getVar('general', 'scheduled_tasks', false) ? 'yes' : 'no',
);
Expand Down
17 changes: 0 additions & 17 deletions PLNPlugin.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@
define('PLN_PLUGIN_NOTIFICATION_TYPE_HTTP_ERROR', PLN_PLUGIN_NOTIFICATION_TYPE_PLUGIN_BASE + 0x0000003);
// define('PLN_PLUGIN_NOTIFICATION_TYPE_CURL_MISSING', PLN_PLUGIN_NOTIFICATION_TYPE_PLUGIN_BASE + 0x0000004); DEPRECATED
define('PLN_PLUGIN_NOTIFICATION_TYPE_ZIP_MISSING', PLN_PLUGIN_NOTIFICATION_TYPE_PLUGIN_BASE + 0x0000005);
define('PLN_PLUGIN_NOTIFICATION_TYPE_TAR_MISSING', PLN_PLUGIN_NOTIFICATION_TYPE_PLUGIN_BASE + 0x0000006);

class PLNPlugin extends GenericPlugin {
/**
Expand Down Expand Up @@ -370,11 +369,6 @@ public function manage($args, $request) {
$messageParams = array('contents' => __('plugins.generic.pln.notifications.zip_missing'));
break;
}
if(!$this->tarInstalled()) {
$message = NOTIFICATION_TYPE_ERROR;
$messageParams = array('contents' => __('plugins.generic.pln.notifications.tar_missing'));
break;
}
$message = NOTIFICATION_TYPE_SUCCESS;
$messageParams = array('contents' => __('plugins.generic.pln.enabled'));
$this->updateSetting($journal->getId(), 'enabled', true);
Expand Down Expand Up @@ -526,17 +520,6 @@ public function zipInstalled() {
return class_exists('ZipArchive');
}

/**
* Check if the Archive_Tar extension is installed and available. BagIt
* requires it, and will not function without it.
*
* @return boolean
*/
public function tarInstalled() {
@include_once('Archive/Tar.php');
return class_exists('Archive_Tar');
}

/**
* Check if acron is enabled, or if the scheduled_tasks config var is set.
* The plugin needs to run periodically through one of those systems.
Expand Down
6 changes: 0 additions & 6 deletions classes/tasks/Depositor.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,6 @@ public function executeActions() {
continue;
}

if (!$this->_plugin->tarInstalled()) {
$this->addExecutionLogEntry(__('plugins.generic.pln.notifications.tar_missing'), SCHEDULED_TASK_MESSAGE_TYPE_WARNING);
$this->_plugin->createJournalManagerNotification($journal->getId(), PLN_PLUGIN_NOTIFICATION_TYPE_TAR_MISSING);
continue;
}

$this->addExecutionLogEntry(__('plugins.generic.pln.notifications.getting_servicedocument'), SCHEDULED_TASK_MESSAGE_TYPE_NOTICE);
// get the sword service document
$sdResult = $this->_plugin->getServiceDocument($journal->getId());
Expand Down
3 changes: 1 addition & 2 deletions ping.dtd
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,10 @@
<!ELEMENT releaseDate (#PCDATA)>
<!ELEMENT current (#PCDATA)>

<!ELEMENT prerequisites (phpVersion, curlVersion, zipInstalled, tarInstalled, acron, tasks)>
<!ELEMENT prerequisites (phpVersion, curlVersion, zipInstalled, acron, tasks)>
<!ELEMENT phpVersion (#PCDATA)>
<!ELEMENT curlVersion (#PCDATA)>
<!ELEMENT zipInstalled (#PCDATA)>
<!ELEMENT tarInstalled (#PCDATA)>
<!ELEMENT acron (#PCDATA)>
<!ELEMENT tasks (#PCDATA)>

Expand Down
3 changes: 1 addition & 2 deletions templates/ping.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* PLN plugin settings
*}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plnplugin SYSTEM "ping.dtd">
<!DOCTYPE plnplugin SYSTEM "ping.dtd">
<plnplugin>
<ojsInfo>
<release>{$ojsVersion|escape}</release>
Expand All @@ -21,7 +21,6 @@
<phpVersion>{$prerequisites.phpVersion|escape}</phpVersion>
<curlVersion>not required</curlVersion>
<zipInstalled>{$prerequisites.zipInstalled|escape}</zipInstalled>
<tarInstalled>{$prerequisites.tarInstalled|escape}</tarInstalled>
<acron>{$prerequisites.acron|escape}</acron>
<tasks>{$prerequisites.tasks|escape}</tasks>
</prerequisites>
Expand Down

0 comments on commit 918f7f1

Please sign in to comment.