You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 7a8cad9
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: docs/general/modules.md
+21-40Lines changed: 21 additions & 40 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -96,7 +96,6 @@ class Autoload extends AutoloadConfig
96
96
Many times, you will need to specify the full namespace to files you want to include, but CodeIgniter can be configured to make integrating modules into your applications simpler by automatically discovering many different file types, including:
97
97
98
98
-[Events](../extending/events.md)
99
-
-[Filters](../incoming/filters.md)
100
99
-[Registrars](configuration.md#registrars)
101
100
-[Route files](../incoming/routing.md)
102
101
-[Services](../concepts/services.md)
@@ -211,51 +210,33 @@ When working with modules, it can be a problem if the routes in the application
211
210
212
211
### Filters
213
212
214
-
!!! danger "Deprecated since version 4.4.2"
213
+
Modules register their [filters](../incoming/filters.md) through a [Registrar](configuration.md#registrars), like the following:
215
214
216
-
!!! note "Note"
217
-
This feature is deprecated. Use [Registrars](configuration.md#registrars) instead, like the following:
218
-
219
-
```php
220
-
<?php
215
+
```php
216
+
<?php
221
217
222
-
namespace CodeIgniter\Shield\Config;
218
+
namespace CodeIgniter\Shield\Config;
223
219
224
-
use CodeIgniter\Shield\Filters\SessionAuth;
225
-
use CodeIgniter\Shield\Filters\TokenAuth;
220
+
use CodeIgniter\Shield\Filters\SessionAuth;
221
+
use CodeIgniter\Shield\Filters\TokenAuth;
226
222
227
-
class Registrar
223
+
class Registrar
224
+
{
225
+
/**
226
+
* Registers the Shield filters.
227
+
*
228
+
* @return array<string,array<string,string>>
229
+
*/
230
+
public static function Filters(): array
228
231
{
229
-
/**
230
-
* Registers the Shield filters.
231
-
*
232
-
* @return array<string, array<string, string>>
233
-
*/
234
-
public static function Filters(): array
235
-
{
236
-
return [
237
-
'aliases' => [
238
-
'session' => SessionAuth::class,
239
-
'tokens' => TokenAuth::class,
240
-
],
241
-
];
242
-
}
232
+
return [
233
+
'aliases' => [
234
+
'session' => SessionAuth::class,
235
+
'tokens' => TokenAuth::class,
236
+
],
237
+
];
243
238
}
244
-
```
245
-
246
-
By default, [filters](../incoming/filters.md) are automatically scanned for within modules. This can be turned off in the **Modules** config file, described above.
247
-
248
-
!!! note "Note"
249
-
Since the files are being included into the current scope, the `$filters` instance is already defined for you. It will cause errors if you attempt to redefine that class.
250
-
251
-
In the module's **Config/Filters.php** file, you need to define the aliases of the filters you use:
Copy file name to clipboardExpand all lines: docs/installation/upgrade_480.md
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -169,6 +169,9 @@ The following files received significant changes (including deprecations or visu
169
169
-**app/Config/Mimes.php**
170
170
-`Config\Mimes::$mimes` added a new key `md` for Markdown files.
171
171
172
+
-**app/Config/Modules.php**
173
+
-`Config\Modules::$aliases` no longer lists `filters`, since the auto-discovery of Filters was removed.
174
+
172
175
-**app/Config/Routing.php**
173
176
-`Config\Routing::$placeholderSamples` was added to provide sample values for custom route placeholders so the `spark routes` command can resolve their filters.
0 commit comments