|
ILIAS
trunk Revision v13.0_alpha-62-g3b72d83f2e5
|
The rules every storage key has to follow. More...
Collaboration diagram for ILIAS\KeyValueStorage\Internal\KeyRules:Public Member Functions | |
| check (string $key) | |
Data Fields | |
| const int | MAX_LENGTH = 255 |
| const string | SEPARATOR = ':' |
Private Attributes | |
| const string | FORBIDDEN_PATTERN = '/[\x00-\x1F\x7F' . self::SEPARATOR . ']/' |
The rules every storage key has to follow.
Keys are deliberately permissive: they are handed in by consumers, often derived from class names or object ids, and this component is not a PSR-16 cache that would have to keep its keys interchangeable with one.
Only what would break a storage is rejected: the colon, which separates namespace from key when a repository has to compose both into one identifier, and control characters, which cannot be stored or compared reliably.
Definition at line 36 of file KeyRules.php.
| ILIAS\KeyValueStorage\Internal\KeyRules::check | ( | string | $key | ) |
Definition at line 44 of file KeyRules.php.
|
private |
Definition at line 42 of file KeyRules.php.
| const int ILIAS\KeyValueStorage\Internal\KeyRules::MAX_LENGTH = 255 |
Definition at line 38 of file KeyRules.php.
Referenced by ILIAS\Tests\KeyValueStorage\Internal\KeyRulesTest\invalidKeys(), ILIAS\Tests\KeyValueStorage\Internal\KeyRulesTest\testLengthIsCountedInCharactersNotBytes(), ILIAS\Tests\KeyValueStorage\Setup\DBUpdateStepsTest\testTheColumnsAreWideEnoughForWhatTheValidationAllows(), ILIAS\Tests\KeyValueStorage\Internal\DatabaseRepositoryTest\testWriteRejectsAKeyLongerThanTheColumn(), ILIAS\Tests\KeyValueStorage\Internal\KeyRulesTest\validKeys(), and ILIAS\KeyValueStorage\Internal\DatabaseRepository\writeRow().
| const string ILIAS\KeyValueStorage\Internal\KeyRules::SEPARATOR = ':' |
Definition at line 40 of file KeyRules.php.
Referenced by ILIAS\KeyValueStorage\Internal\StorageNamespace\__construct(), ILIAS\KeyValueStorage\Internal\StorageServices\purgeSubject(), ILIAS\KeyValueStorage\Internal\StorageServices\store(), and ILIAS\KeyValueStorage\Internal\StorageServices\subjectScope().