joomla/joomla-cms — pull request #5568 by mbabker (2014-12-31 03:58:13+00:00)
Title: Standardizing the install paths for discover_install

Continuing the `JInstallerAdapter` implementations and standardizing the adapter paths, this PR focuses in on the `discover_install` path. As you'll see in the `JInstallerAdapter` class itself, the routine has been standardized and is a stripped down version of the main `install` method.

As the component's adapter had support for all features in its implementation of `discover_install`, the other adapters are now updated to support these same features. This means discover install of modules, for example, will support the use of extension scripts. Note that the `file` and `package` adapters, which did not previously support discover, continue to not do so; also the `language` adapter is not yet updated (same situation as the previous pull).

### Testing Instructions

Since some of the common methods between `install` and `discover_install` are modified, you'll want to first test that installing components, modules, plugins, libraries, and templates still functions OK. But this works to our advantage as it will position extension files in place to test discover installs. After you've verified this continues to work OK, you'll need to prepare your environment to test the discovery of uninstalled extensions and then install them. One of the easiest things to do is to delete the `configuration.php` file and re-install Joomla (with the same instance you previously installed extensions into). Another option is to go into the database and manually remove all of the data for your installed extensions (template styles, tables the extensions may add to the database, the extension records themselves, and menu, asset, and module records as appropriate). Make sure you do not delete the extensions from the filesystem while doing this reset. Once you've gotten this far, you'll want to go to the Extension Manager's Discover view and click the Discover button; you should now get a list of extensions which are not installed. Select them and click the install button; all should correctly install.

### Extension Concerns

Components previously supported the `preflight`, `install`, and `postflight` extension script methods and that is the support that has been added for the other extension types. This could cause some concerns in extension scripts that don't account for the possibility to be triggered via a discover installed (I discovered one such issue with `com_patchtester` while testing this). If it's decided this specific change may do more harm than good for extensions, we can update the discover routine to only process the script files for components so as to not remove a feature's support in a release that does not allow breaking B/C.