Task #69050
closedSupply a Utility method to create unique ids in the core
0%
Description
Currently there are about hundred places in core where unique ids are created using different code:
On windows and in cygwin environments uniqid() has a resolution of one second which results in identical ids if uniqid('Foo');
or uniqid('Foo', TRUE);
is called.
We need a utility method that creates unique ids even if called multiple times a second. its ids must not contain .
(dots) (added by the , TRUE)
) so they are valid in JavaScript context too. In some contexts the ids must start with a letter to be valid.
Files
Updated by Stephan Großberndt over 9 years ago
Updated by Roman Eberle 3 months ago on #59701:
i think a better solution would be to create something like
...\GeneralUtility\UniqueId()
which unifies the generation of unique ids, and replace all calls to uniqid() with calls to that function.
this might be done with a smart shell-script (grep/sed), should fix pretty much all uniqid()-related errors, and allows easy modification for possible future changes to unique-id-generation.
note that I encountered typo3-exceptions related to PATTERN_ENTRYIDENTIFIER in sysext/core/Classes/Cache/Frontend/FrontendInterface.php with TYPO3 6.2.12, these don't seem to be covered by the above commits/patches.
Updated by Stephan Großberndt over 9 years ago
if used as uids for records (e.g. in typo3/sysext/core/Tests/Functional/DataHandling/Framework/ActionService.php) there is a limit of currently 30 chars imposed by the NEWid field in sys_log
Updated by Mathias Brodala about 9 years ago
- Status changed from New to Resolved
- Assignee set to Nicole Cordes
- Sprint Focus set to On Location Sprint
This was fixed with #69730.
Updated by Anja Leichsenring almost 9 years ago
- Sprint Focus deleted (
On Location Sprint)
Updated by Riccardo De Contardi about 7 years ago
- Status changed from Resolved to Closed