API15:JInstaller/install
From Joomla! Documentation
Description
Package installation method
[<! removed edit link to red link >]
<! removed transcluded page call, red link never existed >
Syntax
install($path=null)
| Parameter Name | Default Value | Description |
|---|---|---|
| $path | null | $path Path to package source folder |
Returns
boolean True if successful
Defined in
libraries/joomla/installer/installer.php
Importing
jimport( 'joomla.installer.installer' );
Source Body
function install($path=null)
{
if ($path && JFolder::exists($path)) {
$this->setPath('source', $path);
} else {
$this->abort(JText::_('Install path does not exist'));
return false;
}
if (!$this->setupInstall()) {
$this->abort(JText::_('Unable to detect manifest file'));
return false;
}
/*
* LEGACY CHECK
*/
$root =& $this->_manifest->document;
$version = $root->attributes('version');
$rootName = $root->name();
$config = &JFactory::getConfig();
if ((version_compare($version, '1.5', '<') || $rootName == 'mosinstall') && !$config->getValue('config.legacy')) {
$this->abort(JText::_('MUSTENABLELEGACY'));
return false;
}
$type = $root->attributes('type');
// Needed for legacy reasons ... to be deprecated in next minor release
if ($type == 'mambot') {
$type = 'plugin';
}
if (is_object($this->_adapters[$type])) {
return $this->_adapters[$type]->install();
}
return false;
}
[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >
Examples
Code Examples