Merge pull request #124 from Lavoaster/laravel-upgrades

Upgrade to Laravel 5.5
This commit is contained in:
Peter Deltchev 2017-12-02 22:21:31 -08:00 committed by GitHub
commit bd4b78c690
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
37 changed files with 1733 additions and 1261 deletions

3
.gitignore vendored
View file

@ -1,6 +1,7 @@
/vendor
/node_modules
/public/build
/public/hot
/logs
Homestead.yaml
/public/storage
@ -9,4 +10,6 @@ Homestead.yaml
_ide_helper.php
.idea
resources/views/emails/html
npm-debug.log
yarn-error.log
/composer.phar

View file

@ -31,24 +31,7 @@ class Kernel extends ConsoleKernel
* @var array
*/
protected $commands = [
\Poniverse\Ponyfm\Console\Commands\MigrateOldData::class,
\Poniverse\Ponyfm\Console\Commands\RefreshCache::class,
\Poniverse\Ponyfm\Console\Commands\ClassifyMLPMA::class,
\Poniverse\Ponyfm\Console\Commands\RebuildTags::class,
\Poniverse\Ponyfm\Console\Commands\RebuildArtists::class,
\Poniverse\Ponyfm\Console\Commands\BootstrapLocalEnvironment::class,
\Poniverse\Ponyfm\Console\Commands\PoniverseApiSetup::class,
\Poniverse\Ponyfm\Console\Commands\ClearTrackCache::class,
\Poniverse\Ponyfm\Console\Commands\RebuildTrackCache::class,
\Poniverse\Ponyfm\Console\Commands\RebuildTrack::class,
\Poniverse\Ponyfm\Console\Commands\RebuildFilesizes::class,
\Poniverse\Ponyfm\Console\Commands\RebuildSearchIndex::class,
\Poniverse\Ponyfm\Console\Commands\MergeAccounts::class,
\Poniverse\Ponyfm\Console\Commands\SyncPoniverseAccounts::class,
\Poniverse\Ponyfm\Console\Commands\FixMLPMAImages::class,
\Poniverse\Ponyfm\Console\Commands\VersionFiles::class,
\Poniverse\Ponyfm\Console\Commands\ImportEQBeats::class,
\Poniverse\Ponyfm\Console\Commands\RebuildImages::class
//
];
/**
@ -59,7 +42,10 @@ class Kernel extends ConsoleKernel
*/
protected function schedule(Schedule $schedule)
{
// $schedule->command('inspire')
// ->hourly();
}
/**
* Register the Closure based commands for the application.
*
@ -67,6 +53,8 @@ class Kernel extends ConsoleKernel
*/
protected function commands()
{
$this->load(__DIR__.'/Commands');
require base_path('routes/console.php');
}
}

View file

@ -22,7 +22,7 @@ namespace Poniverse\Ponyfm\Exceptions;
use Exception;
use Illuminate\Auth\AuthenticationException;
use GrahamCampbell\Exceptions\NewExceptionHandler as ExceptionHandler;
use GrahamCampbell\Exceptions\ExceptionHandler;
class Handler extends ExceptionHandler
{
@ -32,12 +32,20 @@ class Handler extends ExceptionHandler
* @var array
*/
protected $dontReport = [
\Illuminate\Auth\AuthenticationException::class,
\Illuminate\Auth\Access\AuthorizationException::class,
\Illuminate\Validation\ValidationException::class,
\Symfony\Component\HttpKernel\Exception\HttpException::class,
//
];
/**
* A list of the inputs that are never flashed for validation exceptions.
*
* @var array
*/
protected $dontFlash = [
'password',
'password_confirmation',
];
/**
* Report or log an exception.
*
@ -62,19 +70,4 @@ class Handler extends ExceptionHandler
{
return parent::render($request, $e);
}
/**
* Convert an authentication exception into an unauthenticated response.
*
* @param \Illuminate\Http\Request $request
* @param \Illuminate\Auth\AuthenticationException $e
* @return \Illuminate\Http\Response
*/
protected function unauthenticated($request, AuthenticationException $e)
{
if ($request->expectsJson()) {
return response()->json(['error' => 'Unauthenticated.'], 401);
} else {
return redirect()->guest('login');
}
}
}

View file

@ -80,7 +80,7 @@ class TracksController extends Controller
public function getOembed(Request $request)
{
if (!$request->has('url')) {
if (!$request->filled('url')) {
App::abort(404);
}

View file

@ -57,6 +57,7 @@ class Kernel extends HttpKernel
'can' => \Poniverse\Ponyfm\Http\Middleware\Authorize::class,
'json-exceptions' => \Poniverse\Ponyfm\Http\Middleware\JsonExceptions::class,
'guest' => \Poniverse\Ponyfm\Http\Middleware\RedirectIfAuthenticated::class,
'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class
'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
'cors' => \Barryvdh\Cors\HandleCors::class,
];
}

View file

@ -20,9 +20,9 @@
namespace Poniverse\Ponyfm\Http\Middleware;
use Illuminate\Cookie\Middleware\EncryptCookies as BaseEncrypter;
use Illuminate\Cookie\Middleware\EncryptCookies as Middleware;
class EncryptCookies extends BaseEncrypter
class EncryptCookies extends Middleware
{
/**
* The names of the cookies that should not be encrypted.

View file

@ -20,9 +20,9 @@
namespace Poniverse\Ponyfm\Http\Middleware;
use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken as BaseVerifier;
use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken as Middleware;
class VerifyCsrfToken extends BaseVerifier
class VerifyCsrfToken extends Middleware
{
/**
* The URIs that should be excluded from CSRF verification.

View file

@ -48,6 +48,11 @@ use Illuminate\Database\Eloquent\SoftDeletes;
* @method static \Illuminate\Database\Query\Builder|\Poniverse\Ponyfm\Models\Activity whereResourceId($value)
* @method static \Illuminate\Database\Query\Builder|\Poniverse\Ponyfm\Models\Activity whereDeletedAt($value)
* @mixin \Eloquent
* @method static bool|null forceDelete()
* @method static \Illuminate\Database\Query\Builder|\Poniverse\Ponyfm\Models\Activity onlyTrashed()
* @method static bool|null restore()
* @method static \Illuminate\Database\Query\Builder|\Poniverse\Ponyfm\Models\Activity withTrashed()
* @method static \Illuminate\Database\Query\Builder|\Poniverse\Ponyfm\Models\Activity withoutTrashed()
*/
class Activity extends Model
{

View file

@ -81,6 +81,11 @@ use Venturecraft\Revisionable\RevisionableTrait;
* @method static \Illuminate\Database\Query\Builder|\Poniverse\Ponyfm\Models\Album whereUpdatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\Poniverse\Ponyfm\Models\Album whereDeletedAt($value)
* @mixin \Eloquent
* @method static bool|null forceDelete()
* @method static \Illuminate\Database\Query\Builder|\Poniverse\Ponyfm\Models\Album onlyTrashed()
* @method static bool|null restore()
* @method static \Illuminate\Database\Query\Builder|\Poniverse\Ponyfm\Models\Album withTrashed()
* @method static \Illuminate\Database\Query\Builder|\Poniverse\Ponyfm\Models\Album withoutTrashed()
*/
class Album extends Model implements Searchable, Commentable, Favouritable
{
@ -117,7 +122,7 @@ class Album extends Model implements Searchable, Commentable, Favouritable
]);
}
return !$query;
return $query;
}
protected $table = 'albums';

View file

@ -60,6 +60,11 @@ use Poniverse\Ponyfm\Contracts\Commentable;
* @method static \Illuminate\Database\Query\Builder|\Poniverse\Ponyfm\Models\Comment whereAlbumId($value)
* @method static \Illuminate\Database\Query\Builder|\Poniverse\Ponyfm\Models\Comment wherePlaylistId($value)
* @mixin \Eloquent
* @method static bool|null forceDelete()
* @method static \Illuminate\Database\Query\Builder|\Poniverse\Ponyfm\Models\Comment onlyTrashed()
* @method static bool|null restore()
* @method static \Illuminate\Database\Query\Builder|\Poniverse\Ponyfm\Models\Comment withTrashed()
* @method static \Illuminate\Database\Query\Builder|\Poniverse\Ponyfm\Models\Comment withoutTrashed()
*/
class Comment extends Model
{

View file

@ -42,6 +42,11 @@ use Poniverse\Ponyfm\Models\User;
* @method static \Illuminate\Database\Query\Builder|\Poniverse\Ponyfm\Models\EmailSubscription whereUpdatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\Poniverse\Ponyfm\Models\EmailSubscription whereDeletedAt($value)
* @mixin \Eloquent
* @method static bool|null forceDelete()
* @method static \Illuminate\Database\Query\Builder|\Poniverse\Ponyfm\Models\EmailSubscription onlyTrashed()
* @method static bool|null restore()
* @method static \Illuminate\Database\Query\Builder|\Poniverse\Ponyfm\Models\EmailSubscription withTrashed()
* @method static \Illuminate\Database\Query\Builder|\Poniverse\Ponyfm\Models\EmailSubscription withoutTrashed()
*/
class EmailSubscription extends Model
{

View file

@ -49,6 +49,11 @@ use Venturecraft\Revisionable\RevisionableTrait;
* @method static \Illuminate\Database\Query\Builder|\Poniverse\Ponyfm\Models\Genre whereCreatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\Poniverse\Ponyfm\Models\Genre whereUpdatedAt($value)
* @mixin \Eloquent
* @method static bool|null forceDelete()
* @method static \Illuminate\Database\Query\Builder|\Poniverse\Ponyfm\Models\Genre onlyTrashed()
* @method static bool|null restore()
* @method static \Illuminate\Database\Query\Builder|\Poniverse\Ponyfm\Models\Genre withTrashed()
* @method static \Illuminate\Database\Query\Builder|\Poniverse\Ponyfm\Models\Genre withoutTrashed()
*/
class Genre extends Model
{

View file

@ -82,6 +82,11 @@ use Venturecraft\Revisionable\RevisionableTrait;
* @method static \Illuminate\Database\Query\Builder|\Poniverse\Ponyfm\Models\Playlist whereUpdatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\Poniverse\Ponyfm\Models\Playlist whereDeletedAt($value)
* @mixin \Eloquent
* @method static bool|null forceDelete()
* @method static \Illuminate\Database\Query\Builder|\Poniverse\Ponyfm\Models\Playlist onlyTrashed()
* @method static bool|null restore()
* @method static \Illuminate\Database\Query\Builder|\Poniverse\Ponyfm\Models\Playlist withTrashed()
* @method static \Illuminate\Database\Query\Builder|\Poniverse\Ponyfm\Models\Playlist withoutTrashed()
*/
class Playlist extends Model implements Searchable, Commentable, Favouritable
{
@ -133,7 +138,7 @@ class Playlist extends Model implements Searchable, Commentable, Favouritable
]);
}
return !$query;
return $query;
}
public static function mapPublicPlaylistShow(Playlist $playlist)

View file

@ -102,6 +102,49 @@ use Venturecraft\Revisionable\RevisionableTrait;
* @method static \Illuminate\Database\Query\Builder|\Poniverse\Ponyfm\Models\Track mlpma()
* @property-read \Illuminate\Database\Eloquent\Collection|\Poniverse\Ponyfm\Models\Activity[] $notifications
* @property-read \Illuminate\Database\Eloquent\Collection|\Poniverse\Ponyfm\Models\Activity[] $activities
* @property int $current_version
* @property int|null $version_upload_status
* @property-read \Illuminate\Database\Eloquent\Collection|\Poniverse\Ponyfm\Models\TrackFile[] $trackFilesForAllVersions
* @method static bool|null forceDelete()
* @method static \Illuminate\Database\Query\Builder|\Poniverse\Ponyfm\Models\Track onlyTrashed()
* @method static bool|null restore()
* @method static \Illuminate\Database\Eloquent\Builder|\Poniverse\Ponyfm\Models\Track whereAlbumId($value)
* @method static \Illuminate\Database\Eloquent\Builder|\Poniverse\Ponyfm\Models\Track whereCommentCount($value)
* @method static \Illuminate\Database\Eloquent\Builder|\Poniverse\Ponyfm\Models\Track whereCoverId($value)
* @method static \Illuminate\Database\Eloquent\Builder|\Poniverse\Ponyfm\Models\Track whereCreatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|\Poniverse\Ponyfm\Models\Track whereCurrentVersion($value)
* @method static \Illuminate\Database\Eloquent\Builder|\Poniverse\Ponyfm\Models\Track whereDeletedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|\Poniverse\Ponyfm\Models\Track whereDescription($value)
* @method static \Illuminate\Database\Eloquent\Builder|\Poniverse\Ponyfm\Models\Track whereDownloadCount($value)
* @method static \Illuminate\Database\Eloquent\Builder|\Poniverse\Ponyfm\Models\Track whereDuration($value)
* @method static \Illuminate\Database\Eloquent\Builder|\Poniverse\Ponyfm\Models\Track whereFavouriteCount($value)
* @method static \Illuminate\Database\Eloquent\Builder|\Poniverse\Ponyfm\Models\Track whereGenreId($value)
* @method static \Illuminate\Database\Eloquent\Builder|\Poniverse\Ponyfm\Models\Track whereHash($value)
* @method static \Illuminate\Database\Eloquent\Builder|\Poniverse\Ponyfm\Models\Track whereId($value)
* @method static \Illuminate\Database\Eloquent\Builder|\Poniverse\Ponyfm\Models\Track whereIsDownloadable($value)
* @method static \Illuminate\Database\Eloquent\Builder|\Poniverse\Ponyfm\Models\Track whereIsExplicit($value)
* @method static \Illuminate\Database\Eloquent\Builder|\Poniverse\Ponyfm\Models\Track whereIsLatest($value)
* @method static \Illuminate\Database\Eloquent\Builder|\Poniverse\Ponyfm\Models\Track whereIsListed($value)
* @method static \Illuminate\Database\Eloquent\Builder|\Poniverse\Ponyfm\Models\Track whereIsVocal($value)
* @method static \Illuminate\Database\Eloquent\Builder|\Poniverse\Ponyfm\Models\Track whereLicenseId($value)
* @method static \Illuminate\Database\Eloquent\Builder|\Poniverse\Ponyfm\Models\Track whereLyrics($value)
* @method static \Illuminate\Database\Eloquent\Builder|\Poniverse\Ponyfm\Models\Track whereMetadata($value)
* @method static \Illuminate\Database\Eloquent\Builder|\Poniverse\Ponyfm\Models\Track whereOriginalTags($value)
* @method static \Illuminate\Database\Eloquent\Builder|\Poniverse\Ponyfm\Models\Track wherePlayCount($value)
* @method static \Illuminate\Database\Eloquent\Builder|\Poniverse\Ponyfm\Models\Track wherePublishedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|\Poniverse\Ponyfm\Models\Track whereReleasedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|\Poniverse\Ponyfm\Models\Track whereSlug($value)
* @method static \Illuminate\Database\Eloquent\Builder|\Poniverse\Ponyfm\Models\Track whereSource($value)
* @method static \Illuminate\Database\Eloquent\Builder|\Poniverse\Ponyfm\Models\Track whereTitle($value)
* @method static \Illuminate\Database\Eloquent\Builder|\Poniverse\Ponyfm\Models\Track whereTrackNumber($value)
* @method static \Illuminate\Database\Eloquent\Builder|\Poniverse\Ponyfm\Models\Track whereTrackTypeId($value)
* @method static \Illuminate\Database\Eloquent\Builder|\Poniverse\Ponyfm\Models\Track whereUpdatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|\Poniverse\Ponyfm\Models\Track whereUserId($value)
* @method static \Illuminate\Database\Eloquent\Builder|\Poniverse\Ponyfm\Models\Track whereVersionUploadStatus($value)
* @method static \Illuminate\Database\Eloquent\Builder|\Poniverse\Ponyfm\Models\Track whereViewCount($value)
* @method static \Illuminate\Database\Query\Builder|\Poniverse\Ponyfm\Models\Track withTrashed()
* @method static \Illuminate\Database\Query\Builder|\Poniverse\Ponyfm\Models\Track withoutTrashed()
* @mixin \Eloquent
*/
class Track extends Model implements Searchable, Commentable, Favouritable
{
@ -703,7 +746,7 @@ class Track extends Model implements Searchable, Commentable, Favouritable
public function trackFilesForVersion(int $version)
{
return $this->hasMany(TrackFile::class)->where('track_files.version', $version);
return $this->trackFilesForAllVersions()->where('track_files.version', $version);
}
public function notifications()

View file

@ -99,6 +99,8 @@ use Venturecraft\Revisionable\RevisionableTrait;
* @mixin \Eloquent
* @method static \Illuminate\Database\Query\Builder|\Poniverse\Ponyfm\Models\User wherePoniverseId($poniverseId)
* @method static \Illuminate\Database\Query\Builder|\Poniverse\Ponyfm\Models\User whereLinkedToPoniverse()
* @property int $redirect_to
* @method static \Illuminate\Database\Eloquent\Builder|\Poniverse\Ponyfm\Models\User whereRedirectTo($value)
*/
class User extends Model implements AuthenticatableContract, CanResetPasswordContract, \Illuminate\Contracts\Auth\Access\Authorizable, Searchable, Commentable
{
@ -131,7 +133,7 @@ class User extends Model implements AuthenticatableContract, CanResetPasswordCon
]);
}
return !$query;
return $query;
}
/**

View file

@ -19,7 +19,7 @@ class BroadcastServiceProvider extends ServiceProvider
/*
* Authenticate the user's personal channel...
*/
Broadcast::channel('App.User.*', function ($user, $userId) {
Broadcast::channel('App.User.{userId}', function ($user, $userId) {
return (int) $user->id === (int) $userId;
});
}

View file

@ -20,7 +20,6 @@
namespace Poniverse\Ponyfm\Providers;
use Illuminate\Contracts\Events\Dispatcher as DispatcherContract;
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
class EventServiceProvider extends ServiceProvider
@ -31,7 +30,7 @@ class EventServiceProvider extends ServiceProvider
* @var array
*/
protected $listen = [
'Poniverse\Ponyfm\Events\SomeEvent' => [
'Poniverse\Ponyfm\Events\Event' => [
'Poniverse\Ponyfm\Listeners\EventListener',
],
];

View file

@ -1,6 +1,8 @@
#!/usr/bin/env php
<?php
define('LARAVEL_START', microtime(true));
/*
|--------------------------------------------------------------------------
| Register The Auto Loader
@ -13,7 +15,7 @@
|
*/
require __DIR__.'/bootstrap/autoload.php';
require __DIR__.'/vendor/autoload.php';
$app = require_once __DIR__.'/bootstrap/app.php';

View file

@ -1,34 +0,0 @@
<?php
define('LARAVEL_START', microtime(true));
/*
|--------------------------------------------------------------------------
| Register The Composer Auto Loader
|--------------------------------------------------------------------------
|
| Composer provides a convenient, automatically generated class loader
| for our application. We just need to utilize it! We'll require it
| into the script here so that we do not have to worry about the
| loading of any our classes "manually". Feels great to relax.
|
*/
require __DIR__.'/../vendor/autoload.php';
/*
|--------------------------------------------------------------------------
| Include The Compiled Class File
|--------------------------------------------------------------------------
|
| To dramatically increase your application's performance, you may use a
| compiled class file which contains all of the classes commonly used
| by a request. The Artisan "optimize" is used to create this file.
|
*/
$compiledPath = __DIR__.'/cache/compiled.php';
if (file_exists($compiledPath)) {
require $compiledPath;
}

View file

@ -11,7 +11,7 @@
"type": "project",
"require": {
"php": ">=7.0.1",
"laravel/framework": "5.3.*",
"laravel/framework": "5.5.*",
"codescale/ffmpeg-php": "2.7.0",
"intouch/laravel-newrelic": "*",
"barryvdh/laravel-ide-helper": "^2.1",
@ -20,23 +20,26 @@
"venturecraft/revisionable": "^1.23",
"pda/pheanstalk": "~3.0",
"cviebrock/laravel-elasticsearch": "^1.0",
"barryvdh/laravel-debugbar": "^2.2",
"barryvdh/laravel-debugbar": "~2.4",
"predis/predis": "^1.0",
"ksubileau/color-thief-php": "^1.3",
"graham-campbell/exceptions": "^9.1",
"graham-campbell/exceptions": "^10.0",
"minishlink/web-push": "^1.0",
"alsofronie/eloquent-uuid": "^1.0",
"poniverse/api": "dev-rewrite",
"barryvdh/laravel-cors": "^0.8.2"
"barryvdh/laravel-cors": "^0.10",
"laravel/tinker": "^1.0"
},
"require-dev": {
"fzaninotto/faker": "~1.4",
"mockery/mockery": "0.9.*",
"phpunit/phpunit": "~5.0",
"mockery/mockery": "~1.0",
"phpunit/phpunit": "~6.0",
"phpspec/phpspec": "~2.1",
"filp/whoops": "^2.1",
"symfony/dom-crawler": "~3.1",
"symfony/css-selector": "~3.1"
"symfony/css-selector": "~3.1",
"laravel/browser-kit-testing": "2.*",
"nategood/httpful": "^0.2.20"
},
"autoload": {
"classmap": [
@ -50,28 +53,32 @@
}
},
"autoload-dev": {
"classmap": [
"tests/TestCase.php"
]
"psr-4": {
"Tests\\": "tests/"
}
},
"scripts": {
"post-install-cmd": [
"Illuminate\\Foundation\\ComposerScripts::postInstall",
"php artisan optimize"
],
"post-update-cmd": [
"Illuminate\\Foundation\\ComposerScripts::postUpdate",
"php artisan ide-helper:generate",
"php artisan optimize"
],
"post-root-package-install": [
"php -r \"copy('.env.example', '.env');\""
"@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"php artisan key:generate"
"@php artisan key:generate"
],
"post-update-cmd": [
"php artisan ide-helper:generate"
],
"post-autoload-dump": [
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
"@php artisan package:discover"
]
},
"config": {
"preferred-install": "dist"
},
"extra": {
"laravel": {
"dont-discover": [
]
}
}
}

2446
composer.lock generated

File diff suppressed because it is too large Load diff

View file

@ -12,7 +12,8 @@ return [
| any other location as required by the application or its packages.
*/
'name' => 'My Application',
'name' => env('APP_NAME', 'My Application'),
'env' => env('APP_ENV', 'production'),
@ -165,11 +166,8 @@ return [
Poniverse\Ponyfm\Providers\NotificationServiceProvider::class,
Intouch\LaravelNewrelic\NewrelicServiceProvider::class,
Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider::class,
Cviebrock\LaravelElasticsearch\ServiceProvider::class,
GrahamCampbell\Exceptions\ExceptionsServiceProvider::class,
Poniverse\Lib\PoniverseServiceProvider::class,
Barryvdh\Cors\ServiceProvider::class,
],
/*

View file

@ -46,7 +46,7 @@ return [
'file' => [
'driver' => 'file',
'path' => storage_path('framework/cache'),
'path' => storage_path('framework/cache/data'),
],
'memcached' => [
@ -86,6 +86,9 @@ return [
|
*/
'prefix' => 'ponyfm_',
'prefix' => env(
'CACHE_PREFIX',
'ponyfm_'
),
];

View file

@ -1,35 +0,0 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Additional Compiled Classes
|--------------------------------------------------------------------------
|
| Here you may specify additional classes to include in the compiled file
| generated by the `artisan optimize` command. These should be classes
| that are included on basically every request into the application.
|
*/
'files' => [
//
],
/*
|--------------------------------------------------------------------------
| Compiled File Providers
|--------------------------------------------------------------------------
|
| Here you may list service providers which define a "compiles" function
| that returns additional files that should be compiled, providing an
| easy way to get common files from any packages you are utilizing.
|
*/
'providers' => [
//
],
];

View file

@ -2,19 +2,6 @@
return [
/*
|--------------------------------------------------------------------------
| PDO Fetch Style
|--------------------------------------------------------------------------
|
| By default, database results will be returned as instances of the PHP
| stdClass object; however, you may desire to retrieve records in an
| array format for simplicity. Here you can tweak the fetch style.
|
*/
'fetch' => PDO::FETCH_CLASS,
/*
|--------------------------------------------------------------------------
| Default Database Connection Name
@ -64,8 +51,9 @@ return [
'database' => env('DB_DATABASE', 'forge'),
'username' => env('DB_USERNAME', 'forge'),
'password' => env('DB_PASSWORD', ''),
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'unix_socket' => env('DB_SOCKET', ''),
'charset' => 'utf8mb4',
'collation' => 'utf8mb4_unicode_ci',
'prefix' => '',
'strict' => false,
],
@ -119,14 +107,22 @@ return [
'redis' => [
'cluster' => false,
'client' => 'predis',
'options' => [
'cluster' => 'redis',
],
'clusters' => [
'default' => [
'host' => env('REDIS_HOST', 'localhost'),
[
'host' => env('REDIS_HOST', '127.0.0.1'),
'password' => env('REDIS_PASSWORD', null),
'port' => env('REDIS_PORT', 6379),
'database' => 0,
],
],
],
],

View file

@ -12,7 +12,7 @@ return [
|
*/
'enabled' => null,
'enabled' => env('DEBUGBAR_ENABLED', null),
/*
|--------------------------------------------------------------------------
@ -28,9 +28,10 @@ return [
*/
'storage' => [
'enabled' => true,
'driver' => 'redis', // redis, file, pdo
'path' => storage_path() . '/debugbar', // For file driver
'driver' => 'file', // redis, file, pdo, custom
'path' => storage_path('debugbar'), // For file driver
'connection' => null, // Leave null for default connection (Redis/PDO)
'provider' => '' // Instance of StorageInterface for custom driver
],
/*
@ -57,9 +58,22 @@ return [
| The Debugbar can capture Ajax requests and display them. If you don't want this (ie. because of errors),
| you can use this option to disable sending the data through the headers.
|
| Optionally, you can also send ServerTiming headers on ajax requests for the Chrome DevTools.
*/
'capture_ajax' => true,
'add_ajax_timing' => false,
/*
|--------------------------------------------------------------------------
| Custom Error Handler for Deprecated warnings
|--------------------------------------------------------------------------
|
| When enabled, the Debugbar shows deprecated warnings for Symfony components
| in the Messages tab.
|
*/
'error_handler' => false,
/*
|--------------------------------------------------------------------------
@ -91,17 +105,18 @@ return [
'db' => true, // Show database (PDO) queries and bindings
'views' => true, // Views with their data
'route' => true, // Current route information
'auth' => true, // Display Laravel authentication status
'gate' => true, // Display Laravel Gate checks
'session' => true, // Display session data
'symfony_request' => true, // Only one can be enabled..
'mail' => true, // Catch mail messages
'laravel' => false, // Laravel version and environment
'events' => false, // All events fired
'default_request' => false, // Regular or special Symfony request logger
'symfony_request' => true, // Only one can be enabled..
'mail' => true, // Catch mail messages
'logs' => false, // Add the latest log messages
'files' => false, // Show the included files
'config' => false, // Display config settings
'auth' => false, // Display Laravel authentication status
'gate' => false, // Display Laravel Gate checks
'session' => true, // Display session data
'cache' => false, // Display cache events
],
/*
@ -119,11 +134,11 @@ return [
],
'db' => [
'with_params' => true, // Render SQL with the parameters substituted
'backtrace' => true, // Use a backtrace to find the origin of the query in your files.
'timeline' => false, // Add the queries to the timeline
'backtrace' => false, // EXPERIMENTAL: Use a backtrace to find the origin of the query in your files.
'explain' => [ // EXPERIMENTAL: Show EXPLAIN output on queries
'explain' => [ // Show EXPLAIN output on queries
'enabled' => false,
'types' => ['SELECT'], // array('SELECT', 'INSERT', 'UPDATE', 'DELETE'); for MySQL 5.6.3+
'types' => ['SELECT'], // ['SELECT', 'INSERT', 'UPDATE', 'DELETE']; for MySQL 5.6.3+
],
'hints' => true, // Show hints for common mistakes
],
@ -139,6 +154,9 @@ return [
'logs' => [
'file' => null
],
'cache' => [
'values' => true // collect cache values
],
],
/*
@ -146,7 +164,7 @@ return [
| Inject Debugbar in Response
|--------------------------------------------------------------------------
|
| Usually, the debugbar is added just before <body>, by listening to the
| Usually, the debugbar is added just before </body>, by listening to the
| Response after the App is done. If you disable this, you have to add them
| in your template yourself. See http://phpdebugbar.com/docs/rendering.html
|
@ -166,4 +184,13 @@ return [
*/
'route_prefix' => '_debugbar',
/*
|--------------------------------------------------------------------------
| DebugBar route domain
|--------------------------------------------------------------------------
|
| By default DebugBar route served from the same domain that request served.
| To override default domain, specify it as a non-empty value.
*/
'route_domain' => null,
];

View file

@ -8,14 +8,12 @@ return [
|--------------------------------------------------------------------------
|
| Here you may specify the default filesystem disk that should be used
| by the framework. A "local" driver, as well as a variety of cloud
| based drivers are available for your choosing. Just store away!
|
| Supported: "local", "ftp", "s3", "rackspace"
| by the framework. The "local" disk, as well as a variety of cloud
| based disks are available to your application. Just store away!
|
*/
'default' => 'local',
'default' => env('FILESYSTEM_DRIVER', 'local'),
/*
|--------------------------------------------------------------------------
@ -28,7 +26,7 @@ return [
|
*/
'cloud' => 's3',
'cloud' => env('FILESYSTEM_CLOUD', 's3'),
/*
|--------------------------------------------------------------------------
@ -39,6 +37,8 @@ return [
| may even configure multiple disks of the same driver. Defaults have
| been setup for each driver as an example of the required options.
|
| Supported Drivers: "local", "ftp", "s3", "rackspace"
|
*/
'disks' => [
@ -53,36 +53,19 @@ return [
'root' => storage_path('app').'/test-files',
],
'ftp' => [
'driver' => 'ftp',
'host' => 'ftp.example.com',
'username' => 'your-username',
'password' => 'your-password',
// Optional FTP Settings...
// 'port' => 21,
// 'root' => '',
// 'passive' => true,
// 'ssl' => true,
// 'timeout' => 30,
'public' => [
'driver' => 'local',
'root' => storage_path('app/public'),
'url' => env('APP_URL').'/storage',
'visibility' => 'public',
],
's3' => [
'driver' => 's3',
'key' => 'your-key',
'secret' => 'your-secret',
'region' => 'your-region',
'bucket' => 'your-bucket',
],
'rackspace' => [
'driver' => 'rackspace',
'username' => 'your-username',
'key' => 'your-key',
'container' => 'your-container',
'endpoint' => 'https://identity.api.rackspacecloud.com/v2.0/',
'region' => 'IAD',
'url_type' => 'publicURL',
'key' => env('AWS_ACCESS_KEY_ID'),
'secret' => env('AWS_SECRET_ACCESS_KEY'),
'region' => env('AWS_DEFAULT_REGION'),
'bucket' => env('AWS_BUCKET'),
],
],

View file

@ -11,7 +11,8 @@ return [
| sending of e-mail. You may specify which one you're using throughout
| your application here. By default, Laravel is setup for SMTP mail.
|
| Supported: "smtp", "mail", "sendmail", "mailgun", "mandrill", "ses", "log"
| Supported: "smtp", "sendmail", "mailgun", "mandrill", "ses",
| "sparkpost", "log", "array"
|
*/
@ -54,7 +55,10 @@ return [
|
*/
'from' => ['address' => 'hello@pony.fm', 'name' => 'Pony.fm'],
'from' => [
'address' => env('MAIL_FROM_ADDRESS', 'hello@pony.fm'),
'name' => env('MAIL_FROM_NAME', 'Pony.fm'),
],
/*
|--------------------------------------------------------------------------
@ -82,17 +86,6 @@ return [
'username' => env('MAIL_USERNAME'),
/*
|--------------------------------------------------------------------------
| SMTP Server Password
|--------------------------------------------------------------------------
|
| Here you may set the password required by your SMTP server to send out
| messages from your application. This will be given to the server on
| connection so that the application will be able to send messages.
|
*/
'password' => env('MAIL_PASSWORD'),
/*
@ -108,5 +101,23 @@ return [
'sendmail' => '/usr/sbin/sendmail -bs',
/*
|--------------------------------------------------------------------------
| Markdown Mail Settings
|--------------------------------------------------------------------------
|
| If you are using Markdown based email rendering, you may configure your
| theme and component paths here, allowing you to customize the design
| of the emails. Or, you may simply stick with the Laravel defaults!
|
*/
'markdown' => [
'theme' => 'default',
'paths' => [
resource_path('views/vendor/mail'),
],
],
];

View file

@ -29,7 +29,7 @@ return [
|
*/
'lifetime' => 120,
'lifetime' => env('SESSION_LIFETIME', 120),
'expire_on_close' => false,
@ -109,7 +109,10 @@ return [
|
*/
'cookie' => 'IfYouAreReadingThisWeWantToWorkWithYou_PleaseDropAnEmailTo_HelloAtPoniverseDotNet',
'cookie' => env(
'SESSION_COOKIE',
'IfYouAreReadingThisWeWantToWorkWithYou_PleaseDropAnEmailTo_HelloAtPoniverseDotNet'
),
/*
|--------------------------------------------------------------------------
@ -163,4 +166,19 @@ return [
'http_only' => true,
/*
|--------------------------------------------------------------------------
| Same-Site Cookies
|--------------------------------------------------------------------------
|
| This option determines how your cookies behave when cross-site requests
| take place, and can be used to mitigate CSRF attacks. By default, we
| do not enable this as other CSRF protection services are in place.
|
| Supported: "lax", "strict"
|
*/
'same_site' => null,
];

View file

@ -14,7 +14,7 @@ return [
*/
'paths' => [
realpath(base_path('resources/views')),
resource_path('views'),
],
/*

View file

@ -23,9 +23,9 @@
| Model Factories
|--------------------------------------------------------------------------
|
| Here you may define all of your model factories. Model factories give
| you a convenient way to create models for testing and seeding your
| database. Just tell the factory how a default model should look.
| This directory should contain each of the model factory definitions for
| your application. Factories provide a convenient way to generate new
| model instances for testing / seeding your application's database.
|
*/

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit backupGlobals="false"
backupStaticAttributes="false"
bootstrap="bootstrap/autoload.php"
bootstrap="vendor/autoload.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"

View file

@ -4,9 +4,11 @@
* Laravel - A PHP Framework For Web Artisans
*
* @package Laravel
* @author Taylor Otwell <taylorotwell@gmail.com>
* @author Taylor Otwell <taylor@laravel.com>
*/
define('LARAVEL_START', microtime(true));
/*
|--------------------------------------------------------------------------
| Register The Auto Loader
@ -15,11 +17,11 @@
| Composer provides a convenient, automatically generated class loader for
| our application. We just need to utilize it! We'll simply require it
| into the script here so that we don't have to worry about manual
| loading any of our classes later on. It feels nice to relax.
| loading any of our classes later on. It feels great to relax.
|
*/
require __DIR__.'/../bootstrap/autoload.php';
require __DIR__.'/../vendor/autoload.php';
/*
|--------------------------------------------------------------------------

2
storage/debugbar/.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
*
!.gitignore

View file

@ -1,5 +1,7 @@
<?php
namespace Tests;
/**
* Pony.fm - A community for pony fan music.
* Copyright (C) 2015 Peter Deltchev
@ -18,9 +20,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
use Illuminate\Foundation\Testing\WithoutMiddleware;
use Illuminate\Foundation\Testing\DatabaseMigrations;
use Illuminate\Foundation\Testing\DatabaseTransactions;
use Poniverse\Lib\AccessToken;
use Poniverse\Ponyfm\Models\User;
@ -40,7 +40,7 @@ class ApiAuthTest extends TestCase
$accessTokenInfo->setIsActive(true);
$accessTokenInfo->setScopes(['basic', 'ponyfm:tracks:upload']);
$poniverse = Mockery::mock('overload:Poniverse\Lib\OAuth2\PoniverseProvider');
$poniverse = \Mockery::mock('overload:Poniverse\Lib\OAuth2\PoniverseProvider');
$poniverse->shouldReceive('getResourceOwner')
->andReturn(new \Poniverse\Lib\Entity\Poniverse\User([
'id' => $user->id,
@ -50,7 +50,7 @@ class ApiAuthTest extends TestCase
]));
$poniverse->shouldReceive('setAccessToken');
$accessTokenService = Mockery::mock('overload:Poniverse\Lib\Service\Poniverse\Meta');
$accessTokenService = \Mockery::mock('overload:Poniverse\Lib\Service\Poniverse\Meta');
$accessTokenService->shouldReceive('introspect')
->andReturn($accessTokenInfo);
@ -68,7 +68,7 @@ class ApiAuthTest extends TestCase
$accessTokenInfo->setClientId('Unicorns and rainbows');
$accessTokenInfo->setScopes(['basic', 'ponyfm:tracks:upload']);
$poniverse = Mockery::mock('overload:Poniverse\Lib\OAuth2\PoniverseProvider');
$poniverse = \Mockery::mock('overload:Poniverse\Lib\OAuth2\PoniverseProvider');
$poniverse->shouldReceive('getResourceOwner')
->andReturn(new \Poniverse\Lib\Entity\Poniverse\User([
'id' => $user->id,
@ -78,7 +78,7 @@ class ApiAuthTest extends TestCase
]));
$poniverse->shouldReceive('setAccessToken');
$accessTokenService = Mockery::mock('overload:Poniverse\Lib\Service\Poniverse\Meta');
$accessTokenService = \Mockery::mock('overload:Poniverse\Lib\Service\Poniverse\Meta');
$accessTokenService
->shouldReceive('introspect')
->andReturn($accessTokenInfo);

View file

@ -1,5 +1,7 @@
<?php
namespace Tests;
/**
* Pony.fm - A community for pony fan music.
* Copyright (C) 2015-2017 Peter Deltchev

View file

@ -1,4 +1,10 @@
<?php
namespace Tests;
use Illuminate\Contracts\Console\Kernel;
use Storage;
use Laravel\BrowserKitTesting\TestCase as BaseTestCase;
use Poniverse\Ponyfm\Models\User;
/**
@ -19,7 +25,7 @@ use Poniverse\Ponyfm\Models\User;
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
class TestCase extends Illuminate\Foundation\Testing\TestCase
class TestCase extends BaseTestCase
{
/**
* The base URL to use while testing the application.
@ -46,15 +52,14 @@ class TestCase extends Illuminate\Foundation\Testing\TestCase
{
$app = require __DIR__.'/../bootstrap/app.php';
$app->make(Illuminate\Contracts\Console\Kernel::class)->bootstrap();
$app->make(Kernel::class)->bootstrap();
$this->getTestFiles();
return $app;
}
/**
* @before
*/
public function initializeTestFiles()
public function getTestFiles()
{
// Ensure we have the Pony.fm test files
if (!static::$initializedFiles) {
@ -135,8 +140,8 @@ class TestCase extends Illuminate\Foundation\Testing\TestCase
protected function callUploadWithParameters(array $parameters, array $files = [])
{
$this->expectsJobs([
Poniverse\Ponyfm\Jobs\EncodeTrackFile::class,
Poniverse\Ponyfm\Jobs\UpdateSearchIndexForEntity::class
\Poniverse\Ponyfm\Jobs\EncodeTrackFile::class,
\Poniverse\Ponyfm\Jobs\UpdateSearchIndexForEntity::class
]);
$this->user = factory(User::class)->create();