1
0
mirror of https://github.com/flarum/core.git synced 2025-10-13 16:05:05 +02:00

Queue support (#1773)

Implementation of clean queue handling, by default sync is used
This commit is contained in:
Daniël Klabbers
2019-08-19 21:44:06 +02:00
committed by GitHub
parent 689d767f82
commit a045f8bef9
6 changed files with 297 additions and 0 deletions

View File

@@ -0,0 +1,64 @@
<?php
/*
* This file is part of Flarum.
*
* (c) Toby Zerner <toby.zerner@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Flarum\Queue;
use Exception;
use Illuminate\Contracts\Debug\ExceptionHandler as ExceptionHandling;
use Psr\Log\LoggerInterface;
class ExceptionHandler implements ExceptionHandling
{
/**
* @var LoggerInterface
*/
private $logger;
public function __construct(LoggerInterface $logger)
{
$this->logger = $logger;
}
/**
* Report or log an exception.
*
* @param \Exception $e
* @return void
*/
public function report(Exception $e)
{
$this->logger->error((string) $e);
}
/**
* Render an exception into an HTTP response.
*
* @param \Illuminate\Http\Request $request
* @param \Exception $e
* @return \Symfony\Component\HttpFoundation\Response
*/
public function render($request, Exception $e)
{
// TODO: Implement render() method.
}
/**
* Render an exception to the console.
*
* @param \Symfony\Component\Console\Output\OutputInterface $output
* @param \Exception $e
* @return void
*/
public function renderForConsole($output, Exception $e)
{
// TODO: Implement renderForConsole() method.
}
}