Skip to content

Commit

Permalink
Merge pull request #53 from Uxie-Framework/changing-to-single-repo
Browse files Browse the repository at this point in the history
Changing implementation a single repo
  • Loading branch information
M.Amine Cheribet authored Mar 16, 2018
2 parents 75d7b35 + 15391ad commit e55dc2a
Show file tree
Hide file tree
Showing 8 changed files with 74 additions and 291 deletions.
8 changes: 8 additions & 0 deletions App/App.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
<?php

/**
* Created Services that are critical to our application.
*
*/

container()->bind('Router', function() {
return new Router\Router(rootDir().'/App/Routes.php');
});

container()->bind('Request', function() {
return new Request\Request();
});
container()->bind('Compiler', function() {
return new Kernel\Compiler\Compiler();
});
Expand Down
4 changes: 2 additions & 2 deletions App/Middlewares/Csrf.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ class Csrf

public function __construct()
{
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$this->token = $_POST['_token'] ?? null;
if (container()->Request->getMethod() !== 'GET') {
$this->token = container()->Request->_token ?? null;
$this->validateToken();
}
}
Expand Down
8 changes: 8 additions & 0 deletions App/MiddlewaresLocator.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
<?php

/**
* Define Middlewares Locations
* This middlewares short names are the ones that should be used
* When calling a middleware on a route
*
*/

return [
'statistics' => \Middleware\Statistics::class,
'csrf' => \Middleware\Csrf::class,
];
6 changes: 6 additions & 0 deletions App/Services.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
<?php

/**
* Define services aliases and service providers
* that will be loaded On application start.
*
*/

return [

'ServiceLocators' => [
Expand Down
2 changes: 1 addition & 1 deletion Box
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

require_once '../Framework/vendor/autoload.php';
require_once 'vendor/autoload.php';

error_reporting(0);

Expand Down
11 changes: 2 additions & 9 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,9 @@
"license": "MIT",

"require": {
"php": ">=7.2",
"uxie/router": ">=0.6.3",
"uxie/model": ">=0.2",
"php": ">=7.1.6",
"uxie/framework": ">=0.0.3",
"uxie/statistics": ">=0.2",
"uxie/request-handler": ">=0.4.1",
"uxie/validator": ">=0.2",
"uxie/kernel": ">=0.2.3",
"uxie/authenticator": ">=0.2",
"uxie/box": ">=0.2.2",
"uxie/services": ">=0.1.5",
"vlucas/phpdotenv": ">=2.4",
"mohamed-amine/file-uploader": ">=1.1",
"mohamed-amine/ioc-container": ">=0.4",
Expand Down
Loading

0 comments on commit e55dc2a

Please sign in to comment.