joomla/joomla-cms — pull request #5514 by mbabker (2014-12-24 21:12:31+00:00)
Title: Continued JInstallerAdapter implementation - Standard Install Routine

Continuing on with the internal refactoring of the extension install adapters, this PR completely standardizes the `install` routine for all extension adapters minus the language adapter (I'll need to work with that adapter some, it isn't forgotten about).

### Summary
In `JInstallerAdapter`, a standardized `install()` method is introduced with a standardized path for all extensions. No adapter overrides this method, meaning all adapters are now expected to have the same features for the install routine. The routine is broken into several smaller methods which are standardized across the adapters and reused as often as able; more optimization is surely possible as there's still quite a bit of duplicated code. Additionally, these updates now give `library` and `template` extensions the ability to utilize install scripts during the install routine (support to be expanded as the adapters are refactored). In short, if one extension type supports it, everything is supporting it right now.

As an added bonus, some internal refactoring of `JInstaller::loadAdapters()` has been performed. The method now proxies to a newly preferred API which is better suited for autoloading of adapters (breaking some of the dependency on the `JAdapter` class) and introduces support for custom extension types. Calling `JInstaller::getAdapters` and passing an array of adapter names as the second parameter will allow you to create new adapters. For extensions which install addon extensions via their install script, something like this is now possible:

```php
// Instantiate the installer object
$installer = new JInstaller;

// Preload the extension adapters and inject our custom adapter
$installer->getAdapters(array(), array('custom'));

// Install our extension
$result = $installer->install(__DIR__ . '/extension');
```

The API will expect a class named `JInstallerAdapterCustom` using the above example.

### Testing Instructions
Note that *EVERY* extension type will need to be tested. Templates, components, libraries; you name it. Grab your favorite extensions, install them, and make sure everything checks out with the install routine. Note that this is only focusing on install via the Extension Manager -> Install view. Discover installs are not yet covered, but should be tested to make sure everything is working as expected. Try some updates too if able as a couple of adapters use the install routine for their updates. And of course, everything should cleanly uninstall when you're done testing.

### Language Strings
In an effort to clean up some of the duplication, I've added some strings which had already existed in an extension specific context. My aim is that with 4.0, most of the adapter specific strings could be removed in favor of the generic strings and lighten some of the load on translators. We'll cross that bridge later.