Skip to content

Commit

Permalink
update v1.0.6
Browse files Browse the repository at this point in the history
  • Loading branch information
sujitprasad12 committed Feb 16, 2016
1 parent e6b579d commit 073a49a
Show file tree
Hide file tree
Showing 587 changed files with 21,011 additions and 22,290 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ APP_ENV=local
APP_DEBUG=true
APP_KEY=SomeRandomString
DB_HOST=localhost
DB_DATABASE=fav222222
DB_DATABASE=faveo1.0.6
DB_USERNAME=root
DB_PASSWORD=
CACHE_DRIVER=file
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<h3>About Faveo</h3>
<br><img src="https://travis-ci.org/ladybirdweb/faveo-helpdesk.svg?branch=master">&nbsp;<img src="https://img.shields.io/badge/License-OSL-blue.svg">&nbsp;<a href="https://gitter.im/ladybirdweb/faveo-helpdesk" target="_blank"><img src="https://badges.gitter.im/ladybirdweb/faveo-helpdesk.svg"></a></br>
<br><img src="https://travis-ci.org/ladybirdweb/faveo-helpdesk.svg?branch=master">&nbsp;<img src="https://img.shields.io/badge/License-OSL-blue.svg"></br>
<p>Headquartered in Bangalore, Faveo HELPDESK provides Businesses with an automated Helpdesk system to manage customer support.
<br/><br/>
The word Faveo comes from Latin which means to be favourable. Which truly highlights vision and the scope as well as the functionality of the product that Faveo is. It is specifically designed to cater the needs of startups and SME’s empowering them with state of art, ticket based support system. In today’s competitive startup scenario customer retention is one of the major challenges. Handling client query diligently is all the difference between retaining or losing a long lasting relationship. The company is driven with passion of providing tools for managing consumer queries for strategic insights and helping companies take those decisive decisions.
Expand Down
140 changes: 69 additions & 71 deletions app/Exceptions/Handler.php
Original file line number Diff line number Diff line change
@@ -1,95 +1,93 @@
<?php namespace App\Exceptions;
<?php

namespace App\Exceptions;

use Exception;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;

// use App\Http\Controllers\Common\SettingsController;
//use App\Model\helpdesk\Email\Smtp;

class Handler extends ExceptionHandler {

/**
* A list of the exception types that should not be reported.
*
* @var array
*/
protected $dontReport = [
'Symfony\Component\HttpKernel\Exception\HttpException'
];

/**
* Create a new controller instance.
* @return type response
*/
// public function __construct() {
// SettingsController::smtp();
// }

/**
* Report or log an exception.
*
* This is a great spot to send exceptions to Sentry, Bugsnag, etc.
*
* @param \Exception $e
* @return void
*/
public function report(Exception $e)
{
return parent::report($e);
}

/**
* Render an exception into an HTTP response.
*
* @param \Illuminate\Http\Request $request
* @param \Exception $e
* @return \Illuminate\Http\Response
*/
public function render($request, Exception $e)
{
if(config('app.debug') == false) {
if ($this->isHttpException($e) && $e->getStatusCode() == 404) {
return response()->view('errors.404', []);
} else {
if(\Config::get('database.install') == 1) {
// if(\Config::get('app.ErrorLog') == '%1%') {
// \App\Http\Controllers\Common\SettingsController::smtp();
// \Mail::send('errors.report', array('e' => $e), function ($message) {
// $message->to('', '')->subject('Faveo HELPDESK Pro ERROR');
// });
// }
}
return response()->view('errors.500', []);
}
}
return parent::render($request, $e);

if ($this->isHttpException($e))
{
/**
* A list of the exception types that should not be reported.
*
* @var array
*/
protected $dontReport = [
'Symfony\Component\HttpKernel\Exception\HttpException'
];

/**
* Create a new controller instance.
* @return type response
*/
// public function __construct() {
// SettingsController::smtp();
// }

/**
* Report or log an exception.
*
* This is a great spot to send exceptions to Sentry, Bugsnag, etc.
*
* @param \Exception $e
* @return void
*/
public function report(Exception $e) {
return parent::report($e);
}

/**
* Render an exception into an HTTP response.
*
* @param \Illuminate\Http\Request $request
* @param \Exception $e
* @return \Illuminate\Http\Response
*/
public function render($request, Exception $e) {

if ($e instanceof \Tymon\JWTAuth\Exceptions\TokenExpiredException) {
return response()->json(['message' => $e->getMessage(), 'code' => $e->getStatusCode()]);
//dd($e);
} else if ($e instanceof \Tymon\JWTAuth\Exceptions\TokenInvalidException) {
return response()->json(['message' => $e->getMessage(), 'code' => $e->getStatusCode()]);
}

// if (config('app.debug') == false) {
// if ($this->isHttpException($e) && $e->getStatusCode() == 404) {
// return response()->view('errors.404', []);
// } else {
// if (\Config::get('database.install') == 1) {
// // if(\Config::get('app.ErrorLog') == '%1%') {
// // \App\Http\Controllers\Common\SettingsController::smtp();
// // $this->PhpMailController->sendmail($from = $this->PhpMailController->mailfrom('1', '0'), $to = ['name' => '', 'email' => ''], $message = ['subject' => '', 'scenario'=>'error-report'], $template_variables = ['e' =>$e ]);
// // }
// }
// return response()->view('errors.500', []);
// }
// }
// return parent::render($request, $e);

if ($this->isHttpException($e)) {
return $this->renderHttpException($e);
}

if (config('app.debug'))
{
if (config('app.debug')) {
return $this->renderExceptionWithWhoops($e);
}

return parent::render($request, $e);

}


}

protected function renderExceptionWithWhoops(Exception $e)
{
protected function renderExceptionWithWhoops(Exception $e) {
$whoops = new \Whoops\Run;
$whoops->pushHandler(new \Whoops\Handler\PrettyPageHandler());

return new \Illuminate\Http\Response(
$whoops->handleException($e),
$e->getStatusCode(),
$e->getHeaders()
$whoops->handleException($e), $e->getStatusCode(), $e->getHeaders()
);
}


}
Loading

0 comments on commit 073a49a

Please sign in to comment.