-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
113 additions
and
104 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,49 +19,35 @@ | |
*/ | ||
namespace oat\tao\model\routing; | ||
|
||
use FrontController; | ||
use HttpRequest; | ||
use Context; | ||
use InterruptedActionException; | ||
use common_ext_ExtensionsManager; | ||
use common_http_Request; | ||
use Psr\Http\Message\ResponseInterface; | ||
use Psr\Http\Message\ServerRequestInterface; | ||
|
||
/** | ||
* A simple controller to replace the ClearFw controller | ||
* | ||
* @author Joel Bout, <[email protected]> | ||
*/ | ||
class TaoFrontController implements FrontController | ||
class TaoFrontController | ||
{ | ||
/** | ||
* @var common_http_Request | ||
*/ | ||
private $httpRequest; | ||
|
||
/** | ||
* | ||
* @param HttpRequest $pRequest | ||
*/ | ||
public function __construct( HttpRequest $pRequest ) { | ||
// ignore deprecated request class | ||
$this->httpRequest = common_http_Request::currentRequest(); | ||
} | ||
|
||
/** | ||
* Returns the request to be executed | ||
* | ||
* @return common_http_Request | ||
*/ | ||
protected function getRequest() { | ||
return $this->httpRequest; | ||
|
||
public function __invoke(ServerRequestInterface $request, ResponseInterface $response) { | ||
$request->getUri(); | ||
$pRequest = \common_http_Request::currentRequest(); | ||
$this->legacy($pRequest, $response); | ||
} | ||
|
||
/** | ||
* (non-PHPdoc) | ||
* @see FrontController::loadModule() | ||
* Run the controller | ||
* | ||
* @param common_http_Request $pRequest | ||
* @param ResponseInterface $response | ||
*/ | ||
public function loadModule() { | ||
$resolver = new Resolver($this->getRequest()); | ||
public function legacy(common_http_Request $pRequest) { | ||
$resolver = new Resolver($pRequest); | ||
|
||
// load the responsible extension | ||
$ext = common_ext_ExtensionsManager::singleton()->getExtensionById($resolver->getExtensionId()); | ||
|
@@ -89,7 +75,7 @@ public function loadModule() { | |
|
||
try | ||
{ | ||
$enforcer = new ActionEnforcer($resolver->getExtensionId(), $resolver->getControllerClass(), $resolver->getMethodName(), $this->getRequest()->getParams()); | ||
$enforcer = new ActionEnforcer($resolver->getExtensionId(), $resolver->getControllerClass(), $resolver->getMethodName(), $pRequest->getParams()); | ||
$enforcer->execute(); | ||
} | ||
catch (InterruptedActionException $iE) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.