Back to ComponentAdapter class

Method setupInstallPaths

protected void
setupInstallPaths
()
Method to do any prechecks and setup the install paths for the extension
Returns
  • void
Since
  • 3.4
-
  • \RuntimeException

Method setupInstallPaths - Source code

/**
 * Method to do any prechecks and setup the install paths for the extension
 *
 * @return  void
 *
 * @since   3.4
 * @throws  \RuntimeException
 */
protected function setupInstallPaths()
{
    // Set the installation target paths
    $this->parent->setPath('extension_site', Path::clean(JPATH_SITE . '/components/' . $this->element));
    $this->parent->setPath('extension_administrator', Path::clean(JPATH_ADMINISTRATOR . '/components/' . $this->element));
    $this->parent->setPath('extension_api', Path::clean(JPATH_API . '/components/' . $this->element));
    // Copy the admin path as it's used as a common base
    $this->parent->setPath('extension_root', $this->parent->getPath('extension_administrator'));
    // Make sure that we have an admin element
    if (!$this->getManifest()->administration) {
        throw new \RuntimeException(Text::_('JLIB_INSTALLER_ERROR_COMP_INSTALL_ADMIN_ELEMENT'));
    }
}