Skip to content

Commit 778a26a

Browse files
committed
Move the filters into CI namespace
1 parent 9dc19c3 commit 778a26a

7 files changed

Lines changed: 12 additions & 9 deletions

File tree

app/Config/Filters.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ class Filters extends BaseConfig
77
// Makes reading things below nicer,
88
// and simpler to change out script that's used.
99
public $aliases = [
10-
'csrf' => \App\Filters\CSRF::class,
11-
'toolbar' => \App\Filters\DebugToolbar::class,
12-
'honeypot' => \App\Filters\Honeypot::class,
10+
'csrf' => \CodeIgniter\Filters\CSRF::class,
11+
'toolbar' => \CodeIgniter\Filters\DebugToolbar::class,
12+
'honeypot' => \CodeIgniter\Filters\Honeypot::class,
1313
];
1414

1515
// Always applied before every request
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?php namespace App\Filters;
1+
<?php namespace CodeIgniter\Filters;
22

33
use CodeIgniter\Filters\FilterInterface;
44
use CodeIgniter\HTTP\RequestInterface;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?php namespace App\Filters;
1+
<?php namespace CodeIgniter\Filters;
22

33
use CodeIgniter\Filters\FilterInterface;
44
use CodeIgniter\HTTP\RequestInterface;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace App\Filters;
3+
namespace CodeIgniter\Filters;
44

55
use CodeIgniter\Filters\FilterInterface;
66
use CodeIgniter\HTTP\RequestInterface;

tests/system/Autoloader/FileLocatorTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,8 +209,8 @@ public function testListFilesFromMultipleDir()
209209
{
210210
$files = $this->locator->listFiles('Filters/');
211211

212-
$expectedWin = APPPATH . 'Filters\DebugToolbar.php';
213-
$expectedLin = APPPATH . 'Filters/DebugToolbar.php';
212+
$expectedWin = SYSTEMPATH . 'Filters\DebugToolbar.php';
213+
$expectedLin = SYSTEMPATH . 'Filters/DebugToolbar.php';
214214
$this->assertTrue(in_array($expectedWin, $files) || in_array($expectedLin, $files));
215215

216216
$expectedWin = SYSTEMPATH . 'Filters\Filters.php';

user_guide_src/source/libraries/honeypot.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ from the ``$globals`` array, like...::
2828
]
2929
];
3030

31-
A sample Honeypot filter is bundled, as ``app/Filters/Honeypot.php``.
31+
A sample Honeypot filter is bundled, as ``system/Filters/Honeypot.php``.
32+
If it is not suitable, make your own at ``app/Filters/Honeypot.php``,
33+
and modify the ``$aliases`` in the configuration appropriately.
3234

3335
Customizing Honeypot
3436
=====================

user_guide_src/source/libraries/security.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ and enabling the `csrf` filter globally::
2828

2929
public $globals = [
3030
'before' => [
31+
//'honeypot'
3132
'csrf'
3233
]
3334
];

0 commit comments

Comments
 (0)