class Http2ServerPushServiceProvider in HTTP/2 Server Push 8
Hierarchy
- class \Drupal\http2_server_push\Http2ServerPushServiceProvider implements ServiceProviderInterface
Expanded class hierarchy of Http2ServerPushServiceProvider
See also
\Drupal\http2_server_push\EventSubscriber\ConfigSubscriber::onSave()
File
- src/
Http2ServerPushServiceProvider.php, line 12
Namespace
Drupal\http2_server_pushView source
class Http2ServerPushServiceProvider implements ServiceProviderInterface {
/**
* {@inheritdoc}
*/
public function register(ContainerBuilder $container) {
if (!$this
->cssAggregationIsEnabled()) {
$container
->removeDefinition('asset.css.collection_renderer.http2_server_push');
}
if (!$this
->jsAggregationIsEnabled()) {
$container
->removeDefinition('asset.js.collection_renderer.http2_server_push');
}
}
/**
* @return bool
*/
protected function cssAggregationIsEnabled() {
return BootstrapConfigStorageFactory::get()
->read('system.performance')['css']['preprocess'] === TRUE;
}
/**
* @return bool
*/
protected function jsAggregationIsEnabled() {
return BootstrapConfigStorageFactory::get()
->read('system.performance')['js']['preprocess'] === TRUE;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
Http2ServerPushServiceProvider:: |
protected | function | ||
Http2ServerPushServiceProvider:: |
protected | function | ||
Http2ServerPushServiceProvider:: |
public | function |
Registers services to the container. Overrides ServiceProviderInterface:: |