@@ -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,26 +1,26 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -Container::bind("teste", function () { |
|
| 3 | +Container::bind("teste", function() { |
|
| 4 | 4 | return "Comece o desenvolvimento!!"; |
| 5 | 5 | }); |
| 6 | 6 | |
| 7 | -Router::notFound(function ($req, $res) { |
|
| 7 | +Router::notFound(function($req, $res) { |
|
| 8 | 8 | $res->setStatusCode(404); |
| 9 | 9 | return die("Route not found insert in router!!"); |
| 10 | 10 | }); |
| 11 | 11 | |
| 12 | -Router::get('/', function ($req, $res) { |
|
| 12 | +Router::get('/', function($req, $res) { |
|
| 13 | 13 | $message = Container::get('teste')(); |
| 14 | 14 | $res->render('index.html', [ |
| 15 | 15 | 'message' => $message, |
| 16 | 16 | ]); |
| 17 | 17 | }); |
| 18 | 18 | |
| 19 | -Router::get('/form', function ($req, $res) { |
|
| 19 | +Router::get('/form', function($req, $res) { |
|
| 20 | 20 | return $res->render('csrf.html'); |
| 21 | 21 | }); |
| 22 | 22 | |
| 23 | -Router::post('/form', function ($req, $res) { |
|
| 23 | +Router::post('/form', function($req, $res) { |
|
| 24 | 24 | return Router::csrf_token_verify($req->post('token')) |
| 25 | 25 | ? 'verdadeiro' : 'falso'; |
| 26 | 26 | }); |