Moved AbstractController to Bootstrap

This commit is contained in:
Marcin Kurczewski 2013-10-05 21:24:20 +02:00
parent b6f6f22951
commit 041b8eedbe
8 changed files with 12 additions and 23 deletions

View file

@ -47,6 +47,12 @@ class Bootstrap
{ {
$workCallback(); $workCallback();
} }
catch (SimpleException $e)
{
$this->context->transport->errorMessage = rtrim($e->getMessage(), '.') . '.';
$this->context->transport->exception = $e;
$this->context->transport->success = false;
}
catch (Exception $e) catch (Exception $e)
{ {
$this->context->exception = $e; $this->context->exception = $e;

View file

@ -1,17 +0,0 @@
<?php
abstract class AbstractController
{
public function workWrapper($workCallback)
{
try
{
$workCallback();
}
catch (SimpleException $e)
{
$this->context->transport->errorMessage = rtrim($e->getMessage(), '.') . '.';
$this->context->transport->exception = $e;
$this->context->transport->success = false;
}
}
}

View file

@ -1,5 +1,5 @@
<?php <?php
class AuthController extends AbstractController class AuthController
{ {
private static function hashPassword($pass, $salt2) private static function hashPassword($pass, $salt2)
{ {

View file

@ -1,5 +1,5 @@
<?php <?php
class CommentController extends AbstractController class CommentController
{ {
/** /**
* @route /comments * @route /comments

View file

@ -1,5 +1,5 @@
<?php <?php
class IndexController extends AbstractController class IndexController
{ {
/** /**
* @route / * @route /

View file

@ -1,5 +1,5 @@
<?php <?php
class PostController extends AbstractController class PostController
{ {
/** /**
* @route /posts * @route /posts

View file

@ -1,5 +1,5 @@
<?php <?php
class TagController extends AbstractController class TagController
{ {
/** /**
* @route /tags * @route /tags

View file

@ -1,5 +1,5 @@
<?php <?php
class UserController extends AbstractController class UserController
{ {
/** /**
* @route /users * @route /users