Skip to content

Commit

Permalink
Merge e0bb3ad into 493cdb8
Browse files Browse the repository at this point in the history
  • Loading branch information
zakhenry committed Jan 13, 2016
2 parents 493cdb8 + e0bb3ad commit cc4d796
Show file tree
Hide file tree
Showing 32 changed files with 931 additions and 883 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Expand Up @@ -63,7 +63,7 @@ before_script:
- psql -c 'create database spira;' -U postgres
- gulp build
- php ./api/artisan migrate --seed
- php ./api/artisan serve --port 8000 --host 127.0.0.1 --quiet 2>&1 >/dev/null & # start api server
- php -S 127.0.0.1:8000 2>&1 >/dev/null & # start api server
- http-server ./app/build/ -p 8001 2>&1 >/dev/null & # start webserver
- mailcatcher # start mailcatcher server
- beanstalkd -d -l 127.0.0.1 -p 11300 # start queue listener
Expand Down
2 changes: 1 addition & 1 deletion api/app/Extensions/Socialite/SocialiteServiceProvider.php
Expand Up @@ -33,7 +33,7 @@ public function boot()
*/
public function register()
{
$this->app->bindShared('Laravel\Socialite\Contracts\Factory', function ($app) {
$this->app->singleton('Laravel\Socialite\Contracts\Factory', function ($app) {
return new SocialiteManager($app);
});
}
Expand Down
16 changes: 3 additions & 13 deletions api/app/Http/Controllers/AuthController.php
Expand Up @@ -34,13 +34,6 @@

class AuthController extends ApiController
{
/**
* The application instance.
*
* @var Application
*/
protected $app;

/**
* @var SpiraGuard
*/
Expand All @@ -59,13 +52,10 @@ class AuthController extends ApiController
* @param AuthTokenTransformer $transformer
* @param Application $app
*/
public function __construct(
Guard $auth,
AuthTokenTransformer $transformer,
Application $app)
public function __construct(Guard $auth, AuthTokenTransformer $transformer)
{
$this->auth = $auth;
$this->app = $app;

parent::__construct($transformer);
}

Expand Down Expand Up @@ -255,7 +245,7 @@ public function singleSignOn($requester, Request $request)
*/
protected function validateProvider($provider)
{
if (! in_array($provider, array_keys($this->app['config']['services']))) {
if (! in_array($provider, array_keys(app()['config']['services']))) {
throw new NotImplementedException('Provider '.$provider.' is not supported.');
}
}
Expand Down
3 changes: 0 additions & 3 deletions api/app/Http/Controllers/UserController.php
Expand Up @@ -18,7 +18,6 @@
use App\Jobs\SendPasswordResetEmail;
use Illuminate\Contracts\Auth\Guard;
use App\Jobs\SendEmailConfirmationEmail;
use Laravel\Lumen\Routing\DispatchesJobs;
use Spira\Auth\Driver\Guard as SpiraGuard;
use Spira\Core\Controllers\EntityController;
use Spira\Core\Responder\Response\ApiResponse;
Expand All @@ -29,8 +28,6 @@

class UserController extends EntityController
{
use DispatchesJobs;

/**
* @var SpiraGuard
*/
Expand Down
2 changes: 1 addition & 1 deletion api/app/Http/Transformers/AuthTokenTransformer.php
Expand Up @@ -27,7 +27,7 @@ public function transformItem($token, array $options = [])
$result = ['token' => (string) $token];

if (env('APP_DEBUG', false)) {
$result['decodedTokenBody'] = \App::make('auth')->getTokenizer()->decode($token);
$result['decodedTokenBody'] = app('auth')->getTokenizer()->decode($token);
}

return $result;
Expand Down
5 changes: 2 additions & 3 deletions api/app/Jobs/Job.php
Expand Up @@ -10,12 +10,11 @@

namespace App\Jobs;

use Illuminate\Contracts\Bus\SelfHandling;
use Illuminate\Contracts\Queue\ShouldBeQueued;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;

abstract class Job implements SelfHandling, ShouldBeQueued
abstract class Job implements ShouldQueue
{
use InteractsWithQueue, SerializesModels;
}
10 changes: 4 additions & 6 deletions api/app/Jobs/SendPasswordResetEmail.php
Expand Up @@ -12,12 +12,11 @@

use App\Models\User;
use Illuminate\Mail\Message;
use Illuminate\Contracts\Mail\Mailer;
use Illuminate\Contracts\Bus\SelfHandling;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Support\Facades\Config;
use Illuminate\Support\Facades\Mail;

class SendPasswordResetEmail extends Job implements SelfHandling, ShouldQueue
class SendPasswordResetEmail extends Job implements ShouldQueue
{
/**
* User to email.
Expand Down Expand Up @@ -49,12 +48,11 @@ public function __construct(User $user, $loginToken)
/**
* Execute the job.
*
* @param Mailer $mailer
* @return void
*/
public function handle(Mailer $mailer)
public function handle()
{
$mailer->send('emails.resetPassword', [
Mail::send('emails.resetPassword', [
'user' => $this->user,
'passwordResetRedirectionUrl' => Config::get('hosts.app').'/profile?loginToken='.$this->loginToken,
], function (Message $m) {
Expand Down
2 changes: 1 addition & 1 deletion api/app/Models/PostDiscussion.php
Expand Up @@ -340,7 +340,7 @@ public function setPost($post)
protected function getClient()
{
if (! $this->client) {
$this->client = App::make(VanillaClient::class);
$this->client = app(VanillaClient::class);
}

return $this->client;
Expand Down
3 changes: 2 additions & 1 deletion api/app/Models/UserCredential.php
Expand Up @@ -10,6 +10,7 @@

namespace App\Models;

use Illuminate\Support\Facades\Hash;
use Spira\Core\Model\Model\BaseModel;

class UserCredential extends BaseModel
Expand Down Expand Up @@ -59,6 +60,6 @@ class UserCredential extends BaseModel
*/
public function setPasswordAttribute($value)
{
$this->attributes['password'] = \Hash::make($value);
$this->attributes['password'] = Hash::make($value);
}
}
2 changes: 1 addition & 1 deletion api/app/Providers/AuthServiceProvider.php
Expand Up @@ -32,7 +32,7 @@ protected function registerAuthenticator()
});

$this->app->singleton('auth.driver', function ($app) {
return $app['auth']->driver();
return $app['auth']->guard();
});
}

Expand Down
2 changes: 1 addition & 1 deletion api/app/Services/SingleSignOn/VanillaSingleSignOn.php
Expand Up @@ -183,7 +183,7 @@ protected function getMappedRoles()
*/
protected function getGate()
{
return \App::make(GateContract::class);
return app(GateContract::class);
}

/**
Expand Down
12 changes: 8 additions & 4 deletions api/bootstrap/app.php
Expand Up @@ -36,6 +36,7 @@
$app->configure('regions');
$app->configure('jwt');
$app->configure('cors');
$app->configure('mail');

/*
|--------------------------------------------------------------------------
Expand Down Expand Up @@ -92,13 +93,16 @@
*/

$app->register(App\Providers\ApplicationProvider::class);
$app->register(App\Providers\ElasticServiceProvider::class);
$app->register(App\Providers\AuthServiceProvider::class);
$app->register(App\Providers\AuthDriverServiceProvider::class);
$app->register(App\Providers\ElasticServiceProvider::class);
$app->register(App\Providers\AccessServiceProvider::class);
$app->register(Bosnadev\Database\DatabaseServiceProvider::class);
$app->register(App\Providers\AuthDriverServiceProvider::class);
$app->register(\Illuminate\Mail\MailServiceProvider::class);
$app->register(\Illuminate\Redis\RedisServiceProvider::class);

$app->register(App\Extensions\Socialite\SocialiteServiceProvider::class);
$app->register(Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider::class);

$app->register(Bosnadev\Database\DatabaseServiceProvider::class);
$app->register(Barryvdh\Cors\LumenServiceProvider::class);

/*
Expand Down
15 changes: 8 additions & 7 deletions api/composer.json
Expand Up @@ -20,26 +20,30 @@
{
"type": "vcs",
"url": "https://github.com/spira/revisionable"
},
{
"type": "vcs",
"url": "http://github.com/spira/database"
}
],
"require": {
"jeremeamia/superclosure": "^2.1",
"pda/pheanstalk": "^3.0",
"predis/predis": "^1.0",
"illuminate/redis": "5.1.*",
"guzzlehttp/guzzle": "5.3.*",
"illuminate/redis": "5.2.*",
"league/flysystem": "^1.0",
"laravel/socialite": "^2.0",
"laravel/lumen-framework": "5.2.x-dev#17a1bc771d1d2bd80bb139659d659d8b296e3f5e",
"cloudinary/cloudinary_php": "^1.1",
"venturecraft/revisionable": "^2.0",
"spira/core": "1.5.*",
"spira/core": "dev-feature/lumen-5.2-upgrade",
"namshi/jose": "^6.0"
},
"require-dev": {
"phpunit/phpunit": "~5.1",
"mockery/mockery": "^0.9.4",
"fzaninotto/faker": "^1.4",
"barryvdh/laravel-ide-helper": "dev-master"
"symfony/var-dumper": "^3.0"
},
"autoload": {
"psr-4": {
Expand All @@ -63,9 +67,6 @@
"post-install-cmd": [
"npm install",
"php artisan auth:generate-keys"
],
"post-update-cmd": [
"php artisan ide-helper:generate"
]
}
}

0 comments on commit cc4d796

Please sign in to comment.