Public constructor. Initialises the protected members as well. Useful $config keys:
update_component The component name, e.g. com_foobar
update_version The default version if the manifest cache is unreadable
update_site The URL to the component's update XML stream
update_extraquery The extra query to append to (commercial) components' download URLs
update_sitename The update site's name (description)
public __construct ( array $config = [] ) | ||
$config | array |
/** * Public constructor. Initialises the protected members as well. * * @param array $config */ public function __construct($config = array()) { $config['update_component'] = 'pkg_ars'; $config['update_sitename'] = 'Akeeba Release System'; $config['update_site'] = 'http://cdn.akeebabackup.com/updates/ars.xml'; parent::__construct($config); }
/** * Public constructor. Initialises the protected members as well. * * @param array $config */ public function __construct($config = array()) { $container = Container::getInstance('com_akeeba'); $config['update_component'] = 'pkg_akeeba'; $config['update_sitename'] = 'Akeeba Backup Core'; $config['update_site'] = 'http://cdn.akeebabackup.com/updates/pkgakeebacore.xml'; $config['update_extraquery'] = ''; $isPro = defined('AKEEBA_PRO') ? AKEEBA_PRO : 0; $dlid = $container->params->get('update_dlid', ''); // If I have a valid Download ID I will need to use a non-blank extra_query in Joomla! 3.2+ if (preg_match('/^([0-9]{1,}:)?[0-9a-f]{32}$/i', $dlid)) { // Even if the user entered a Download ID in the Core version. Let's switch his update channel to Professional $isPro = true; } if ($isPro) { $config['update_sitename'] = 'Akeeba Backup Professional'; $config['update_site'] = 'http://cdn.akeebabackup.com/updates/pkgakeebapro.xml'; $config['update_extraquery'] = 'dlid=' . $dlid; } parent::__construct($config); $this->container = $container; $this->extension_id = $this->findExtensionId('pkg_akeeba', 'package'); if (empty($this->extension_id)) { $this->createFakePackageExtension(); $this->extension_id = $this->findExtensionId('pkg_akeeba', 'package'); } }