function DirectWriteSubscriber::warnAboutDirectWrite
Logs a warning about direct-write mode, if it is in use.
Parameters
\Drupal\package_manager\Event\StatusCheckEvent $event: The event being handled.
File
-
core/
modules/ package_manager/ src/ EventSubscriber/ DirectWriteSubscriber.php, line 56
Class
- DirectWriteSubscriber
- Handles sandbox events when direct-write is enabled.
Namespace
Drupal\package_manager\EventSubscriberCode
public function warnAboutDirectWrite(StatusCheckEvent $event) : void {
if ($event->sandboxManager
->isDirectWrite()) {
$event->addWarning([
$this->t('Direct-write mode is enabled, which means that changes will be made without sandboxing them first. This can be risky and is not recommended for production environments. For safety, your site will be put into maintenance mode while dependencies are updated.'),
]);
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.