Commit 466fda32 authored by Dominik Hebeler's avatar Dominik Hebeler

Update auf Laravel 5.3 durchgeführt

parent 41930894
APP_ENV=local APP_ENV=local
APP_KEY=
APP_DEBUG=true APP_DEBUG=true
APP_KEY=SomeRandomString APP_LOG_LEVEL=debug
APP_URL=http://localhost APP_URL=http://localhost
DB_CONNECTION=mysql DB_CONNECTION=mysql
...@@ -10,6 +11,7 @@ DB_DATABASE=homestead ...@@ -10,6 +11,7 @@ DB_DATABASE=homestead
DB_USERNAME=homestead DB_USERNAME=homestead
DB_PASSWORD=secret DB_PASSWORD=secret
BROADCAST_DRIVER=log
CACHE_DRIVER=file CACHE_DRIVER=file
SESSION_DRIVER=file SESSION_DRIVER=file
QUEUE_DRIVER=sync QUEUE_DRIVER=sync
...@@ -24,3 +26,7 @@ MAIL_PORT=2525 ...@@ -24,3 +26,7 @@ MAIL_PORT=2525
MAIL_USERNAME=null MAIL_USERNAME=null
MAIL_PASSWORD=null MAIL_PASSWORD=null
MAIL_ENCRYPTION=null MAIL_ENCRYPTION=null
PUSHER_APP_ID=
PUSHER_KEY=
PUSHER_SECRET=
/vendor
/node_modules /node_modules
/public/storage /public/storage
*.sh /vendor
/.idea
Homestead.json Homestead.json
Homestead.yaml
.env .env
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use Illuminate\Foundation\Inspiring;
class Inspire extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'inspire';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Display an inspiring quote';
/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
$this->comment(PHP_EOL.Inspiring::quote().PHP_EOL);
}
}
...@@ -25,7 +25,15 @@ class Kernel extends ConsoleKernel ...@@ -25,7 +25,15 @@ class Kernel extends ConsoleKernel
protected function schedule(Schedule $schedule) protected function schedule(Schedule $schedule)
{ {
$schedule->command('log:rotate')->everyTenMinutes(); $schedule->command('log:rotate')->everyTenMinutes();
// $schedule->command('inspire') }
// ->hourly();
/**
* Register the Closure based commands for the application.
*
* @return void
*/
protected function commands()
{
require base_path('routes/console.php');
} }
} }
<?php
namespace App\Events;
abstract class Event
{
//
}
...@@ -3,10 +3,7 @@ ...@@ -3,10 +3,7 @@
namespace App\Exceptions; namespace App\Exceptions;
use Exception; use Exception;
use Illuminate\Validation\ValidationException; use Illuminate\Auth\AuthenticationException;
use Illuminate\Auth\Access\AuthorizationException;
use Illuminate\Database\Eloquent\ModelNotFoundException;
use Symfony\Component\HttpKernel\Exception\HttpException;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler; use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
class Handler extends ExceptionHandler class Handler extends ExceptionHandler
...@@ -17,10 +14,12 @@ class Handler extends ExceptionHandler ...@@ -17,10 +14,12 @@ class Handler extends ExceptionHandler
* @var array * @var array
*/ */
protected $dontReport = [ protected $dontReport = [
AuthorizationException::class, \Illuminate\Auth\AuthenticationException::class,
HttpException::class, \Illuminate\Auth\Access\AuthorizationException::class,
ModelNotFoundException::class, \Symfony\Component\HttpKernel\Exception\HttpException::class,
ValidationException::class, \Illuminate\Database\Eloquent\ModelNotFoundException::class,
\Illuminate\Session\TokenMismatchException::class,
\Illuminate\Validation\ValidationException::class,
]; ];
/** /**
...@@ -28,23 +27,39 @@ class Handler extends ExceptionHandler ...@@ -28,23 +27,39 @@ class Handler extends ExceptionHandler
* *
* This is a great spot to send exceptions to Sentry, Bugsnag, etc. * This is a great spot to send exceptions to Sentry, Bugsnag, etc.
* *
* @param \Exception $e * @param \Exception $exception
* @return void * @return void
*/ */
public function report(Exception $e) public function report(Exception $exception)
{ {
parent::report($e); parent::report($exception);
} }
/** /**
* Render an exception into an HTTP response. * Render an exception into an HTTP response.
* *
* @param \Illuminate\Http\Request $request * @param \Illuminate\Http\Request $request
* @param \Exception $e * @param \Exception $exception
* @return \Illuminate\Http\Response * @return \Illuminate\Http\Response
*/ */
public function render($request, Exception $e) public function render($request, Exception $exception)
{ {
return parent::render($request, $e); return parent::render($request, $exception);
}
/**
* Convert an authentication exception into an unauthenticated response.
*
* @param \Illuminate\Http\Request $request
* @param \Illuminate\Auth\AuthenticationException $exception
* @return \Illuminate\Http\Response
*/
protected function unauthenticated($request, AuthenticationException $exception)
{
if ($request->expectsJson()) {
return response()->json(['error' => 'Unauthenticated.'], 401);
}
return redirect()->guest('login');
} }
} }
<?php
namespace App\Http\Controllers\Auth;
use App\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\SendsPasswordResetEmails;
class ForgotPasswordController extends Controller
{
/*
|--------------------------------------------------------------------------
| Password Reset Controller
|--------------------------------------------------------------------------
|
| This controller is responsible for handling password reset emails and
| includes a trait which assists in sending these notifications from
| your application to your users. Feel free to explore this trait.
|
*/
use SendsPasswordResetEmails;
/**
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{
$this->middleware('guest');
}
}
<?php
namespace App\Http\Controllers\Auth;
use App\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\AuthenticatesUsers;
class LoginController extends Controller
{
/*
|--------------------------------------------------------------------------
| Login Controller
|--------------------------------------------------------------------------
|
| This controller handles authenticating users for the application and
| redirecting them to your home screen. The controller uses a trait
| to conveniently provide its functionality to your applications.
|
*/
use AuthenticatesUsers;
/**
* Where to redirect users after login.
*
* @var string
*/
protected $redirectTo = '/home';
/**
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{
$this->middleware('guest', ['except' => 'logout']);
}
}
...@@ -5,39 +5,38 @@ namespace App\Http\Controllers\Auth; ...@@ -5,39 +5,38 @@ namespace App\Http\Controllers\Auth;
use App\User; use App\User;
use Validator; use Validator;
use App\Http\Controllers\Controller; use App\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\ThrottlesLogins; use Illuminate\Foundation\Auth\RegistersUsers;
use Illuminate\Foundation\Auth\AuthenticatesAndRegistersUsers;
class AuthController extends Controller class RegisterController extends Controller
{ {
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Registration & Login Controller | Register Controller
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| |
| This controller handles the registration of new users, as well as the | This controller handles the registration of new users as well as their
| authentication of existing users. By default, this controller uses | validation and creation. By default this controller uses a trait to
| a simple trait to add these behaviors. Why don't you explore it? | provide this functionality without requiring any additional code.
| |
*/ */
use AuthenticatesAndRegistersUsers, ThrottlesLogins; use RegistersUsers;
/** /**
* Where to redirect users after login / registration. * Where to redirect users after login / registration.
* *
* @var string * @var string
*/ */
protected $redirectTo = '/'; protected $redirectTo = '/home';
/** /**
* Create a new authentication controller instance. * Create a new controller instance.
* *
* @return void * @return void
*/ */
public function __construct() public function __construct()
{ {
$this->middleware($this->guestMiddleware(), ['except' => 'logout']); $this->middleware('guest');
} }
/** /**
......
...@@ -5,7 +5,7 @@ namespace App\Http\Controllers\Auth; ...@@ -5,7 +5,7 @@ namespace App\Http\Controllers\Auth;
use App\Http\Controllers\Controller; use App\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\ResetsPasswords; use Illuminate\Foundation\Auth\ResetsPasswords;
class PasswordController extends Controller class ResetPasswordController extends Controller
{ {
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
...@@ -21,7 +21,7 @@ class PasswordController extends Controller ...@@ -21,7 +21,7 @@ class PasswordController extends Controller
use ResetsPasswords; use ResetsPasswords;
/** /**
* Create a new password controller instance. * Create a new controller instance.
* *
* @return void * @return void
*/ */
......
...@@ -6,9 +6,8 @@ use Illuminate\Foundation\Bus\DispatchesJobs; ...@@ -6,9 +6,8 @@ use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Routing\Controller as BaseController; use Illuminate\Routing\Controller as BaseController;
use Illuminate\Foundation\Validation\ValidatesRequests; use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests; use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
use Illuminate\Foundation\Auth\Access\AuthorizesResources;
class Controller extends BaseController class Controller extends BaseController
{ {
use AuthorizesRequests, AuthorizesResources, DispatchesJobs, ValidatesRequests; use AuthorizesRequests, DispatchesJobs, ValidatesRequests;
} }
...@@ -2,11 +2,10 @@ ...@@ -2,11 +2,10 @@
namespace App\Http\Controllers; namespace App\Http\Controllers;
use Illuminate\Http\Request;
use File; use File;
use Response; use Illuminate\Http\Request;
use App\Http\Requests;
use PiwikTracker; use PiwikTracker;
use Response;
class ImageController extends Controller class ImageController extends Controller
{ {
...@@ -14,7 +13,7 @@ class ImageController extends Controller ...@@ -14,7 +13,7 @@ class ImageController extends Controller
{ {
#Piwik Code #Piwik Code
PiwikTracker::$URL = 'http://piwik.metager3.de'; PiwikTracker::$URL = 'http://piwik.metager3.de';
$piwikTracker = new PiwikTracker( $idSite = 1 ); $piwikTracker = new PiwikTracker($idSite = 1);
// Cookies ausschalten // Cookies ausschalten
$piwikTracker->disableCookieSupport(); $piwikTracker->disableCookieSupport();
...@@ -25,10 +24,9 @@ class ImageController extends Controller ...@@ -25,10 +24,9 @@ class ImageController extends Controller
// Sendet Tracker request per http // Sendet Tracker request per http
$piwikTracker->doTrackPageView($site); $piwikTracker->doTrackPageView($site);
$path = public_path() . '/img/1px.png'; $path = public_path() . '/img/1px.png';
$fileType = File::type($path); $fileType = File::type($path);
$response = Response::make( File::get($path), 200); $response = Response::make(File::get($path), 200);
$response->header('Content-Type', $fileType); $response->header('Content-Type', $fileType);
return $response; return $response;
} }
......
...@@ -2,19 +2,17 @@ ...@@ -2,19 +2,17 @@
namespace App\Http\Controllers; namespace App\Http\Controllers;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Redis; use Redis;
class LogController extends Controller class LogController extends Controller
{ {
function clicklog(Request $request) public function clicklog(Request $request)
{ {
$redis = Redis::connection('redisLogs'); $redis = Redis::connection('redisLogs');
if( $redis ) if ($redis) {
{
$logEntry = ""; $logEntry = "";
$logEntry .= "[" . date(DATE_RFC822, mktime(date("H"),date("i"), date("s"), date("m"), date("d"), date("Y"))) . "]"; $logEntry .= "[" . date(DATE_RFC822, mktime(date("H"), date("i"), date("s"), date("m"), date("d"), date("Y"))) . "]";
$logEntry .= " " . $request->input('i'); $logEntry .= " " . $request->input('i');
$logEntry .= " " . $request->input('s'); $logEntry .= " " . $request->input('s');
$logEntry .= " " . $request->input('q'); $logEntry .= " " . $request->input('q');
...@@ -26,22 +24,19 @@ class LogController extends Controller ...@@ -26,22 +24,19 @@ class LogController extends Controller
return ''; return '';
} }
function pluginClose() public function pluginClose()
{ {
$redis = Redis::connection('redisLogs'); $redis = Redis::connection('redisLogs');
if( $redis ) if ($redis) {
{
$redis->incr('logs.plugin.close'); $redis->incr('logs.plugin.close');
} }
} }
function pluginInstall() public function pluginInstall()
{ {
$redis = Redis::connection('redisLogs'); $redis = Redis::connection('redisLogs');
if( $redis ) if ($redis) {
{
$redis->incr('logs.plugin.install'); $redis->incr('logs.plugin.install');
} }
} }
} }
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
namespace App\Http\Controllers; namespace App\Http\Controllers;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Illuminate\Http\Response; use Illuminate\Http\Response;
use LaravelLocalization; use LaravelLocalization;
......
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
namespace App\Http\Controllers; namespace App\Http\Controllers;
use App; use App;
use App\Http\Controllers\Controller;
use App\MetaGer; use App\MetaGer;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use LaravelLocalization; use LaravelLocalization;
...@@ -138,5 +137,4 @@ class MetaGerSearch extends Controller ...@@ -138,5 +137,4 @@ class MetaGerSearch extends Controller
{ {
return file_get_contents($url); return file_get_contents($url);
} }
} }
...@@ -2,47 +2,37 @@ ...@@ -2,47 +2,37 @@
namespace App\Http\Controllers; namespace App\Http\Controllers;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
#use App\MetaGer\Forwarder;
#use App\MetaGer\Results;
#use App\MetaGer\Search;
use App; use App;
use App\MetaGer; use Illuminate\Http\Request;
use Response; use Response;
class Pictureproxy extends Controller class Pictureproxy extends Controller
{ {
function get(Request $request) { public function get(Request $request)
if( $request->has('url') )
{ {
try{ if ($request->has('url')) {
$arrContextOptions=array( try {
"ssl"=>array( $arrContextOptions = array(
"verify_peer"=>false, "ssl" => array(
"verify_peer_name"=>false, "verify_peer" => false,
"verify_peer_name" => false,
), ),
); );
$file = file_get_contents($request->input('url'), false, stream_context_create($arrContextOptions)); $file = file_get_contents($request->input('url'), false, stream_context_create($arrContextOptions));
$responseCode = explode(" ", $http_response_header[0])[1]; $responseCode = explode(" ", $http_response_header[0])[1];
$contentType = ""; $contentType = "";
foreach($http_response_header as $header) foreach ($http_response_header as $header) {
{ if (strpos($header, "Content-Type:") === 0) {
if( strpos($header, "Content-Type:") === 0)
{
$tmp = explode(": ", $header); $tmp = explode(": ", $header);
$contentType = $tmp[1]; $contentType = $tmp[1];
} }
} }
$response = Response::make($file, $responseCode);