class AdapterFactory in New Relic 8
Same name and namespace in other branches
- 2.x src/ExtensionAdapter/AdapterFactory.php \Drupal\new_relic_rpm\ExtensionAdapter\AdapterFactory
- 2.0.x src/ExtensionAdapter/AdapterFactory.php \Drupal\new_relic_rpm\ExtensionAdapter\AdapterFactory
Factory to create a New Relic adapter.
Hierarchy
- class \Drupal\new_relic_rpm\ExtensionAdapter\AdapterFactory
Expanded class hierarchy of AdapterFactory
File
- src/
ExtensionAdapter/ AdapterFactory.php, line 8
Namespace
Drupal\new_relic_rpm\ExtensionAdapterView source
class AdapterFactory {
/**
* Returns a new relic adapter.
*
* If the extension is not enabled, a null implementation is returned
* to prevent errors.
*
* @return \Drupal\new_relic_rpm\ExtensionAdapter\NewRelicAdapterInterface
* The new relic adapter.
*/
public static function getAdapter() {
if (extension_loaded('newrelic')) {
return new ExtensionAdapter();
}
else {
return new NullAdapter();
}
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
AdapterFactory:: |
public static | function | Returns a new relic adapter. |