Skip to content

Laravel 5.1 #50

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 14 commits into from
Jun 9, 2015
8 changes: 0 additions & 8 deletions app/Commands/Command.php

This file was deleted.

20 changes: 15 additions & 5 deletions app/Console/Commands/CheckHeartbeats.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
use Queue;
use Carbon\Carbon;
use App\Heartbeat;
use App\Commands\Notify;
use App\Jobs\Notify;
use Illuminate\Console\Command;

/**
Expand All @@ -12,11 +12,11 @@
class CheckHeartbeats extends Command
{
/**
* The console command name.
* The name and signature of the console command.
*
* @var string
*/
protected $name = 'deployer:heartbeats';
protected $signature = 'deployer:heartbeats';

/**
* The console command description.
Expand All @@ -26,11 +26,21 @@ class CheckHeartbeats extends Command
protected $description = 'Checks that any expected heartbeats have checked-in';

/**
* Checks that heartbeats happened as expected
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}

/**
* Execute the console command.
*
* @return mixed
*/
public function fire()
public function handle()
{
Heartbeat::chunk(10, function ($heartbeats) {
foreach ($heartbeats as $heartbeat) {
Expand Down
13 changes: 6 additions & 7 deletions app/Console/Commands/CheckUrl.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
<?php namespace App\Console\Commands;

use App\CheckUrl as CheckUrlModel;
use App\Commands\RequestProjectCheckUrl;

use App\Jobs\RequestProjectCheckUrl;
use Illuminate\Console\Command;
use Illuminate\Foundation\Bus\DispatchesCommands;
use Illuminate\Foundation\Bus\DispatchesJobs;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputArgument;

Expand All @@ -13,14 +12,14 @@
*/
class CheckUrl extends Command
{
use DispatchesCommands;
use DispatchesJobs;

/**
* The console command name.
* The name and signature of the console command.
*
* @var string
*/
protected $name = 'deployer:checkurls';
protected $signature = 'deployer:checkurls';

/**
* The console command description.
Expand All @@ -44,7 +43,7 @@ public function __construct()
*
* @return mixed
*/
public function fire()
public function handle()
{
$period = [];

Expand Down
7 changes: 4 additions & 3 deletions app/Console/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,15 @@ class Kernel extends ConsoleKernel
* @var array
*/
protected $customBooters = [
'Illuminate\Foundation\Bootstrap\ConfigureLogging' => 'App\Bootstrap\ConfigureLogging',
\Illuminate\Foundation\Bootstrap\ConfigureLogging::class => \App\Bootstrap\ConfigureLogging::class,
];

/**
* Disable bootstrapper list
* @var array
*/
protected $disabledBooters = [

];

/**
Expand All @@ -30,8 +31,8 @@ class Kernel extends ConsoleKernel
* @var array
*/
protected $commands = [
'App\Console\Commands\CheckHeartbeats',
'App\Console\Commands\CheckUrl'
\App\Console\Commands\CheckHeartbeats::class,
\App\Console\Commands\CheckUrl::class
];

/**
Expand Down
1 change: 0 additions & 1 deletion app/Events/UserWasCreated.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
use App\Events\Event;
use App\User;
use Illuminate\Queue\SerializesModels;
use Illuminate\Contracts\Queue\ShouldBeQueued;

/**
* Event which is fired when a user is created
Expand Down
6 changes: 4 additions & 2 deletions app/Exceptions/Handler.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php namespace App\Exceptions;
<?php

namespace App\Exceptions;

use Exception;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
Expand All @@ -14,7 +16,7 @@ class Handler extends ExceptionHandler
* @var array
*/
protected $dontReport = [
'Symfony\Component\HttpKernel\Exception\HttpException'
\Symfony\Component\HttpKernel\Exception\HttpException::class,
];

/**
Expand Down
46 changes: 5 additions & 41 deletions app/Http/Controllers/Auth/AuthController.php
Original file line number Diff line number Diff line change
@@ -1,27 +1,16 @@
<?php namespace App\Http\Controllers\Auth;

use App\User;
use Validator;
use App\Http\Controllers\Controller;
use Illuminate\Contracts\Auth\Guard;
use Illuminate\Contracts\Auth\Registrar;
use Illuminate\Foundation\Auth\AuthenticatesAndRegistersUsers;
use Illuminate\Foundation\Auth\AuthenticatesUsers;

/**
* Authentication controller
*/
class AuthController extends Controller
{
/*
|--------------------------------------------------------------------------
| Registration & Login Controller
|--------------------------------------------------------------------------
|
| This controller handles the registration of new users, as well as the
| authentication of existing users. By default, this controller uses
| a simple trait to add these behaviors. Why don't you explore it?
|
*/

use AuthenticatesAndRegistersUsers;
use AuthenticatesUsers;

/**
* Where to redirect to once the user has been authenticated
Expand All @@ -33,35 +22,10 @@ class AuthController extends Controller
/**
* Create a new authentication controller instance.
*
* @param \Illuminate\Contracts\Auth\Guard $auth
* @param \Illuminate\Contracts\Auth\Registrar $registrar
* @return void
*/
public function __construct(Guard $auth, Registrar $registrar)
public function __construct()
{
$this->auth = $auth;
$this->registrar = $registrar;

$this->middleware('guest', ['except' => 'getLogout']);
}

/**
* Disable laravel's build in register feature as it is not needed
*
* @return Response
*/
public function getRegister()
{
return redirect('/');
}

/**
* Disable laravel's build in register feature as it is not needed
*
* @return Response
*/
public function postRegister()
{
return redirect('/');
}
}
19 changes: 1 addition & 18 deletions app/Http/Controllers/Auth/PasswordController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,13 @@

use Lang;
use App\Http\Controllers\Controller;
use Illuminate\Contracts\Auth\Guard;
use Illuminate\Contracts\Auth\PasswordBroker;
use Illuminate\Foundation\Auth\ResetsPasswords;

/**
* Password reset controller
*/
class PasswordController extends Controller
{
/*
|--------------------------------------------------------------------------
| Password Reset Controller
|--------------------------------------------------------------------------
|
| This controller is responsible for handling password reset requests
| and uses a simple trait to include this behavior. You're free to
| explore this trait and override any methods you wish to tweak.
|
*/

use ResetsPasswords;

/**
Expand All @@ -34,14 +21,10 @@ class PasswordController extends Controller
/**
* Create a new password controller instance.
*
* @param \Illuminate\Contracts\Auth\Guard $auth
* @param \Illuminate\Contracts\Auth\PasswordBroker $passwords
* @return void
*/
public function __construct(Guard $auth, PasswordBroker $passwords)
public function __construct()
{
$this->auth = $auth;
$this->passwords = $passwords;
$this->subject = Lang::get('emails.reset_subject');

$this->middleware('guest');
Expand Down
4 changes: 2 additions & 2 deletions app/Http/Controllers/Controller.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php namespace App\Http\Controllers;

use Illuminate\Foundation\Bus\DispatchesCommands;
use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Routing\Controller as BaseController;
use Illuminate\Foundation\Validation\ValidatesRequests;

Expand All @@ -9,5 +9,5 @@
*/
abstract class Controller extends BaseController
{
use DispatchesCommands, ValidatesRequests;
use DispatchesJobs, ValidatesRequests;
}
2 changes: 1 addition & 1 deletion app/Http/Controllers/DeploymentController.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use App\Deployment;
use App\Http\Controllers\Controller;
use App\Repositories\Contracts\DeploymentRepositoryInterface;
use App\Commands\QueueDeployment;
use App\Jobs\QueueDeployment;

/**
* The controller for showing the status of deployments
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Resources/ServerController.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
use Response;
use App\Server;
use App\Http\Requests;
use App\Commands\TestServerConnection;
use App\Jobs\TestServerConnection;
use App\Http\Requests\StoreServerRequest;

/**
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/WebhookController.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
use Input;
use App\Project;
use App\Deployment;
use App\Commands\QueueDeployment;
use App\Jobs\QueueDeployment;
use App\Http\Controllers\Controller;

/**
Expand Down
24 changes: 13 additions & 11 deletions app/Http/Kernel.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php namespace App\Http;
<?php

namespace App\Http;

use Illuminate\Foundation\Http\Kernel as HttpKernel;

Expand All @@ -7,13 +9,12 @@
*/
class Kernel extends HttpKernel
{

/**
* The custom bootstrappers like Logging or Environment detector
* @var array
*/
protected $customBooters = [
'Illuminate\Foundation\Bootstrap\ConfigureLogging' => 'App\Bootstrap\ConfigureLogging',
Illuminate\Foundation\Bootstrap\ConfigureLogging::class => \App\Bootstrap\ConfigureLogging::class,
];

/**
Expand All @@ -29,12 +30,12 @@ class Kernel extends HttpKernel
* @var array
*/
protected $middleware = [
'Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode',
'Illuminate\Cookie\Middleware\EncryptCookies',
'Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse',
'Illuminate\Session\Middleware\StartSession',
'Illuminate\View\Middleware\ShareErrorsFromSession',
'App\Http\Middleware\VerifyCsrfToken',
\Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode::class,
\App\Http\Middleware\EncryptCookies::class,
\Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
\Illuminate\Session\Middleware\StartSession::class,
\Illuminate\View\Middleware\ShareErrorsFromSession::class,
\App\Http\Middleware\VerifyCsrfToken::class,
];

/**
Expand All @@ -43,8 +44,9 @@ class Kernel extends HttpKernel
* @var array
*/
protected $routeMiddleware = [
'auth' => 'App\Http\Middleware\Authenticate',
'guest' => 'App\Http\Middleware\RedirectIfAuthenticated',
'auth' => \App\Http\Middleware\Authenticate::class,
//'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
];

/**
Expand Down
7 changes: 4 additions & 3 deletions app/Http/Middleware/Authenticate.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<?php namespace App\Http\Middleware;
<?php

namespace App\Http\Middleware;

use Closure;
use Illuminate\Contracts\Auth\Guard;
use Illuminate\Http\Request;

/**
* Authentication middleware
Expand Down Expand Up @@ -34,7 +35,7 @@ public function __construct(Guard $auth)
* @param \Closure $next
* @return mixed
*/
public function handle(Request $request, Closure $next)
public function handle($request, Closure $next)
{
if ($this->auth->guest()) {
if ($request->ajax()) {
Expand Down
20 changes: 20 additions & 0 deletions app/Http/Middleware/EncryptCookies.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php

namespace App\Http\Middleware;

use Illuminate\Cookie\Middleware\EncryptCookies as BaseEncrypter;

/**
* Middleware to encrypt cookies
*/
class EncryptCookies extends BaseEncrypter
{
/**
* The names of the cookies that should not be encrypted.
*
* @var array
*/
protected $except = [
//
];
}
Loading