JUpdaterExtension/findUpdate
From Joomla! Documentation
< API16:JUpdaterExtensionRevision as of 17:42, 22 March 2010 by Doxiki (talk | contribs) (New page:
<span class="editsection" style="font-size:76%;">
<nowiki>[</nowiki>Edit Descripton<nowiki>]</nowiki>
</span>
{{Description:JUpdaterExt...)
Revision as of 17:42, 22 March 2010 by Doxiki (talk | contribs) (New page:
<span class="editsection" style="font-size:76%;">
<nowiki>[</nowiki>Edit Descripton<nowiki>]</nowiki>
</span>
{{Description:JUpdaterExt...)
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.
The "API16" 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.
Template:Description:JUpdaterExtension/findUpdate
Syntax[edit]
findUpdate($options)
Parameter Name | Default Value | Description |
---|---|---|
$options |
Defined in[edit]
libraries/joomla/updater/adapters/extension.php
Importing[edit]
jimport( 'joomla.updater.adapters.extension' );
Source Body[edit]
public function findUpdate($options)
{
$url = $options['location'];
$this->_url =& $url;
$this->_update_site_id = $options['update_site_id'];
//echo '<p>Find update for extension run on <a href="'. $url .'">'. $url .'</a></p>';
if(substr($url, -4) != '.xml') {
if(substr($url, -1) != '/') {
$url .= '/';
}
$url .= 'extension.xml';
}
$dbo =& $this->parent->getDBO();
if (!($fp = @fopen($url, "r"))) {
// TODO: Add a 'mark bad' setting here somehow
JError::raiseWarning('101', JText::_('Update') .'::'. JText::_('Extension') .': '. JText::_('Could not open').' '. $url);
return false;
}
$this->xml_parser = xml_parser_create('');
xml_set_object($this->xml_parser, $this);
xml_set_element_handler($this->xml_parser, '_startElement', '_endElement');
xml_set_character_data_handler($this->xml_parser, '_characterData');
while ($data = fread($fp, 8192)) {
if (!xml_parse($this->xml_parser, $data, feof($fp))) {
die(sprintf("XML error: %s at line %d",
xml_error_string(xml_get_error_code($this->xml_parser)),
xml_get_current_line_number($this->xml_parser)));
}
}
xml_parser_free($this->xml_parser);
if(isset($this->latest)) {
$updates = Array($this->latest);
} else {
$updates = Array();
}
return Array('update_sites'=>Array(),'updates'=>$updates);
}
[Edit See Also] Template:SeeAlso:JUpdaterExtension/findUpdate
Examples[edit]
<CodeExamplesForm />