mirror of
https://github.com/Poniverse/Pony.fm.git
synced 2024-11-22 04:58:01 +01:00
Merge pull request #124 from Lavoaster/laravel-upgrades
Upgrade to Laravel 5.5
This commit is contained in:
commit
bd4b78c690
37 changed files with 1733 additions and 1261 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -1,6 +1,7 @@
|
||||||
/vendor
|
/vendor
|
||||||
/node_modules
|
/node_modules
|
||||||
/public/build
|
/public/build
|
||||||
|
/public/hot
|
||||||
/logs
|
/logs
|
||||||
Homestead.yaml
|
Homestead.yaml
|
||||||
/public/storage
|
/public/storage
|
||||||
|
@ -9,4 +10,6 @@ Homestead.yaml
|
||||||
_ide_helper.php
|
_ide_helper.php
|
||||||
.idea
|
.idea
|
||||||
resources/views/emails/html
|
resources/views/emails/html
|
||||||
|
npm-debug.log
|
||||||
|
yarn-error.log
|
||||||
/composer.phar
|
/composer.phar
|
||||||
|
|
|
@ -31,24 +31,7 @@ class Kernel extends ConsoleKernel
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
protected $commands = [
|
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)
|
protected function schedule(Schedule $schedule)
|
||||||
{
|
{
|
||||||
|
// $schedule->command('inspire')
|
||||||
|
// ->hourly();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Register the Closure based commands for the application.
|
* Register the Closure based commands for the application.
|
||||||
*
|
*
|
||||||
|
@ -67,6 +53,8 @@ class Kernel extends ConsoleKernel
|
||||||
*/
|
*/
|
||||||
protected function commands()
|
protected function commands()
|
||||||
{
|
{
|
||||||
|
$this->load(__DIR__.'/Commands');
|
||||||
|
|
||||||
require base_path('routes/console.php');
|
require base_path('routes/console.php');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,7 +22,7 @@ namespace Poniverse\Ponyfm\Exceptions;
|
||||||
|
|
||||||
use Exception;
|
use Exception;
|
||||||
use Illuminate\Auth\AuthenticationException;
|
use Illuminate\Auth\AuthenticationException;
|
||||||
use GrahamCampbell\Exceptions\NewExceptionHandler as ExceptionHandler;
|
use GrahamCampbell\Exceptions\ExceptionHandler;
|
||||||
|
|
||||||
class Handler extends ExceptionHandler
|
class Handler extends ExceptionHandler
|
||||||
{
|
{
|
||||||
|
@ -32,12 +32,20 @@ class Handler extends ExceptionHandler
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
protected $dontReport = [
|
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.
|
* Report or log an exception.
|
||||||
*
|
*
|
||||||
|
@ -62,19 +70,4 @@ class Handler extends ExceptionHandler
|
||||||
{
|
{
|
||||||
return parent::render($request, $e);
|
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');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -80,7 +80,7 @@ class TracksController extends Controller
|
||||||
|
|
||||||
public function getOembed(Request $request)
|
public function getOembed(Request $request)
|
||||||
{
|
{
|
||||||
if (!$request->has('url')) {
|
if (!$request->filled('url')) {
|
||||||
App::abort(404);
|
App::abort(404);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -57,6 +57,7 @@ class Kernel extends HttpKernel
|
||||||
'can' => \Poniverse\Ponyfm\Http\Middleware\Authorize::class,
|
'can' => \Poniverse\Ponyfm\Http\Middleware\Authorize::class,
|
||||||
'json-exceptions' => \Poniverse\Ponyfm\Http\Middleware\JsonExceptions::class,
|
'json-exceptions' => \Poniverse\Ponyfm\Http\Middleware\JsonExceptions::class,
|
||||||
'guest' => \Poniverse\Ponyfm\Http\Middleware\RedirectIfAuthenticated::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,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,9 +20,9 @@
|
||||||
|
|
||||||
namespace Poniverse\Ponyfm\Http\Middleware;
|
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.
|
* The names of the cookies that should not be encrypted.
|
||||||
|
|
|
@ -20,9 +20,9 @@
|
||||||
|
|
||||||
namespace Poniverse\Ponyfm\Http\Middleware;
|
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.
|
* The URIs that should be excluded from CSRF verification.
|
||||||
|
|
|
@ -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 whereResourceId($value)
|
||||||
* @method static \Illuminate\Database\Query\Builder|\Poniverse\Ponyfm\Models\Activity whereDeletedAt($value)
|
* @method static \Illuminate\Database\Query\Builder|\Poniverse\Ponyfm\Models\Activity whereDeletedAt($value)
|
||||||
* @mixin \Eloquent
|
* @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
|
class Activity extends Model
|
||||||
{
|
{
|
||||||
|
|
|
@ -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 whereUpdatedAt($value)
|
||||||
* @method static \Illuminate\Database\Query\Builder|\Poniverse\Ponyfm\Models\Album whereDeletedAt($value)
|
* @method static \Illuminate\Database\Query\Builder|\Poniverse\Ponyfm\Models\Album whereDeletedAt($value)
|
||||||
* @mixin \Eloquent
|
* @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
|
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';
|
protected $table = 'albums';
|
||||||
|
|
|
@ -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 whereAlbumId($value)
|
||||||
* @method static \Illuminate\Database\Query\Builder|\Poniverse\Ponyfm\Models\Comment wherePlaylistId($value)
|
* @method static \Illuminate\Database\Query\Builder|\Poniverse\Ponyfm\Models\Comment wherePlaylistId($value)
|
||||||
* @mixin \Eloquent
|
* @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
|
class Comment extends Model
|
||||||
{
|
{
|
||||||
|
|
|
@ -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 whereUpdatedAt($value)
|
||||||
* @method static \Illuminate\Database\Query\Builder|\Poniverse\Ponyfm\Models\EmailSubscription whereDeletedAt($value)
|
* @method static \Illuminate\Database\Query\Builder|\Poniverse\Ponyfm\Models\EmailSubscription whereDeletedAt($value)
|
||||||
* @mixin \Eloquent
|
* @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
|
class EmailSubscription extends Model
|
||||||
{
|
{
|
||||||
|
|
|
@ -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 whereCreatedAt($value)
|
||||||
* @method static \Illuminate\Database\Query\Builder|\Poniverse\Ponyfm\Models\Genre whereUpdatedAt($value)
|
* @method static \Illuminate\Database\Query\Builder|\Poniverse\Ponyfm\Models\Genre whereUpdatedAt($value)
|
||||||
* @mixin \Eloquent
|
* @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
|
class Genre extends Model
|
||||||
{
|
{
|
||||||
|
|
|
@ -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 whereUpdatedAt($value)
|
||||||
* @method static \Illuminate\Database\Query\Builder|\Poniverse\Ponyfm\Models\Playlist whereDeletedAt($value)
|
* @method static \Illuminate\Database\Query\Builder|\Poniverse\Ponyfm\Models\Playlist whereDeletedAt($value)
|
||||||
* @mixin \Eloquent
|
* @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
|
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)
|
public static function mapPublicPlaylistShow(Playlist $playlist)
|
||||||
|
|
|
@ -102,6 +102,49 @@ use Venturecraft\Revisionable\RevisionableTrait;
|
||||||
* @method static \Illuminate\Database\Query\Builder|\Poniverse\Ponyfm\Models\Track mlpma()
|
* @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[] $notifications
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection|\Poniverse\Ponyfm\Models\Activity[] $activities
|
* @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
|
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)
|
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()
|
public function notifications()
|
||||||
|
|
|
@ -99,6 +99,8 @@ use Venturecraft\Revisionable\RevisionableTrait;
|
||||||
* @mixin \Eloquent
|
* @mixin \Eloquent
|
||||||
* @method static \Illuminate\Database\Query\Builder|\Poniverse\Ponyfm\Models\User wherePoniverseId($poniverseId)
|
* @method static \Illuminate\Database\Query\Builder|\Poniverse\Ponyfm\Models\User wherePoniverseId($poniverseId)
|
||||||
* @method static \Illuminate\Database\Query\Builder|\Poniverse\Ponyfm\Models\User whereLinkedToPoniverse()
|
* @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
|
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -19,7 +19,7 @@ class BroadcastServiceProvider extends ServiceProvider
|
||||||
/*
|
/*
|
||||||
* Authenticate the user's personal channel...
|
* 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;
|
return (int) $user->id === (int) $userId;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,7 +20,6 @@
|
||||||
|
|
||||||
namespace Poniverse\Ponyfm\Providers;
|
namespace Poniverse\Ponyfm\Providers;
|
||||||
|
|
||||||
use Illuminate\Contracts\Events\Dispatcher as DispatcherContract;
|
|
||||||
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
|
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
|
||||||
|
|
||||||
class EventServiceProvider extends ServiceProvider
|
class EventServiceProvider extends ServiceProvider
|
||||||
|
@ -31,7 +30,7 @@ class EventServiceProvider extends ServiceProvider
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
protected $listen = [
|
protected $listen = [
|
||||||
'Poniverse\Ponyfm\Events\SomeEvent' => [
|
'Poniverse\Ponyfm\Events\Event' => [
|
||||||
'Poniverse\Ponyfm\Listeners\EventListener',
|
'Poniverse\Ponyfm\Listeners\EventListener',
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
|
4
artisan
4
artisan
|
@ -1,6 +1,8 @@
|
||||||
#!/usr/bin/env php
|
#!/usr/bin/env php
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
define('LARAVEL_START', microtime(true));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| Register The Auto Loader
|
| 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';
|
$app = require_once __DIR__.'/bootstrap/app.php';
|
||||||
|
|
||||||
|
|
|
@ -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;
|
|
||||||
}
|
|
|
@ -11,7 +11,7 @@
|
||||||
"type": "project",
|
"type": "project",
|
||||||
"require": {
|
"require": {
|
||||||
"php": ">=7.0.1",
|
"php": ">=7.0.1",
|
||||||
"laravel/framework": "5.3.*",
|
"laravel/framework": "5.5.*",
|
||||||
"codescale/ffmpeg-php": "2.7.0",
|
"codescale/ffmpeg-php": "2.7.0",
|
||||||
"intouch/laravel-newrelic": "*",
|
"intouch/laravel-newrelic": "*",
|
||||||
"barryvdh/laravel-ide-helper": "^2.1",
|
"barryvdh/laravel-ide-helper": "^2.1",
|
||||||
|
@ -20,23 +20,26 @@
|
||||||
"venturecraft/revisionable": "^1.23",
|
"venturecraft/revisionable": "^1.23",
|
||||||
"pda/pheanstalk": "~3.0",
|
"pda/pheanstalk": "~3.0",
|
||||||
"cviebrock/laravel-elasticsearch": "^1.0",
|
"cviebrock/laravel-elasticsearch": "^1.0",
|
||||||
"barryvdh/laravel-debugbar": "^2.2",
|
"barryvdh/laravel-debugbar": "~2.4",
|
||||||
"predis/predis": "^1.0",
|
"predis/predis": "^1.0",
|
||||||
"ksubileau/color-thief-php": "^1.3",
|
"ksubileau/color-thief-php": "^1.3",
|
||||||
"graham-campbell/exceptions": "^9.1",
|
"graham-campbell/exceptions": "^10.0",
|
||||||
"minishlink/web-push": "^1.0",
|
"minishlink/web-push": "^1.0",
|
||||||
"alsofronie/eloquent-uuid": "^1.0",
|
"alsofronie/eloquent-uuid": "^1.0",
|
||||||
"poniverse/api": "dev-rewrite",
|
"poniverse/api": "dev-rewrite",
|
||||||
"barryvdh/laravel-cors": "^0.8.2"
|
"barryvdh/laravel-cors": "^0.10",
|
||||||
|
"laravel/tinker": "^1.0"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"fzaninotto/faker": "~1.4",
|
"fzaninotto/faker": "~1.4",
|
||||||
"mockery/mockery": "0.9.*",
|
"mockery/mockery": "~1.0",
|
||||||
"phpunit/phpunit": "~5.0",
|
"phpunit/phpunit": "~6.0",
|
||||||
"phpspec/phpspec": "~2.1",
|
"phpspec/phpspec": "~2.1",
|
||||||
"filp/whoops": "^2.1",
|
"filp/whoops": "^2.1",
|
||||||
"symfony/dom-crawler": "~3.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": {
|
"autoload": {
|
||||||
"classmap": [
|
"classmap": [
|
||||||
|
@ -50,28 +53,32 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"autoload-dev": {
|
"autoload-dev": {
|
||||||
"classmap": [
|
"psr-4": {
|
||||||
"tests/TestCase.php"
|
"Tests\\": "tests/"
|
||||||
]
|
}
|
||||||
},
|
},
|
||||||
"scripts": {
|
"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": [
|
"post-root-package-install": [
|
||||||
"php -r \"copy('.env.example', '.env');\""
|
"@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
|
||||||
],
|
],
|
||||||
"post-create-project-cmd": [
|
"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": {
|
"config": {
|
||||||
"preferred-install": "dist"
|
"preferred-install": "dist"
|
||||||
|
},
|
||||||
|
"extra": {
|
||||||
|
"laravel": {
|
||||||
|
"dont-discover": [
|
||||||
|
]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
2446
composer.lock
generated
2446
composer.lock
generated
File diff suppressed because it is too large
Load diff
|
@ -12,7 +12,8 @@ return [
|
||||||
| any other location as required by the application or its packages.
|
| 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'),
|
'env' => env('APP_ENV', 'production'),
|
||||||
|
|
||||||
|
@ -165,11 +166,8 @@ return [
|
||||||
Poniverse\Ponyfm\Providers\NotificationServiceProvider::class,
|
Poniverse\Ponyfm\Providers\NotificationServiceProvider::class,
|
||||||
|
|
||||||
Intouch\LaravelNewrelic\NewrelicServiceProvider::class,
|
Intouch\LaravelNewrelic\NewrelicServiceProvider::class,
|
||||||
Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider::class,
|
|
||||||
Cviebrock\LaravelElasticsearch\ServiceProvider::class,
|
Cviebrock\LaravelElasticsearch\ServiceProvider::class,
|
||||||
GrahamCampbell\Exceptions\ExceptionsServiceProvider::class,
|
|
||||||
Poniverse\Lib\PoniverseServiceProvider::class,
|
Poniverse\Lib\PoniverseServiceProvider::class,
|
||||||
Barryvdh\Cors\ServiceProvider::class,
|
|
||||||
],
|
],
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -46,7 +46,7 @@ return [
|
||||||
|
|
||||||
'file' => [
|
'file' => [
|
||||||
'driver' => 'file',
|
'driver' => 'file',
|
||||||
'path' => storage_path('framework/cache'),
|
'path' => storage_path('framework/cache/data'),
|
||||||
],
|
],
|
||||||
|
|
||||||
'memcached' => [
|
'memcached' => [
|
||||||
|
@ -86,6 +86,9 @@ return [
|
||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
'prefix' => 'ponyfm_',
|
'prefix' => env(
|
||||||
|
'CACHE_PREFIX',
|
||||||
|
'ponyfm_'
|
||||||
|
),
|
||||||
|
|
||||||
];
|
];
|
||||||
|
|
|
@ -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' => [
|
|
||||||
//
|
|
||||||
],
|
|
||||||
|
|
||||||
];
|
|
|
@ -2,19 +2,6 @@
|
||||||
|
|
||||||
return [
|
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
|
| Default Database Connection Name
|
||||||
|
@ -64,8 +51,9 @@ return [
|
||||||
'database' => env('DB_DATABASE', 'forge'),
|
'database' => env('DB_DATABASE', 'forge'),
|
||||||
'username' => env('DB_USERNAME', 'forge'),
|
'username' => env('DB_USERNAME', 'forge'),
|
||||||
'password' => env('DB_PASSWORD', ''),
|
'password' => env('DB_PASSWORD', ''),
|
||||||
'charset' => 'utf8',
|
'unix_socket' => env('DB_SOCKET', ''),
|
||||||
'collation' => 'utf8_unicode_ci',
|
'charset' => 'utf8mb4',
|
||||||
|
'collation' => 'utf8mb4_unicode_ci',
|
||||||
'prefix' => '',
|
'prefix' => '',
|
||||||
'strict' => false,
|
'strict' => false,
|
||||||
],
|
],
|
||||||
|
@ -119,14 +107,22 @@ return [
|
||||||
|
|
||||||
'redis' => [
|
'redis' => [
|
||||||
|
|
||||||
'cluster' => false,
|
'client' => 'predis',
|
||||||
|
|
||||||
|
'options' => [
|
||||||
|
'cluster' => 'redis',
|
||||||
|
],
|
||||||
|
|
||||||
|
'clusters' => [
|
||||||
'default' => [
|
'default' => [
|
||||||
'host' => env('REDIS_HOST', 'localhost'),
|
[
|
||||||
|
'host' => env('REDIS_HOST', '127.0.0.1'),
|
||||||
'password' => env('REDIS_PASSWORD', null),
|
'password' => env('REDIS_PASSWORD', null),
|
||||||
'port' => env('REDIS_PORT', 6379),
|
'port' => env('REDIS_PORT', 6379),
|
||||||
'database' => 0,
|
'database' => 0,
|
||||||
],
|
],
|
||||||
|
],
|
||||||
|
],
|
||||||
|
|
||||||
],
|
],
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@ return [
|
||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
'enabled' => null,
|
'enabled' => env('DEBUGBAR_ENABLED', null),
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
@ -28,9 +28,10 @@ return [
|
||||||
*/
|
*/
|
||||||
'storage' => [
|
'storage' => [
|
||||||
'enabled' => true,
|
'enabled' => true,
|
||||||
'driver' => 'redis', // redis, file, pdo
|
'driver' => 'file', // redis, file, pdo, custom
|
||||||
'path' => storage_path() . '/debugbar', // For file driver
|
'path' => storage_path('debugbar'), // For file driver
|
||||||
'connection' => null, // Leave null for default connection (Redis/PDO)
|
'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),
|
| 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.
|
| 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,
|
'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
|
'db' => true, // Show database (PDO) queries and bindings
|
||||||
'views' => true, // Views with their data
|
'views' => true, // Views with their data
|
||||||
'route' => true, // Current route information
|
'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
|
'laravel' => false, // Laravel version and environment
|
||||||
'events' => false, // All events fired
|
'events' => false, // All events fired
|
||||||
'default_request' => false, // Regular or special Symfony request logger
|
'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
|
'logs' => false, // Add the latest log messages
|
||||||
'files' => false, // Show the included files
|
'files' => false, // Show the included files
|
||||||
'config' => false, // Display config settings
|
'config' => false, // Display config settings
|
||||||
'auth' => false, // Display Laravel authentication status
|
'cache' => false, // Display cache events
|
||||||
'gate' => false, // Display Laravel Gate checks
|
|
||||||
'session' => true, // Display session data
|
|
||||||
],
|
],
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -119,11 +134,11 @@ return [
|
||||||
],
|
],
|
||||||
'db' => [
|
'db' => [
|
||||||
'with_params' => true, // Render SQL with the parameters substituted
|
'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
|
'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' => [ // Show EXPLAIN output on queries
|
||||||
'explain' => [ // EXPERIMENTAL: Show EXPLAIN output on queries
|
|
||||||
'enabled' => false,
|
'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
|
'hints' => true, // Show hints for common mistakes
|
||||||
],
|
],
|
||||||
|
@ -139,6 +154,9 @@ return [
|
||||||
'logs' => [
|
'logs' => [
|
||||||
'file' => null
|
'file' => null
|
||||||
],
|
],
|
||||||
|
'cache' => [
|
||||||
|
'values' => true // collect cache values
|
||||||
|
],
|
||||||
],
|
],
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -146,7 +164,7 @@ return [
|
||||||
| Inject Debugbar in Response
|
| 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
|
| 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
|
| in your template yourself. See http://phpdebugbar.com/docs/rendering.html
|
||||||
|
|
|
|
||||||
|
@ -166,4 +184,13 @@ return [
|
||||||
*/
|
*/
|
||||||
'route_prefix' => '_debugbar',
|
'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,
|
||||||
];
|
];
|
||||||
|
|
|
@ -8,14 +8,12 @@ return [
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
|
||||||
| Here you may specify the default filesystem disk that should be used
|
| 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
|
| by the framework. The "local" disk, as well as a variety of cloud
|
||||||
| based drivers are available for your choosing. Just store away!
|
| based disks are available to your application. Just store away!
|
||||||
|
|
|
||||||
| Supported: "local", "ftp", "s3", "rackspace"
|
|
||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
'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
|
| may even configure multiple disks of the same driver. Defaults have
|
||||||
| been setup for each driver as an example of the required options.
|
| been setup for each driver as an example of the required options.
|
||||||
|
|
|
|
||||||
|
| Supported Drivers: "local", "ftp", "s3", "rackspace"
|
||||||
|
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
'disks' => [
|
'disks' => [
|
||||||
|
@ -53,36 +53,19 @@ return [
|
||||||
'root' => storage_path('app').'/test-files',
|
'root' => storage_path('app').'/test-files',
|
||||||
],
|
],
|
||||||
|
|
||||||
'ftp' => [
|
'public' => [
|
||||||
'driver' => 'ftp',
|
'driver' => 'local',
|
||||||
'host' => 'ftp.example.com',
|
'root' => storage_path('app/public'),
|
||||||
'username' => 'your-username',
|
'url' => env('APP_URL').'/storage',
|
||||||
'password' => 'your-password',
|
'visibility' => 'public',
|
||||||
|
|
||||||
// Optional FTP Settings...
|
|
||||||
// 'port' => 21,
|
|
||||||
// 'root' => '',
|
|
||||||
// 'passive' => true,
|
|
||||||
// 'ssl' => true,
|
|
||||||
// 'timeout' => 30,
|
|
||||||
],
|
],
|
||||||
|
|
||||||
's3' => [
|
's3' => [
|
||||||
'driver' => 's3',
|
'driver' => 's3',
|
||||||
'key' => 'your-key',
|
'key' => env('AWS_ACCESS_KEY_ID'),
|
||||||
'secret' => 'your-secret',
|
'secret' => env('AWS_SECRET_ACCESS_KEY'),
|
||||||
'region' => 'your-region',
|
'region' => env('AWS_DEFAULT_REGION'),
|
||||||
'bucket' => 'your-bucket',
|
'bucket' => env('AWS_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',
|
|
||||||
],
|
],
|
||||||
|
|
||||||
],
|
],
|
||||||
|
|
|
@ -11,7 +11,8 @@ return [
|
||||||
| sending of e-mail. You may specify which one you're using throughout
|
| sending of e-mail. You may specify which one you're using throughout
|
||||||
| your application here. By default, Laravel is setup for SMTP mail.
|
| 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'),
|
'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'),
|
'password' => env('MAIL_PASSWORD'),
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -108,5 +101,23 @@ return [
|
||||||
|
|
||||||
'sendmail' => '/usr/sbin/sendmail -bs',
|
'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'),
|
||||||
|
],
|
||||||
|
],
|
||||||
|
|
||||||
];
|
];
|
||||||
|
|
|
@ -29,7 +29,7 @@ return [
|
||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
'lifetime' => 120,
|
'lifetime' => env('SESSION_LIFETIME', 120),
|
||||||
|
|
||||||
'expire_on_close' => false,
|
'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,
|
'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,
|
||||||
|
|
||||||
];
|
];
|
||||||
|
|
|
@ -14,7 +14,7 @@ return [
|
||||||
*/
|
*/
|
||||||
|
|
||||||
'paths' => [
|
'paths' => [
|
||||||
realpath(base_path('resources/views')),
|
resource_path('views'),
|
||||||
],
|
],
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -23,9 +23,9 @@
|
||||||
| Model Factories
|
| Model Factories
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
|
||||||
| Here you may define all of your model factories. Model factories give
|
| This directory should contain each of the model factory definitions for
|
||||||
| you a convenient way to create models for testing and seeding your
|
| your application. Factories provide a convenient way to generate new
|
||||||
| database. Just tell the factory how a default model should look.
|
| model instances for testing / seeding your application's database.
|
||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<phpunit backupGlobals="false"
|
<phpunit backupGlobals="false"
|
||||||
backupStaticAttributes="false"
|
backupStaticAttributes="false"
|
||||||
bootstrap="bootstrap/autoload.php"
|
bootstrap="vendor/autoload.php"
|
||||||
colors="true"
|
colors="true"
|
||||||
convertErrorsToExceptions="true"
|
convertErrorsToExceptions="true"
|
||||||
convertNoticesToExceptions="true"
|
convertNoticesToExceptions="true"
|
||||||
|
|
|
@ -4,9 +4,11 @@
|
||||||
* Laravel - A PHP Framework For Web Artisans
|
* Laravel - A PHP Framework For Web Artisans
|
||||||
*
|
*
|
||||||
* @package Laravel
|
* @package Laravel
|
||||||
* @author Taylor Otwell <taylorotwell@gmail.com>
|
* @author Taylor Otwell <taylor@laravel.com>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
define('LARAVEL_START', microtime(true));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| Register The Auto Loader
|
| Register The Auto Loader
|
||||||
|
@ -15,11 +17,11 @@
|
||||||
| Composer provides a convenient, automatically generated class loader for
|
| Composer provides a convenient, automatically generated class loader for
|
||||||
| our application. We just need to utilize it! We'll simply require it
|
| 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
|
| 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
2
storage/debugbar/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
*
|
||||||
|
!.gitignore
|
|
@ -1,5 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
namespace Tests;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Pony.fm - A community for pony fan music.
|
* Pony.fm - A community for pony fan music.
|
||||||
* Copyright (C) 2015 Peter Deltchev
|
* Copyright (C) 2015 Peter Deltchev
|
||||||
|
@ -18,9 +20,7 @@
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* 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\DatabaseMigrations;
|
||||||
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
|
||||||
use Poniverse\Lib\AccessToken;
|
use Poniverse\Lib\AccessToken;
|
||||||
use Poniverse\Ponyfm\Models\User;
|
use Poniverse\Ponyfm\Models\User;
|
||||||
|
|
||||||
|
@ -40,7 +40,7 @@ class ApiAuthTest extends TestCase
|
||||||
$accessTokenInfo->setIsActive(true);
|
$accessTokenInfo->setIsActive(true);
|
||||||
$accessTokenInfo->setScopes(['basic', 'ponyfm:tracks:upload']);
|
$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')
|
$poniverse->shouldReceive('getResourceOwner')
|
||||||
->andReturn(new \Poniverse\Lib\Entity\Poniverse\User([
|
->andReturn(new \Poniverse\Lib\Entity\Poniverse\User([
|
||||||
'id' => $user->id,
|
'id' => $user->id,
|
||||||
|
@ -50,7 +50,7 @@ class ApiAuthTest extends TestCase
|
||||||
]));
|
]));
|
||||||
$poniverse->shouldReceive('setAccessToken');
|
$poniverse->shouldReceive('setAccessToken');
|
||||||
|
|
||||||
$accessTokenService = Mockery::mock('overload:Poniverse\Lib\Service\Poniverse\Meta');
|
$accessTokenService = \Mockery::mock('overload:Poniverse\Lib\Service\Poniverse\Meta');
|
||||||
$accessTokenService->shouldReceive('introspect')
|
$accessTokenService->shouldReceive('introspect')
|
||||||
->andReturn($accessTokenInfo);
|
->andReturn($accessTokenInfo);
|
||||||
|
|
||||||
|
@ -68,7 +68,7 @@ class ApiAuthTest extends TestCase
|
||||||
$accessTokenInfo->setClientId('Unicorns and rainbows');
|
$accessTokenInfo->setClientId('Unicorns and rainbows');
|
||||||
$accessTokenInfo->setScopes(['basic', 'ponyfm:tracks:upload']);
|
$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')
|
$poniverse->shouldReceive('getResourceOwner')
|
||||||
->andReturn(new \Poniverse\Lib\Entity\Poniverse\User([
|
->andReturn(new \Poniverse\Lib\Entity\Poniverse\User([
|
||||||
'id' => $user->id,
|
'id' => $user->id,
|
||||||
|
@ -78,7 +78,7 @@ class ApiAuthTest extends TestCase
|
||||||
]));
|
]));
|
||||||
$poniverse->shouldReceive('setAccessToken');
|
$poniverse->shouldReceive('setAccessToken');
|
||||||
|
|
||||||
$accessTokenService = Mockery::mock('overload:Poniverse\Lib\Service\Poniverse\Meta');
|
$accessTokenService = \Mockery::mock('overload:Poniverse\Lib\Service\Poniverse\Meta');
|
||||||
$accessTokenService
|
$accessTokenService
|
||||||
->shouldReceive('introspect')
|
->shouldReceive('introspect')
|
||||||
->andReturn($accessTokenInfo);
|
->andReturn($accessTokenInfo);
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
namespace Tests;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Pony.fm - A community for pony fan music.
|
* Pony.fm - A community for pony fan music.
|
||||||
* Copyright (C) 2015-2017 Peter Deltchev
|
* Copyright (C) 2015-2017 Peter Deltchev
|
||||||
|
|
|
@ -1,4 +1,10 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
namespace Tests;
|
||||||
|
|
||||||
|
use Illuminate\Contracts\Console\Kernel;
|
||||||
|
use Storage;
|
||||||
|
use Laravel\BrowserKitTesting\TestCase as BaseTestCase;
|
||||||
use Poniverse\Ponyfm\Models\User;
|
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/>.
|
* 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.
|
* 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 = require __DIR__.'/../bootstrap/app.php';
|
||||||
|
|
||||||
$app->make(Illuminate\Contracts\Console\Kernel::class)->bootstrap();
|
$app->make(Kernel::class)->bootstrap();
|
||||||
|
|
||||||
|
$this->getTestFiles();
|
||||||
|
|
||||||
return $app;
|
return $app;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public function getTestFiles()
|
||||||
* @before
|
|
||||||
*/
|
|
||||||
public function initializeTestFiles()
|
|
||||||
{
|
{
|
||||||
// Ensure we have the Pony.fm test files
|
// Ensure we have the Pony.fm test files
|
||||||
if (!static::$initializedFiles) {
|
if (!static::$initializedFiles) {
|
||||||
|
@ -135,8 +140,8 @@ class TestCase extends Illuminate\Foundation\Testing\TestCase
|
||||||
protected function callUploadWithParameters(array $parameters, array $files = [])
|
protected function callUploadWithParameters(array $parameters, array $files = [])
|
||||||
{
|
{
|
||||||
$this->expectsJobs([
|
$this->expectsJobs([
|
||||||
Poniverse\Ponyfm\Jobs\EncodeTrackFile::class,
|
\Poniverse\Ponyfm\Jobs\EncodeTrackFile::class,
|
||||||
Poniverse\Ponyfm\Jobs\UpdateSearchIndexForEntity::class
|
\Poniverse\Ponyfm\Jobs\UpdateSearchIndexForEntity::class
|
||||||
]);
|
]);
|
||||||
$this->user = factory(User::class)->create();
|
$this->user = factory(User::class)->create();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue