Skip to content

Commit

Permalink
Move error into tsugi application.
Browse files Browse the repository at this point in the history
  • Loading branch information
csev committed Aug 21, 2017
1 parent f314350 commit ed36e4c
Showing 1 changed file with 0 additions and 19 deletions.
19 changes: 0 additions & 19 deletions src/Core/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,25 +16,6 @@ public function __construct($launch)
parent::__construct($launch);
$this['tsugi']->output->buffer = false;

$P7 = strpos(phpversion(), '7') === 0;
$P7 = true; // After backleveled to Twig 1.27

// Some controllers work in PHP 5
if ( !$P7 ) {
\Tsugi\Controllers\Login::routes($this);
\Tsugi\Controllers\Logout::routes($this);
\Koseu\Controllers\Courses::routes($this);
return false;
}

$this->error(function (NotFoundHttpException $e, Request $request, $code) {
global $CFG, $LAUNCH, $OUTPUT, $USER, $CONTEXT, $LINK, $RESULT;

return $this['twig']->render('@Tsugi/Error.twig',
array('error' => '<p>Page not found.</p>')
);
});

// Hook up the Koseu and Tsugi tools
\Tsugi\Controllers\Login::routes($this);
\Tsugi\Controllers\Logout::routes($this);
Expand Down

0 comments on commit ed36e4c

Please sign in to comment.