class S3fsServiceProvider in S3 File System 8.2
Same name and namespace in other branches
- 8.3 src/S3fsServiceProvider.php \Drupal\s3fs\S3fsServiceProvider
- 4.0.x src/S3fsServiceProvider.php \Drupal\s3fs\S3fsServiceProvider
The stream wrapper class.
In the docs for this class, anywhere you see "<scheme>", it can mean either "s3" or "public", depending on which stream is currently being serviced.
Hierarchy
- class \Drupal\s3fs\S3fsServiceProvider implements ServiceModifierInterface
Expanded class hierarchy of S3fsServiceProvider
File
- src/
S3fsServiceProvider.php, line 15
Namespace
Drupal\s3fsView source
class S3fsServiceProvider implements ServiceModifierInterface {
/**
* Modifies existing service definitions.
*
* @param ContainerBuilder $container
* The ContainerBuilder whose service definitions can be altered.
*/
public function alter(ContainerBuilder $container) {
if (Settings::get('s3fs.use_s3_for_public')) {
// Replace the public stream wrapper with S3fsStream.
$container
->getDefinition('stream_wrapper.public')
->setClass('Drupal\\s3fs\\StreamWrapper\\PublicS3fsStream');
}
if (Settings::get('s3fs.use_s3_for_private')) {
// Replace the private stream wrapper with S3fsStream.
$container
->getDefinition('stream_wrapper.private')
->setClass('Drupal\\s3fs\\StreamWrapper\\PrivateS3fsStream');
}
// Fix CSS static urls
$container
->getDefinition('asset.css.optimizer')
->setClass('Drupal\\s3fs\\S3fsCssOptimizer');
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
S3fsServiceProvider:: |
public | function |
Modifies existing service definitions. Overrides ServiceModifierInterface:: |