本文整理汇总了PHP中JInstallerHelper::cleanupInstall方法的典型用法代码示例。如果您正苦于以下问题:PHP JInstallerHelper::cleanupInstall方法的具体用法?PHP JInstallerHelper::cleanupInstall怎么用?PHP JInstallerHelper::cleanupInstall使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JInstallerHelper
的用法示例。
在下文中一共展示了JInstallerHelper::cleanupInstall方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _installPackage
function _installPackage()
{
$installer = JSNISInstaller::getInstance();
if ($this->_packageExtract) {
$objJSNPlugins = JSNISFactory::getObj('classes.jsn_is_plugins');
$countSource = count($this->_listCurrentSources);
$currentSources = array();
if ($countSource) {
for ($i = 0; $i < $countSource; $i++) {
$item = $this->_listCurrentSources[$i];
$currentSources[$item->element] = $objJSNPlugins->getXmlFile($item);
}
}
if (!$installer->install($this->_packageExtract['dir'])) {
$this->_msgError = JText::_('INSTALLER_IMAGE_SOURCE_PACKAGE_UNSUCCESSFULLY_INSTALLED');
$this->_error = true;
return false;
}
$this->_upgradeSourceDB($currentSources, $installer);
if (!is_file($this->_packageExtract['packagefile'])) {
$config = JFactory::getConfig();
$package['packagefile'] = $config->getValue('config.tmp_path') . DS . $this->_packageExtract['packagefile'];
}
JInstallerHelper::cleanupInstall($this->_packageExtract['packagefile'], $this->_packageExtract['extractdir']);
}
}
示例2: install
/**
* Download and install
*/
function install($id, $url)
{
if (!is_string($url)) {
return JText::_('NNEM_ERROR_NO_VALID_URL');
}
$url = 'http://' . str_replace('http://', '', $url);
if (!($target = JInstallerHelper::downloadPackage($url))) {
return JText::_('NNEM_ERROR_CANNOT_DOWNLOAD_FILE');
}
$target = JFactory::getConfig()->get('tmp_path') . '/' . $target;
NNFrameworkFunctions::loadLanguage('com_installer', JPATH_ADMINISTRATOR);
jimport('joomla.installer.installer');
jimport('joomla.installer.helper');
// Get an installer instance
$installer = JInstaller::getInstance();
// Unpack the package
$package = JInstallerHelper::unpack($target);
// Cleanup the install files
if (!is_file($package['packagefile'])) {
$config = JFactory::getConfig();
$package['packagefile'] = $config->get('tmp_path') . '/' . $package['packagefile'];
}
JInstallerHelper::cleanupInstall($package['packagefile'], $package['packagefile']);
// Install the package
if (!$installer->install($package['dir'])) {
// There was an error installing the package
return JText::sprintf('COM_INSTALLER_INSTALL_ERROR', JText::_('COM_INSTALLER_TYPE_TYPE_' . strtoupper($package['type'])));
}
return true;
}
示例3: install
/**
* install plugin
*/
function install()
{
require_once dirname(__FILE__) . DS . "adapter" . DS . "fabrikplugin.php";
$package = $this->_getPackageFromUpload();
// Was the package unpacked?
if (!$package) {
$this->setState('message', JText::_('UNABLE TO INSTALL PACKAGE FILE'));
return false;
}
$installer =& JInstaller::getInstance();
$this->setState('action', 'install');
$adaptor = new JInstallerFabrikPlugin($installer);
//test fro php 4.x??? seems to work
$adaptor->parent->setPath('source', $package['dir']);
//end test
$installer->setAdapter("fabrikplugin", $adaptor);
// Install the package
if (!$installer->install($package['dir'])) {
// There was an error installing the package
$msg = JText::sprintf('INSTALLEXT', JText::_($package['type']), JText::_('Error'));
$result = false;
} else {
// Package installed sucessfully
$msg = JText::sprintf('INSTALLEXT', JText::_($package['type']), JText::_('Success'));
$result = true;
}
// Cleanup the install files
if (!is_file($package['packagefile'])) {
$config =& JFactory::getConfig();
$package['packagefile'] = $config->getValue('config.tmp_path') . DS . $package['packagefile'];
}
JInstallerHelper::cleanupInstall($package['packagefile'], $package['extractdir']);
return $result;
}
示例4: install
function install($package = null)
{
$mainframe = JFactory::getApplication();
if (!$package) {
$package = $this->_getPackage();
}
// Was the package unpacked?
if (!$package) {
$this->setState('message', 'WF_INSTALLER_NO_PACKAGE');
return false;
}
// Get an installer instance
$installer = JInstaller::getInstance();
// Set Adapter
$type = $package['type'];
$adapter = $this->getAdapter($type);
$installer->setAdapter($type, $adapter);
// Install the package
if (!$installer->install($package['dir'])) {
$result = false;
} else {
$result = true;
}
$this->_result[] = array('name' => $installer->get('name'), 'type' => $type, 'version' => $installer->get('version'), 'result' => $result, 'message' => $installer->get('message'), 'extension.message' => $installer->get('extension.message'));
$this->setState('install.result', $this->_result);
// Cleanup the install files
if (!is_file($package['packagefile'])) {
$config = JFactory::getConfig();
$package['packagefile'] = $config->getValue('config.tmp_path') . DS . $package['packagefile'];
}
if (is_file($package['packagefile'])) {
JInstallerHelper::cleanupInstall($package['packagefile'], $package['extractdir']);
}
return $result;
}
示例5: install
function install()
{
$app = JFactory::getApplication();
$this->setState('action', 'install');
switch ($app->input->get('installtype')) {
case 'folder':
$package = $this->_getPackageFromFolder();
break;
case 'upload':
$package = $this->_getPackageFromUpload();
break;
case 'url':
$package = $this->_getPackageFromUrl();
break;
default:
$this->setState('message', 'No Install Type Found');
return false;
break;
}
// Was the package unpacked?
if (!$package) {
$this->setState('message', 'Unable to find install package');
return false;
}
// Get a database connector
//$db = & JFactory::getDBO();
// Get an installer instance
require_once JPATH_COMPONENT . DS . 'helpers' . DS . 'installer.php';
$installer =& JCKInstaller::getInstance();
// Install the package
if (!$installer->install($package['dir'])) {
// There was an error installing the package
$msg = JText::sprintf('COM_INSTALLER_INSTALL_ERROR', JText::_('COM_INSTALLER_TYPE_TYPE_' . strtoupper($package['type'])));
$result = false;
} else {
// Package installed sucessfully
$msg = JText::sprintf('COM_INSTALLER_INSTALL_SUCCESS', JText::_('COM_INSTALLER_TYPE_TYPE_' . strtoupper($package['type'])));
$result = true;
}
// Set some model state values
$app->enqueueMessage($msg);
$this->setState('name', $installer->get('name'));
$this->setState('result', $result);
$this->setState('message', $installer->message);
$this->setState('extension.message', $installer->get('extension.message'));
// Cleanup the install files
if (!is_file($package['packagefile'])) {
$config =& JFactory::getConfig();
$package['packagefile'] = $config->get('config.tmp_path') . DS . $package['packagefile'];
}
JInstallerHelper::cleanupInstall($package['packagefile'], $package['extractdir']);
return $result;
}
示例6: install
/**
* method to install the component
*
* @return void
* <div id="system-message-container">
<div id="system-message">
<div class="alert alert-message"><a class="close" data-dismiss="alert">×</a>
<h4 class="alert-heading">Message</h4>
<div>
<p>Installing component was successful.</p>
</div>
</div>
</div>
</div>
*/
function install($parent)
{
// $parent is the class calling this method
echo '<div id="system-message-container">';
$msgtext = "";
echo '<div id="system-message">
<div style=" overflow:hidden; margin:8px 0 8px 0; padding:5px;" >
<div style=" font-size:12px; margin:0px 0 0px 0; padding:5px; position:relative; float:right;"><div>Powered by Percha.com</div></div>
<div style="float:left; margin:0 20px 20px 0;"><img src="http://www.fieldsattach.com/images/logo_fieldsattach_small.png" alt="fieldsattach.com" /></div>
<div style=" margin:30px 0 8px 0; padding:5px; font-size:23px; color:#4892AB;">Thanks for install the Fieldsattach component.</div>
</div>';
//INSTALL THE PLUGINS *******************************************************************************
$installer = new JInstaller();
//$installer->_overwrite = true;
$pkg_path = JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_fieldsattach' . DS . 'extensions' . DS;
$pkgs = array('input.zip' => 'Plugin fieldsattachment <strong>Input</strong>', 'file.zip' => 'Plugin fieldsattachment <strong>File</strong>', 'image.zip' => 'Plugin fieldsattachment <strong>image</strong>', 'imagegallery.zip' => 'Plugin fieldsattachment <strong>imagegallery</strong>', 'select.zip' => 'Plugin fieldsattachment <strong>select</strong>', 'textarea.zip' => 'Plugin fieldsattachment <strong>textarea</strong>', 'content_fieldsattachment.zip' => 'Plugin Content FieldsAttachment', 'system_fieldsattachment.zip' => 'Plugin System FieldsAttachment', 'advancedsearch_fieldsattachment.zip' => 'Plugin Advanced Search FieldsAttachment', 'filterarticles.zip' => 'Plugin Advanced FILTER FieldsAttachment');
foreach ($pkgs as $pkg => $pkgname) {
$package = JInstallerHelper::unpack($pkg_path . $pkg);
if ($installer->install($package['dir'])) {
$msgtext .= '<div id="system-message-container"><div class="alert alert-message">' . $pkgname . ' successfully installed.</div></div>';
//ACTIVE IT
} else {
$msgtext .= '<div id="system-message-container"><div class="alert alert-message">ERROR: Could not install the $pkgname. Please install manually</div></div>';
}
//ACTIVE THE PLUGINS *******************************************************************************
$db = JFactory::getDBO();
$sql = "UPDATE #__extensions SET enabled = 1 WHERE element = 'fieldsattachment'";
$db->setQuery($sql);
$db->query();
$db = JFactory::getDBO();
$sql = "UPDATE #__extensions SET enabled = 1 WHERE element = 'fieldsattachmentadvanced'";
$db->setQuery($sql);
$db->query();
$db = JFactory::getDBO();
$sql = "UPDATE #__extensions SET enabled = 1 WHERE folder = 'fieldsattachment'";
$db->setQuery($sql);
$db->query();
//DESACTIVE OLD SEARCH
$db = JFactory::getDBO();
$sql = "UPDATE #__extensions SET enabled = 0 WHERE element = 'fieldsattachment' AND folder='search'";
$db->setQuery($sql);
$db->query();
JInstallerHelper::cleanupInstall($pkg_path . $pkg, $package['dir']);
}
//DELETE EXTENSIONS
$pkg_path = JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_fieldsattach' . DS . 'extensions' . DS;
destroy_dir($pkg_path);
$msgtext .= '<div id="system-message-container"><div class="alert alert-message">Clean install directory: ' . $pkg_path . '</div></div>';
echo $msgtext;
echo '</div>';
//$parent->getParent()->setRedirectURL('index.php?option=com_helloworld');
}
示例7: installExtension
public static function installExtension($url, $label)
{
// Include Joomla! libraries
jimport('joomla.installer.installer');
jimport('joomla.installer.helper');
// System variables
$app = JFactory::getApplication();
// Download the package-file
$package_file = self::downloadPackage($url);
// Simple check for the result
if ($package_file == false) {
JError::raiseWarning('SOME_ERROR_CODE', JText::sprintf('LIB_YIREO_HELPER_INSTALL_DOWNLOAD_FILE_EMPTY', $url));
return false;
}
// Check if the downloaded file exists
$tmp_path = JFactory::getApplication()->getCfg('tmp_path');
$package_path = $tmp_path . '/' . $package_file;
if (!is_file($package_path)) {
JError::raiseWarning('SOME_ERROR_CODE', JText::sprintf('LIB_YIREO_HELPER_INSTALL_DOWNLOAD_FILE_NOT_EXIST', $package_path));
return false;
}
// Check if the file is readable
if (!is_readable($package_path)) {
JError::raiseWarning('SOME_ERROR_CODE', JText::sprintf('LIB_YIREO_HELPER_INSTALL_DOWNLOAD_FILE_NOT_READABLE', $package_path));
return false;
}
// Now we assume this is an archive, so let's unpack it
$package = JInstallerHelper::unpack($package_path);
if ($package == false) {
JError::raiseWarning('SOME_ERROR_CODE', JText::sprintf('LIB_YIREO_HELPER_INSTALL_DOWNLOAD_NO_ARCHIVE', $extension['name']));
return false;
}
// Call the actual installer to install the package
$installer = JInstaller::getInstance();
if ($installer->install($package['dir']) == false) {
JError::raiseWarning('SOME_ERROR_CODE', JText::sprintf('LIB_YIREO_HELPER_INSTALL_EXTENSION_FAIL', $extension['name']));
return false;
}
// Get the name of downloaded package
if (!is_file($package['packagefile'])) {
$package['packagefile'] = JFactory::getApplication()->getCfg('tmp_path') . '/' . $package['packagefile'];
}
// Clean up the installation
@JInstallerHelper::cleanupInstall($package['packagefile'], $package['extractdir']);
JError::raiseNotice('SOME_ERROR_CODE', JText::sprintf('LIB_YIREO_HELPER_INSTALL_EXTENSION_SUCCESS', $label));
// Clean the Joomla! plugins cache
$options = array('defaultgroup' => 'com_plugins', 'cachebase' => JPATH_ADMINISTRATOR . '/cache');
$cache = JCache::getInstance('callback', $options);
$cache->clean();
return true;
}
示例8: autoupdate
function autoupdate()
{
$update = $this->parseXMLFile();
$config =& JFactory::getConfig();
$tmp_dest = $config->getValue('config.tmp_path');
if (!is_object($update)) {
// parseXMLFile will have set a message hopefully
//$this->setState('message', 'XML Parse failed');
return false;
} else {
$destination = $tmp_dest . DS . 'com_jupdateman_auto.tgz';
$download = downloadFile($update->updaterurl, $destination);
if ($download !== true) {
$this->setState('message', $download->error_message);
return false;
} else {
$package = JInstallerHelper::unpack($destination);
if (!$package) {
$this->setState('message', 'Unable to find install package');
return false;
}
$installer =& JInstaller::getInstance();
// Install the package
if (!$installer->install($package['dir'])) {
// There was an error installing the package
$msg = JText::sprintf('INSTALLEXT', JText::_($package['type']), JText::_('Error'));
$result = false;
} else {
// Package installed sucessfully
$msg = JText::sprintf('INSTALLEXT', JText::_($package['type']), JText::_('Success'));
$result = true;
}
// Grab the application
$mainframe =& JFactory::getApplication();
// Set some model state values
$mainframe->enqueueMessage($msg);
$this->setState('name', $installer->get('name'));
$this->setState('result', $result);
$this->setState('message', $installer->message);
$this->setState('extension.message', $installer->get('extension.message'));
// Cleanup the install files
if (!is_file($package['packagefile'])) {
$config =& JFactory::getConfig();
$package['packagefile'] = $config->getValue('config.tmp_path') . DS . $package['packagefile'];
}
JInstallerHelper::cleanupInstall($package['packagefile'], $package['extractdir']);
return $result;
}
}
}
示例9: postflight
function postflight($type, $parent)
{
$url = "http://www.jhackguard.com/downloads/com_jhackguard.zip";
// Download the package at the URL given
$p_file = JInstallerHelper::downloadPackage($url);
// Was the package downloaded?
if (!$p_file) {
JError::raiseWarning('', JText::_('COM_INSTALLER_MSG_INSTALL_INVALID_URL'));
return false;
}
$config = JFactory::getConfig();
$tmp_dest = $config->get('tmp_path');
// Unpack the downloaded package file
$package = JInstallerHelper::unpack($tmp_dest . '/' . $p_file, true);
// Was the package unpacked?
if (!$package || !$package['type']) {
if (in_array($installType, array('upload', 'url'))) {
JInstallerHelper::cleanupInstall($package['packagefile'], $package['extractdir']);
}
$app->setUserState('com_installer.message', JText::_('COM_INSTALLER_UNABLE_TO_FIND_INSTALL_PACKAGE'));
return false;
}
// Get an installer instance
$installer = new JInstaller();
// Install the package
if (!$installer->install($package['dir'])) {
// There was an error installing the package
$msg = JText::sprintf('COM_INSTALLER_INSTALL_ERROR', JText::_('COM_INSTALLER_TYPE_TYPE_' . strtoupper($package['type'])));
$result = false;
} else {
// Package installed sucessfully
$msg = JText::sprintf('COM_INSTALLER_INSTALL_SUCCESS', JText::_('COM_INSTALLER_TYPE_TYPE_' . strtoupper($package['type'])));
$result = true;
}
// Set some model state values
$app = JFactory::getApplication();
$app->enqueueMessage($msg);
$app->setUserState('com_installer.message', $installer->message);
$app->setUserState('com_installer.extension_message', $installer->get('extension_message'));
$app->setUserState('com_installer.redirect_url', $installer->get('redirect_url'));
// Cleanup the install files
if (!is_file($package['packagefile'])) {
$config = JFactory::getConfig();
$package['packagefile'] = $config->get('tmp_path') . '/' . $package['packagefile'];
}
JInstallerHelper::cleanupInstall($package['packagefile'], $package['extractdir']);
$app->enqueueMessage("The default installation of jHackGuard has no filters included. Please download the latest filters by going to the '<b>Filter Maintenance</b>' page in the component menu.", "error");
}
示例10: process
public function process($limitstart = 0)
{
require_once JPATH_ADMINISTRATOR . '/components/com_installer/helpers/installer.php';
JModelLegacy::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_installer/models');
// Path to the pf 4 package
$pkg = JPATH_ADMINISTRATOR . '/components/com_pfmigrator/_install/pkg_projectfork_4.1.0.zip';
$dest = JFactory::getConfig()->get('tmp_path') . '/pkg_projectfork_4.1.0.zip';
// Check if the package exists
if (!file_exists($pkg)) {
$this->success = false;
$this->log[] = JText::_('COM_PFMIGRATOR_PKG_NOT_FOUND');
return false;
}
// Copy package to tmp dir
if (!JFile::copy($pkg, $dest)) {
$this->success = false;
$this->log[] = JText::_('COM_PFMIGRATOR_PKG_COPY_FAILED');
return false;
}
// Unpack the package file
$package = JInstallerHelper::unpack($dest);
if (!$package) {
if (JFile::exists($dest)) {
JFile::delete($dest);
}
$this->success = false;
$this->log[] = JText::_('COM_PFMIGRATOR_PKG_EXTRACT_FAILED');
return false;
}
$installer = JInstaller::getInstance();
// Install the package
if (!$installer->install($package['dir'])) {
if (JFile::exists($dest)) {
JFile::delete($dest);
}
$this->success = false;
$this->log[] = JText::_('COM_PFMIGRATOR_PKG_INSTALL_FAILED') . ' ' . $installer->message . ' ' . $installer->get('extension_message');
return false;
}
// Cleanup the install files
if (!is_file($package['packagefile'])) {
$config = JFactory::getConfig();
$package['packagefile'] = $config->get('tmp_path') . '/' . $package['packagefile'];
}
JInstallerHelper::cleanupInstall($package['packagefile'], $package['extractdir']);
$this->log[] = JText::_('COM_PFMIGRATOR_PKG_INSTALL_SUCCESS');
return true;
}
示例11: upload
function upload()
{
// Initialise variables.
$app = JFactory::getApplication('administrator');
$this->setState('action', 'upload');
switch (JRequest::getWord('installtype')) {
case 'folder':
$package = $this->_getPackageFromFolder();
break;
case 'upload':
$package = $this->_getPackageFromUpload();
break;
case 'url':
$package = $this->_getPackageFromUrl();
break;
default:
JError::raiseWarning(100, JText::_('NO_UPLOAD_TYPE_FOUND'));
return false;
break;
}
// Was the package unpacked?
if (!$package) {
JError::raiseWarning(100, JText::_('UNABLE_TO_FIND_INSTALL_PACKAGE'));
return false;
}
// Get an ja extension uploader instance
$uploader = jaExtUploader::getInstance();
$result = $uploader->upload($package['dir']);
if (!$result) {
// There was an error uploading the package
$msg = JText::sprintf('THERE_WAS_AN_ERROR_UPLOADING_THE_PACKAGE_S', $package['type']);
JError::raiseWarning(100, $msg);
//$result = false;
} else {
// Package uploaded sucessfully
$msg = JText::sprintf('COM_INSTALLER_INSTALL_SUCCESS', $package['type']);
//$result = true;
}
// Cleanup the install files
if (!JFile::exists($package['packagefile'])) {
$config = JFactory::getConfig();
$package['packagefile'] = $config->get('tmp_path') . '/' . $package['packagefile'];
}
JInstallerHelper::cleanupInstall($package['packagefile'], $package['extractdir']);
return $result;
}
示例12: com_install
function com_install()
{
$db =& JFactory::getDBO();
// install the plugin
jimport('joomla.installer.installer');
/*
// Get the path to the package to install
$p_dir = JPATH_ADMINISTRATOR.DS.'components'.DS.'com_sef'.DS.'plugin';
// Detect the package type
$type = JInstallerHelper::detectType($p_dir);
$package = array();
$package['packagefile'] = null;
$package['extractdir'] = null;
$package['dir'] = $p_dir;
$package['type'] = $type;
*/
// Get the path to the package to install
$p_filename = JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_sef' . DS . 'plugin' . DS . 'sef_advance.tgz';
// Unpack and verify
$package = JInstallerHelper::unpack($p_filename);
// Get an installer instance
//$installer =& JInstaller::getInstance();
$installer = new JInstaller();
// Install the package
if (!$installer->install($package['dir'])) {
$msg = 'Error installing the plugin<br />Please install the SEF Advance plugin manually.';
} else {
$msg = 'SEF Advance system plugin installed';
$query = "UPDATE #__plugins " . "SET published=1, ordering=-200 " . "WHERE element='sef_advance'";
$db->setQuery($query);
if ($db->query()) {
$msg .= ' and published';
}
}
// Cleanup
JInstallerHelper::cleanupInstall($p_filename, $package['dir']);
echo $msg;
echo '<br />';
$query = "UPDATE #__components " . "SET name = '. SEF Advance .', admin_menu_alt = '. SEF Advance .' " . "WHERE admin_menu_link = 'option=com_sef' AND name = 'SEF Advance'";
$db->setQuery($query);
$db->query();
echo '<a href="index.php?option=com_sef">Proceed to SEF Advance control panel</a><br />';
return true;
}
示例13: _installPackage
function _installPackage()
{
if ($this->_packageExtract) {
$jinstaller = JInstaller::getInstance();
if (!$jinstaller->install($this->_packageExtract['dir'])) {
$this->_msgError = JText::_('INSTALLER_PACKAGE_UNSUCCESSFULLY_INSTALLED');
$this->_error = true;
return false;
}
if (!is_file($this->_packageExtract['packagefile'])) {
$config = JFactory::getConfig();
$package['packagefile'] = $config->getValue('config.tmp_path') . DS . $this->_packageExtract['packagefile'];
}
JInstallerHelper::cleanupInstall($this->_packageExtract['packagefile'], $this->_packageExtract['extractdir']);
}
return false;
}
示例14: installPlugin
function installPlugin($maintain = false, $filename = '')
{
if (!$filename) {
return false;
}
$package = $this->_unPackageFromTempFolder($filename);
if (!$package) {
$this->setState('message', 'Unable to find install package');
return false;
}
$objJSNPlugins = JSNISFactory::getObj('classes.jsn_is_plugins');
$pluginModel = JModel::getInstance('plugins', 'imageshowmodel');
$listJSNPlugins = $pluginModel->getFullData();
$countPlugin = count($listJSNPlugins);
global $mainframe;
$plugins = array();
if ($countPlugin) {
for ($i = 0; $i < $countPlugin; $i++) {
$item = $listJSNPlugins[$i];
$plugins[$item->element] = $objJSNPlugins->getXmlFile($item);
}
}
$installer = JSNISInstaller::getInstance();
if (!$installer->install($package['dir'])) {
$result = false;
} else {
$msg = JText::_('INSTALLER_THEME_PACKAGE_SUCCESSFULLY_INSTALLED');
$result = true;
}
if ($result && count($plugins) && !$maintain) {
$this->upgradeThemeDB($plugins, $installer);
}
$mainframe->enqueueMessage(@$msg);
$this->setState('name', $installer->get('name'));
$this->setState('result', $result);
$this->setState('message', $installer->message);
$this->setState('extension.message', $installer->get('extension.message'));
if (!is_file($package['packagefile'])) {
$config = JFactory::getConfig();
$package['packagefile'] = $config->get('tmp_path') . DS . $package['packagefile'];
}
JInstallerHelper::cleanupInstall($package['packagefile'], $package['extractdir']);
return $result;
}
示例15: install
public function install($plugin_distr)
{
$package = $this->_getPackageFromDistributives($plugin_distr);
if (!$package) {
return false;
}
// Get an installer instance
$installer = new JInstaller();
//$installer = JInstaller::getInstance();
// Install the package
if (!$installer->install($package['dir'])) {
// There was an error installing the package
$result = false;
} else {
// Package installed sucessfully
$result = true;
}
// Clear install
JInstallerHelper::cleanupInstall($package['packagefile'], $package['extractdir']);
return $result;
}