File tree Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -124,3 +124,10 @@ TestSuite
124
124
125
125
- ``assertRedirectBack() `` added to assert a successful redirect has been made to the same previous URL.
126
126
- ``assertRedirectBackToReferer() `` added to assert a successful redirect has been made to the referer URL.
127
+
128
+ Utility
129
+ -------
130
+
131
+ - ``Text::uuid() `` now supports configurable UUID generation. You can set a custom
132
+ UUID generator using ``Configure::write('Text.uuidGenerator', $closure) `` to
133
+ integrate your own UUID generation strategy or third-party libraries.
Original file line number Diff line number Diff line change @@ -97,6 +97,24 @@ UUID is a 128-bit string in the format of
97
97
98
98
Text::uuid(); // 485fc381-e790-47a3-9794-1337c0a8fe68
99
99
100
+ .. versionadded :: 5.3.0
101
+ You can now configure a custom UUID generator using dependency injection.
102
+
103
+ Starting from CakePHP 5.3.0, you can configure a custom UUID generator by
104
+ setting a closure in your configuration::
105
+
106
+ // In your config/app.php or config/bootstrap.php
107
+ use Cake\Core\Configure;
108
+
109
+ Configure::write('Text.uuidGenerator', function () {
110
+ // Return your custom UUID string
111
+ return \MyUuidLibrary::generate();
112
+ });
113
+
114
+ This allows you to integrate your own UUID generation strategy or use
115
+ third-party UUID libraries. When a custom generator is configured, it will
116
+ be used instead of the default UUID generation method.
117
+
100
118
Simple String Parsing
101
119
=====================
102
120
You can’t perform that action at this time.
0 commit comments