You are here

function ldap_servers_update_8303 in Lightweight Directory Access Protocol (LDAP) 8.3

Same name and namespace in other branches
  1. 8.4 ldap_servers/ldap_servers.install \ldap_servers_update_8303()

Adds default timeout to all servers.

File

ldap_servers/ldap_servers.install, line 81
Install, update and uninstall functions for the LDAP API module.

Code

function ldap_servers_update_8303() {
  $factory = \Drupal::service('ldap.servers');

  /** @var \Drupal\ldap_servers\ServerFactory $factory */
  $servers = $factory
    ->getAllServers();
  foreach ($servers as $server) {
    $server
      ->set('timeout', 10);
    $server
      ->save();
  }
  return t('Server network timeouts are now configurable. Your servers have been set to 10 seconds.');
}