From cdc107fcb2613b73ed620a8fa394755a739e0a85 Mon Sep 17 00:00:00 2001 From: Graham Campbell Date: Thu, 24 Dec 2015 15:44:06 +0000 Subject: [PATCH] Upgrade to laravel 5.2 --- app/Composers/StatusPageComposer.php | 2 +- app/Config/Repository.php | 2 +- .../Providers/AppServiceProvider.php | 4 +- composer.json | 14 ++- config/app.php | 19 ++- config/auth.php | 109 ++++++++++++------ config/mail.php | 13 --- config/queue.php | 15 +-- resources/views/setup.blade.php | 2 +- 9 files changed, 104 insertions(+), 76 deletions(-) diff --git a/app/Composers/StatusPageComposer.php b/app/Composers/StatusPageComposer.php index 46e678587..28b62d9fc 100644 --- a/app/Composers/StatusPageComposer.php +++ b/app/Composers/StatusPageComposer.php @@ -56,7 +56,7 @@ class StatusPageComposer $scheduledMaintenance = Incident::scheduled()->orderBy('scheduled_at')->get(); // Component & Component Group lists. - $usedComponentGroups = Component::enabled()->where('group_id', '>', 0)->groupBy('group_id')->lists('group_id'); + $usedComponentGroups = Component::enabled()->where('group_id', '>', 0)->groupBy('group_id')->pluck('group_id'); $componentGroups = ComponentGroup::whereIn('id', $usedComponentGroups)->orderBy('order')->get(); $ungroupedComponents = Component::enabled()->where('group_id', 0)->orderBy('order')->orderBy('created_at')->get(); diff --git a/app/Config/Repository.php b/app/Config/Repository.php index 980be3bbf..2c0699907 100644 --- a/app/Config/Repository.php +++ b/app/Config/Repository.php @@ -52,7 +52,7 @@ class Repository public function get($name, $default = null) { if (!$this->settings) { - $this->settings = $this->model->all()->lists('value', 'name'); + $this->settings = $this->model->all()->pluck('value', 'name'); } if (!empty($this->settings[$name])) { diff --git a/app/Foundation/Providers/AppServiceProvider.php b/app/Foundation/Providers/AppServiceProvider.php index 4e1f8abce..ffbb789f4 100644 --- a/app/Foundation/Providers/AppServiceProvider.php +++ b/app/Foundation/Providers/AppServiceProvider.php @@ -11,8 +11,8 @@ namespace CachetHQ\Cachet\Foundation\Providers; +use AltThree\Bus\Dispatcher; use CachetHQ\Cachet\Dates\DateFactory; -use Illuminate\Bus\Dispatcher; use Illuminate\Support\ServiceProvider; use Illuminate\Support\Str; @@ -21,7 +21,7 @@ class AppServiceProvider extends ServiceProvider /** * Boot the service provider. * - * @param \Illuminate\Bus\Dispatcher $dispatcher + * @param \AltThree\Bus\Dispatcher $dispatcher */ public function boot(Dispatcher $dispatcher) { diff --git a/composer.json b/composer.json index 2642625b1..e2bec5152 100644 --- a/composer.json +++ b/composer.json @@ -20,10 +20,12 @@ ], "require": { "php": ">=5.5.9", - "laravel/framework": "~5.1.28", + "laravel/framework": "~5.2.5", + "alt-three/bus": "^1.0", "alt-three/emoji": "^2.1", "alt-three/validator": "^1.4", - "barryvdh/laravel-cors": "^0.7", + "asm89/stack-cors": "dev-master as 0.2.2", + "barryvdh/laravel-cors": "^0.7.3", "doctrine/dbal": "^2.5", "fideloper/proxy": "^3.1", "graham-campbell/binput": "^3.3", @@ -34,8 +36,8 @@ "guzzlehttp/guzzle": "^6.1", "jenssegers/date": "^3.1", "mccool/laravel-auto-presenter": "^4.2", - "pragmarx/google2fa": "^0.7", - "rcrowe/twigbridge": "^0.9", + "pragmarx/google2fa": "^0.7.1", + "rcrowe/twigbridge": "^0.9.1", "roumen/feed": "^2.9.8" }, "require-dev": { @@ -44,7 +46,9 @@ "fzaninotto/faker": "^1.5", "graham-campbell/testbench-core": "^1.1", "mockery/mockery": "0.9.4", - "phpunit/phpunit": "4.8.21" + "phpunit/phpunit": "4.8.21", + "symfony/css-selector": "^3.0", + "symfony/dom-crawler": "^3.0" }, "autoload": { "classmap": [ diff --git a/config/app.php b/config/app.php index 8572961ed..22f9e8e7e 100644 --- a/config/app.php +++ b/config/app.php @@ -11,6 +11,19 @@ return [ + /* + |-------------------------------------------------------------------------- + | Application Environment + |-------------------------------------------------------------------------- + | + | This value determines the "environment" your application is currently + | running in. This may determine how you prefer to configure various + | services your application utilizes. Set this in your ".env" file. + | + */ + + 'env' => env('APP_ENV', 'production'), + /* |-------------------------------------------------------------------------- | Application Debug Mode @@ -87,7 +100,7 @@ return [ | */ - 'key' => env('APP_KEY', 'SomeRandomString'), + 'key' => env('APP_KEY'), 'cipher' => 'AES-256-CBC', @@ -122,13 +135,11 @@ return [ /* * Laravel Framework Service Providers... */ - 'Illuminate\Foundation\Providers\ArtisanServiceProvider', 'Illuminate\Auth\AuthServiceProvider', 'Illuminate\Broadcasting\BroadcastServiceProvider', - 'Illuminate\Bus\BusServiceProvider', + 'AltThree\Bus\BusServiceProvider', 'Illuminate\Cache\CacheServiceProvider', 'Illuminate\Foundation\Providers\ConsoleSupportServiceProvider', - 'Illuminate\Routing\ControllerServiceProvider', 'Illuminate\Cookie\CookieServiceProvider', 'Illuminate\Database\DatabaseServiceProvider', 'Illuminate\Encryption\EncryptionServiceProvider', diff --git a/config/auth.php b/config/auth.php index d07a0c6e7..97aef242b 100644 --- a/config/auth.php +++ b/config/auth.php @@ -13,64 +13,99 @@ return [ /* |-------------------------------------------------------------------------- - | Default Authentication Driver + | Authentication Defaults |-------------------------------------------------------------------------- | - | This option controls the authentication driver that will be utilized. - | This driver manages the retrieval and authentication of the users - | attempting to get access to protected areas of your application. + | This option controls the default authentication "guard" and password + | reset options for your application. You may change these defaults + | as required, but they're a perfect start for most applications. + | + */ + + 'defaults' => [ + 'guard' => 'web', + 'passwords' => 'users', + ], + + /* + |-------------------------------------------------------------------------- + | Authentication Guards + |-------------------------------------------------------------------------- + | + | Next, you may define every authentication guard for your application. + | Of course, a great default configuration has been defined for you + | here which uses session storage and the Eloquent user provider. + | + | All authentication drivers have a user provider. This defines how the + | users are actually retrieved out of your database or other storage + | mechanisms used by this application to persist your user's data. + | + | Supported: "session", "token" + | + */ + + 'guards' => [ + 'web' => [ + 'driver' => 'session', + 'provider' => 'users', + ], + + 'api' => [ + 'driver' => 'token', + 'provider' => 'users', + ], + ], + + /* + |-------------------------------------------------------------------------- + | User Providers + |-------------------------------------------------------------------------- + | + | All authentication drivers have a user provider. This defines how the + | users are actually retrieved out of your database or other storage + | mechanisms used by this application to persist your user's data. + | + | If you have multiple user tables or models you may configure multiple + | sources which represent each model / table. These sources may then + | be assigned to any extra authentication guards you have defined. | | Supported: "database", "eloquent" | */ - 'driver' => 'eloquent', + 'providers' => [ + 'users' => [ + 'driver' => 'eloquent', + 'model' => 'CachetHQ\Cachet\Models\User', + ], + ], /* |-------------------------------------------------------------------------- - | Authentication Model - |-------------------------------------------------------------------------- - | - | When using the "Eloquent" authentication driver, we need to know which - | Eloquent model should be used to retrieve your users. Of course, it - | is often just the "User" model but you may use whatever you like. - | - */ - - 'model' => 'CachetHQ\Cachet\Models\User', - - /* - |-------------------------------------------------------------------------- - | Authentication Table - |-------------------------------------------------------------------------- - | - | When using the "Database" authentication driver, we need to know which - | table should be used to retrieve your users. We have chosen a basic - | default value but you may easily change it to any table you like. - | - */ - - 'table' => 'users', - - /* - |-------------------------------------------------------------------------- - | Password Reset Settings + | Resetting Passwords |-------------------------------------------------------------------------- | | Here you may set the options for resetting passwords including the view - | that is your password reset e-mail. You can also set the name of the + | that is your password reset e-mail. You may also set the name of the | table that maintains all of the reset tokens for your application. | + | You may specify multiple password reset configurations if you have more + | than one user table or model in the application and you want to have + | separate password reset settings based on the specific user types. + | | The expire time is the number of minutes that the reset token should be | considered valid. This security feature keeps tokens short-lived so | they have less time to be guessed. You may change this as needed. | */ - 'password' => [ - 'email' => 'emails.password', - 'table' => 'password_resets', - 'expire' => 60, + 'passwords' => [ + 'users' => [ + 'provider' => 'users', + 'email' => 'auth.emails.password', + 'table' => 'password_resets', + 'expire' => 60, + ], ], ]; diff --git a/config/mail.php b/config/mail.php index d0584d7d0..ea0b2797e 100644 --- a/config/mail.php +++ b/config/mail.php @@ -117,17 +117,4 @@ return [ 'sendmail' => '/usr/sbin/sendmail -bs', - /* - |-------------------------------------------------------------------------- - | Mail "Pretend" - |-------------------------------------------------------------------------- - | - | When this option is enabled, e-mail will not actually be sent over the - | web and will instead be written to your application's logs files so - | you may inspect the message. This is great for local development. - | - */ - - 'pretend' => false, - ]; diff --git a/config/queue.php b/config/queue.php index 44466106d..21cafd9c3 100644 --- a/config/queue.php +++ b/config/queue.php @@ -20,8 +20,7 @@ return [ | API, giving you convenient access to each back-end using the same | syntax for each one. Here you may set the default queue driver. | - | Supported: "null", "sync", "database", "beanstalkd", - | "sqs", "iron", "redis" + | Supported: "null", "sync", "database", "beanstalkd", "sqs", "redis" | */ @@ -62,19 +61,11 @@ return [ 'driver' => 'sqs', 'key' => 'your-public-key', 'secret' => 'your-secret-key', - 'queue' => 'your-queue-url', + 'prefix' => 'https://sqs.us-east-1.amazonaws.com/your-account-id', + 'queue' => 'your-queue-name', 'region' => 'us-east-1', ], - 'iron' => [ - 'driver' => 'iron', - 'host' => 'mq-aws-us-east-1.iron.io', - 'token' => 'your-token', - 'project' => 'your-project-id', - 'queue' => 'your-queue-name', - 'encrypt' => true, - ], - 'redis' => [ 'driver' => 'redis', 'connection' => 'default', diff --git a/resources/views/setup.blade.php b/resources/views/setup.blade.php index b3c201c8d..ca48eedf9 100644 --- a/resources/views/setup.blade.php +++ b/resources/views/setup.blade.php @@ -75,7 +75,7 @@
- + @if($errors->has('settings.app_domain')) {{ $errors->first('settings.app_domain') }} @endif