nesbert/nobjects — pull request #5 by andrewfhart (2013-10-30 04:06:18+00:00)
Title: Specify maximum network timeout delay for LDAP service

The `\NObjects\Ldap\Service` class does not provide a way to specify the maximum desired amount of time to wait before aborting due to a network timeout (e.g.: the ldap server is unreachable), and the defaults are painfully long (>100 seconds in some cases).

This pull request leverages the [LDAP_OPT_NETWORK_TIMEOUT](http://php.net/manual/en/function.ldap-set-option.php) option to allow for programmatic specification of an amount of time to wait before aborting.

Example usage:
```
$options = array(
'host' => $settings['host'],
'defaultUsername' => $settings['username'],
'defaultPassword' => $settings['password'],
);
$ldapService = new \NObjects\Ldap\Service($options);
$ldapService->setNetworkTimeout(5); // <-- specify a maximum wait time of 5 seconds

$ldapUser = \NObjects\Ldap\User::authenticate($username, $password, $ldapService);
```

Tests are included to verify proper behavior of the added getters/setters.