mirror of
https://github.com/codeigniter4/CodeIgniter4.git
synced 2025-02-20 11:44:28 +08:00
Move the filters into CI namespace
This commit is contained in:
parent
9dc19c3d55
commit
778a26aba5
@ -7,9 +7,9 @@ class Filters extends BaseConfig
|
||||
// Makes reading things below nicer,
|
||||
// and simpler to change out script that's used.
|
||||
public $aliases = [
|
||||
'csrf' => \App\Filters\CSRF::class,
|
||||
'toolbar' => \App\Filters\DebugToolbar::class,
|
||||
'honeypot' => \App\Filters\Honeypot::class,
|
||||
'csrf' => \CodeIgniter\Filters\CSRF::class,
|
||||
'toolbar' => \CodeIgniter\Filters\DebugToolbar::class,
|
||||
'honeypot' => \CodeIgniter\Filters\Honeypot::class,
|
||||
];
|
||||
|
||||
// Always applied before every request
|
||||
|
@ -1,4 +1,4 @@
|
||||
<?php namespace App\Filters;
|
||||
<?php namespace CodeIgniter\Filters;
|
||||
|
||||
use CodeIgniter\Filters\FilterInterface;
|
||||
use CodeIgniter\HTTP\RequestInterface;
|
@ -1,4 +1,4 @@
|
||||
<?php namespace App\Filters;
|
||||
<?php namespace CodeIgniter\Filters;
|
||||
|
||||
use CodeIgniter\Filters\FilterInterface;
|
||||
use CodeIgniter\HTTP\RequestInterface;
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filters;
|
||||
namespace CodeIgniter\Filters;
|
||||
|
||||
use CodeIgniter\Filters\FilterInterface;
|
||||
use CodeIgniter\HTTP\RequestInterface;
|
@ -209,8 +209,8 @@ class FileLocatorTest extends \CIUnitTestCase
|
||||
{
|
||||
$files = $this->locator->listFiles('Filters/');
|
||||
|
||||
$expectedWin = APPPATH . 'Filters\DebugToolbar.php';
|
||||
$expectedLin = APPPATH . 'Filters/DebugToolbar.php';
|
||||
$expectedWin = SYSTEMPATH . 'Filters\DebugToolbar.php';
|
||||
$expectedLin = SYSTEMPATH . 'Filters/DebugToolbar.php';
|
||||
$this->assertTrue(in_array($expectedWin, $files) || in_array($expectedLin, $files));
|
||||
|
||||
$expectedWin = SYSTEMPATH . 'Filters\Filters.php';
|
||||
|
@ -28,7 +28,9 @@ from the ``$globals`` array, like...::
|
||||
]
|
||||
];
|
||||
|
||||
A sample Honeypot filter is bundled, as ``app/Filters/Honeypot.php``.
|
||||
A sample Honeypot filter is bundled, as ``system/Filters/Honeypot.php``.
|
||||
If it is not suitable, make your own at ``app/Filters/Honeypot.php``,
|
||||
and modify the ``$aliases`` in the configuration appropriately.
|
||||
|
||||
Customizing Honeypot
|
||||
=====================
|
||||
|
@ -28,6 +28,7 @@ and enabling the `csrf` filter globally::
|
||||
|
||||
public $globals = [
|
||||
'before' => [
|
||||
//'honeypot'
|
||||
'csrf'
|
||||
]
|
||||
];
|
||||
|
Loading…
x
Reference in New Issue
Block a user