Back to Installer class

Method setupInstall

public bool|\Joomla\CMS\Installer\InstallerAdapter
setupInstall
(mixed $route = 'install', mixed $returnAdapter = false)
Prepare for installation: this method sets the installation directory, finds and checks the installation file and verifies the installation type.
Parameters
  • string $route The install route being followed
  • bool $returnAdapter Flag to return the instantiated adapter
Returns
  • bool|\Joomla\CMS\Installer\InstallerAdapter InstallerAdapter object if explicitly requested otherwise boolean
Since
  • 3.1
Class: Installer
Project: Joomla

Method setupInstall - Source code

// Utility functions
/**
 * Prepare for installation: this method sets the installation directory, finds
 * and checks the installation file and verifies the installation type.
 *
 * @param   string   $route          The install route being followed
 * @param   boolean  $returnAdapter  Flag to return the instantiated adapter
 *
 * @return  boolean|InstallerAdapter  InstallerAdapter object if explicitly requested otherwise boolean
 *
 * @since   3.1
 */
public function setupInstall($route = 'install', $returnAdapter = false)
{
    // We need to find the installation manifest file
    if (!$this->findManifest()) {
        return false;
    }
    // Load the adapter(s) for the install manifest
    $type = (string) $this->manifest->attributes()->type;
    $params = array('route' => $route, 'manifest' => $this->getManifest());
    // Load the adapter
    $adapter = $this->loadAdapter($type, $params);
    if ($returnAdapter) {
        return $adapter;
    }
    return true;
}