Back to ComponentAdapter class

Method setupUpdates

protected void
setupUpdates
()
Method to setup the update routine for the adapter
Returns
  • void
Since
  • 3.4

Method setupUpdates - Source code

/**
 * Method to setup the update routine for the adapter
 *
 * @return  void
 *
 * @since   3.4
 */
protected function setupUpdates()
{
    // Hunt for the original XML file
    $old_manifest = null;
    // Use a temporary instance due to side effects; start in the administrator first
    $tmpInstaller = new Installer();
    $tmpInstaller->setPath('source', $this->parent->getPath('extension_administrator'));
    if (!$tmpInstaller->findManifest()) {
        // Then the site
        $tmpInstaller->setPath('source', $this->parent->getPath('extension_site'));
        if ($tmpInstaller->findManifest()) {
            $old_manifest = $tmpInstaller->getManifest();
        }
    } else {
        $old_manifest = $tmpInstaller->getManifest();
    }
    if ($old_manifest) {
        $this->oldAdminFiles = $old_manifest->administration->files;
        $this->oldApiFiles = $old_manifest->api->files;
        $this->oldFiles = $old_manifest->files;
    }
}