Difference between revisions of "JInstaller/update"
From Joomla! Documentation
< API15:JInstaller
(New page: ===Description===
Package update method
<span class="editsection" style="font-size:76%;">
<nowiki>[</nowiki>Edit Descripton<nowiki>]</nowiki>
</span...) |
m (preparing for archive only) |
||
(One intermediate revision by the same user not shown) | |||
Line 3: | Line 3: | ||
<span class="editsection" style="font-size:76%;"> | <span class="editsection" style="font-size:76%;"> | ||
− | <nowiki>[< | + | <nowiki>[<! removed edit link to red link >]</nowiki> |
</span> | </span> | ||
− | + | <! removed transcluded page call, red link never existed > | |
===Syntax=== | ===Syntax=== | ||
Line 70: | Line 70: | ||
<span class="editsection" style="font-size:76%;"> | <span class="editsection" style="font-size:76%;"> | ||
− | <nowiki>[< | + | <nowiki>[<! removed edit link to red link >]</nowiki> |
</span> | </span> | ||
− | + | <! removed transcluded page call, red link never existed > | |
===Examples=== | ===Examples=== | ||
− | + | === Code Examples === | |
<dpl> | <dpl> | ||
noresultsheader=\n | noresultsheader=\n | ||
category=update | category=update | ||
category=JInstaller | category=JInstaller | ||
− | + | namespace=CodeExample | |
category=MethodExample | category=MethodExample | ||
include=* | include=* | ||
format= ,,, | format= ,,, | ||
</dpl> | </dpl> | ||
+ | [[Category:Archived pages API15]] |
Latest revision as of 19:53, 24 March 2017
The "API15" namespace is an archived namespace. This page contains information for a Joomla! version which is no longer supported. It exists only as a historical reference, it will not be improved and its content may be incomplete and/or contain broken links.
Description[edit]
Package update method
[<! removed edit link to red link >]
<! removed transcluded page call, red link never existed >
Syntax[edit]
update($path=null)
Parameter Name | Default Value | Description |
---|---|---|
$path | null | $path Path to package source folder |
Returns[edit]
boolean True if successful
Defined in[edit]
libraries/joomla/installer/installer.php
Importing[edit]
jimport( 'joomla.installer.installer' );
Source Body[edit]
function update($path=null)
{
if ($path && JFolder::exists($path)) {
$this->setPath('source', $path);
} else {
$this->abort(JText::_('Update path does not exist'));
}
if (!$this->setupInstall()) {
return $this->abort(JText::_('Unable to detect manifest file'));
}
/*
* 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')) {
return $this->abort(JText::_('MUSTENABLELEGACY'));
}
$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]->update();
}
return false;
}
[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >
Examples[edit]
Code Examples[edit]