@@ -7,7 +7,7 @@ |
||
7 | 7 | * @author PaulaoDev <[email protected]> |
8 | 8 | */ |
9 | 9 | |
10 | -$url = urldecode(parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH)); |
|
10 | +$url = urldecode(parse_url($_SERVER[ 'REQUEST_URI' ], PHP_URL_PATH)); |
|
11 | 11 | if ($url !== '/' && file_exists(__DIR__ . '/public' . $url)) { |
12 | 12 | return false; |
13 | 13 | } |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | const logout = "../login"; |
12 | 12 | |
13 | 13 | // Ignore key init session |
14 | - const ignoreSession = ["password"]; |
|
14 | + const ignoreSession = [ "password" ]; |
|
15 | 15 | |
16 | 16 | const login = [ |
17 | 17 | // fields POST and COLUMNS |
@@ -23,12 +23,12 @@ discard block |
||
23 | 23 | "email", "password", "name", "icone" |
24 | 24 | ]; |
25 | 25 | |
26 | - public static function extendsRegister($data){ |
|
26 | + public static function extendsRegister($data) { |
|
27 | 27 | // event |
28 | 28 | return $data; |
29 | 29 | } |
30 | 30 | |
31 | - public static function extendsValidate($data){ |
|
31 | + public static function extendsValidate($data) { |
|
32 | 32 | // event |
33 | 33 | return $data; |
34 | 34 | } |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | const logout = "../login"; |
12 | 12 | |
13 | 13 | // Ignore key init session |
14 | - const ignoreSession = ["password"]; |
|
14 | + const ignoreSession = [ "password" ]; |
|
15 | 15 | |
16 | 16 | const login = [ |
17 | 17 | // fields POST and COLUMNS |
@@ -23,13 +23,13 @@ discard block |
||
23 | 23 | "email", "password", "name", "icone" |
24 | 24 | ]; |
25 | 25 | |
26 | - public static function extendsRegister($data){ |
|
27 | - $data["password"] = md5($data["password"]); |
|
26 | + public static function extendsRegister($data) { |
|
27 | + $data[ "password" ] = md5($data[ "password" ]); |
|
28 | 28 | return $data; |
29 | 29 | } |
30 | 30 | |
31 | - public static function extendsValidate($data){ |
|
32 | - $data["password"] = md5($data["password"]); |
|
31 | + public static function extendsValidate($data) { |
|
32 | + $data[ "password" ] = md5($data[ "password" ]); |
|
33 | 33 | return $data; |
34 | 34 | } |
35 | 35 |
@@ -1,15 +1,15 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | - /* Config Khan Framework */ |
|
3 | + /* Config Khan Framework */ |
|
4 | 4 | |
5 | - return [ |
|
5 | + return [ |
|
6 | 6 | |
7 | - "timezone" => "America/Brasilia", |
|
7 | + "timezone" => "America/Brasilia", |
|
8 | 8 | |
9 | - /* Config Strategy Hash */ |
|
9 | + /* Config Strategy Hash */ |
|
10 | 10 | |
11 | - "strategy" => [ |
|
12 | - "hash" => "password_hash" |
|
13 | - ] |
|
11 | + "strategy" => [ |
|
12 | + "hash" => "password_hash" |
|
13 | + ] |
|
14 | 14 | |
15 | - ]; |
|
15 | + ]; |
@@ -2,27 +2,27 @@ |
||
2 | 2 | |
3 | 3 | use \App\Khan\Component\Router\Router; |
4 | 4 | |
5 | -Container::bind("teste", function () { |
|
5 | +Container::bind("teste", function() { |
|
6 | 6 | return "Init development!!"; |
7 | 7 | }); |
8 | 8 | |
9 | -Router\notFound(function ($req, $res) { |
|
9 | +Router\notFound(function($req, $res) { |
|
10 | 10 | $res->setStatusCode(404); |
11 | 11 | return die("Route not found insert in router!!"); |
12 | 12 | }); |
13 | 13 | |
14 | -Router\get('/', function ($req, $res) { |
|
14 | +Router\get('/', function($req, $res) { |
|
15 | 15 | $message = Container::get('teste')(); |
16 | 16 | $res->render('index.html', [ |
17 | 17 | 'message' => $message, |
18 | 18 | ]); |
19 | 19 | }); |
20 | 20 | |
21 | -Router\get('/form', function ($req, $res) { |
|
21 | +Router\get('/form', function($req, $res) { |
|
22 | 22 | return $res->render('csrf.html'); |
23 | 23 | }); |
24 | 24 | |
25 | -Router\post('/form', function ($req, $res) { |
|
25 | +Router\post('/form', function($req, $res) { |
|
26 | 26 | return Router\Router::csrf_token_verify($req->post('token')) |
27 | 27 | ? 'verdadeiro' : 'falso'; |
28 | 28 | }); |