|
ILIAS
trunk Revision v12.0_alpha-1221-g4e438232683
|
Value object representing a list of LDAP server URLs (primary plus fallbacks). More...
Inheritance diagram for ILIAS\LDAP\Server\ServerUrlList:
Collaboration diagram for ILIAS\LDAP\Server\ServerUrlList:Public Member Functions | |
| __construct (array $entries=[]) | |
| count () | |
| Returns the number of entries (valid and invalid). More... | |
| getConnectionStringAtIndex (int $index) | |
| Connection string for ldap_connect() at the given index (0 = primary). More... | |
| toString () | |
| Convert to stored form (comma-separated string for database and form). More... | |
| __toString () | |
| getInvalidParts () | |
| Entries that could not be parsed as URI (for GUI validation messages). More... | |
| rotate () | |
| New list with first entry moved to the end (for persisted fallback rotation). More... | |
| withPrimaryAt (int $index) | |
| New list with the entry at $index moved to primary (index 0). More... | |
| validUrls () | |
| Iterate over valid URL entries only (invalid/raw string entries are skipped). More... | |
Static Public Member Functions | |
| static | fromString (string $stored) |
| Create from string representation (comma-separated, as stored in DB or form). More... | |
Private Attributes | |
| array | $entries |
Value object representing a list of LDAP server URLs (primary plus fallbacks).
Each entry is either a valid \ILIAS\Data\URI or a raw string (unparseable).
Definition at line 30 of file ServerUrlList.php.
| ILIAS\LDAP\Server\ServerUrlList::__construct | ( | array | $entries = [] | ) |
| list<URI|string> | $entries |
Definition at line 38 of file ServerUrlList.php.
References ILIAS\LDAP\Server\ServerUrlList\$entries.
| ILIAS\LDAP\Server\ServerUrlList::__toString | ( | ) |
Definition at line 109 of file ServerUrlList.php.
References ILIAS\LDAP\Server\ServerUrlList\toString().
Here is the call graph for this function:| ILIAS\LDAP\Server\ServerUrlList::count | ( | ) |
Returns the number of entries (valid and invalid).
Definition at line 76 of file ServerUrlList.php.
Referenced by ILIAS\LDAP\Server\ServerUrlList\rotate().
Here is the caller graph for this function:
|
static |
Create from string representation (comma-separated, as stored in DB or form).
Empty string yields an empty list. Does not throw.
Definition at line 47 of file ServerUrlList.php.
References ILIAS\LDAP\Server\ServerUrlList\$entries, and $parts.
Referenced by ilLDAPServer\setUrl(), ILIAS\LDAP\Tests\Server\ServerUrlListTest\testFromStringEmptyYieldsEmptyList(), ILIAS\LDAP\Tests\Server\ServerUrlListTest\testFromStringHostWithoutSchemeStoredAsInvalid(), ILIAS\LDAP\Tests\Server\ServerUrlListTest\testFromStringInvalidPartStoredAsRawAndReportedInGetInvalidParts(), ILIAS\LDAP\Tests\Server\ServerUrlListTest\testFromStringLdapsPreserved(), ILIAS\LDAP\Tests\Server\ServerUrlListTest\testFromStringMixedValidAndInvalid(), ILIAS\LDAP\Tests\Server\ServerUrlListTest\testFromStringMultipleValidUris(), ILIAS\LDAP\Tests\Server\ServerUrlListTest\testFromStringOnlyWhitespaceAndCommasYieldsEmptyList(), ILIAS\LDAP\Tests\Server\ServerUrlListTest\testFromStringSingleValidUri(), ILIAS\LDAP\Tests\Server\ServerUrlListTest\testFromStringSkipsEmptyPartsAfterTrim(), ILIAS\LDAP\Tests\Server\ServerUrlListTest\testGetConnectionStringAtIndexNegativeIndexReturnsEmptyString(), ILIAS\LDAP\Tests\Server\ServerUrlListTest\testGetConnectionStringAtIndexOutOfRangePositiveReturnsEmptyString(), ILIAS\LDAP\Tests\Server\ServerUrlListTest\testGetConnectionStringAtIndexReturnsRawStringForInvalidEntry(), ILIAS\LDAP\Tests\Server\ServerUrlListTest\testRotateEmptyListReturnsSameInstance(), ILIAS\LDAP\Tests\Server\ServerUrlListTest\testRotateWithOneEntryReturnsSameInstance(), ILIAS\LDAP\Tests\Server\ServerUrlListTest\testRotateWithTwoEntriesMovesFirstToEnd(), ILIAS\LDAP\Tests\Server\ServerUrlListTest\testToStringDelegatesToMagicToString(), ILIAS\LDAP\Tests\Server\ServerUrlListTest\testValidUrlsSkipsInvalidParts(), ILIAS\LDAP\Tests\Server\ServerUrlListTest\testValidUrlsYieldsNothingWhenAllInvalid(), ILIAS\LDAP\Tests\Server\ServerUrlListTest\testValidUrlsYieldsOnlyUriInstances(), ILIAS\LDAP\Tests\Server\ServerUrlListTest\testValidUrlsYieldsOriginalIndicesWithPrimaryAtCorrectWithMixedValidAndInvalid(), ILIAS\LDAP\Tests\Server\ServerUrlListTest\testWithPrimaryAtNegativeIndexReturnsSameInstance(), ILIAS\LDAP\Tests\Server\ServerUrlListTest\testWithPrimaryAtOneMovesSecondToFirst(), ILIAS\LDAP\Tests\Server\ServerUrlListTest\testWithPrimaryAtOutOfRangeReturnsSameInstance(), and ILIAS\LDAP\Tests\Server\ServerUrlListTest\testWithPrimaryAtZeroReturnsSameOrder().
Here is the caller graph for this function:| ILIAS\LDAP\Server\ServerUrlList::getConnectionStringAtIndex | ( | int | $index | ) |
Connection string for ldap_connect() at the given index (0 = primary).
Returns empty string if index is out of range or negative.
Definition at line 85 of file ServerUrlList.php.
| ILIAS\LDAP\Server\ServerUrlList::getInvalidParts | ( | ) |
Entries that could not be parsed as URI (for GUI validation messages).
Definition at line 119 of file ServerUrlList.php.
| ILIAS\LDAP\Server\ServerUrlList::rotate | ( | ) |
New list with first entry moved to the end (for persisted fallback rotation).
Returns this instance unchanged if the list has fewer than two entries.
Definition at line 135 of file ServerUrlList.php.
References ILIAS\LDAP\Server\ServerUrlList\count().
Here is the call graph for this function:| ILIAS\LDAP\Server\ServerUrlList::toString | ( | ) |
Convert to stored form (comma-separated string for database and form).
Definition at line 99 of file ServerUrlList.php.
Referenced by ILIAS\LDAP\Server\ServerUrlList\__toString().
Here is the caller graph for this function:| ILIAS\LDAP\Server\ServerUrlList::validUrls | ( | ) |
Iterate over valid URL entries only (invalid/raw string entries are skipped).
Yields index => URI so that withPrimaryAt(index) correctly moves the connected server to primary.
Definition at line 174 of file ServerUrlList.php.
| ILIAS\LDAP\Server\ServerUrlList::withPrimaryAt | ( | int | $index | ) |
New list with the entry at $index moved to primary (index 0).
Returns this instance unchanged if index is out of range or negative.
Definition at line 153 of file ServerUrlList.php.
|
private |
Definition at line 33 of file ServerUrlList.php.
Referenced by ILIAS\LDAP\Server\ServerUrlList\__construct(), and ILIAS\LDAP\Server\ServerUrlList\fromString().