Moved AbstractController to Bootstrap
This commit is contained in:
parent
b6f6f22951
commit
041b8eedbe
8 changed files with 12 additions and 23 deletions
|
@ -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;
|
||||||
|
|
|
@ -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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,5 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
class AuthController extends AbstractController
|
class AuthController
|
||||||
{
|
{
|
||||||
private static function hashPassword($pass, $salt2)
|
private static function hashPassword($pass, $salt2)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
class CommentController extends AbstractController
|
class CommentController
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @route /comments
|
* @route /comments
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
class IndexController extends AbstractController
|
class IndexController
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @route /
|
* @route /
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
class PostController extends AbstractController
|
class PostController
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @route /posts
|
* @route /posts
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
class TagController extends AbstractController
|
class TagController
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @route /tags
|
* @route /tags
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
class UserController extends AbstractController
|
class UserController
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @route /users
|
* @route /users
|
||||||
|
|
Loading…
Reference in a new issue