diff --git a/app/Commands/UploadTrackCommand.php b/app/Commands/UploadTrackCommand.php index 8c8fd996..da2a090e 100644 --- a/app/Commands/UploadTrackCommand.php +++ b/app/Commands/UploadTrackCommand.php @@ -88,11 +88,12 @@ class UploadTrackCommand extends CommandBase $track->save(); $track->ensureDirectoryExists(); - Storage::makeDirectory(Config::get('ponyfm.files_directory') . '/queued-tracks', 0755, false, true); + if (!is_dir(Config::get('ponyfm.files_directory') . '/queued-tracks')) { + mkdir(Config::get('ponyfm.files_directory') . '/queued-tracks', 0755, true); + } $trackFile = $trackFile->move(Config::get('ponyfm.files_directory').'/queued-tracks', $track->id); - $validator = \Validator::make(['track' => $trackFile], [ 'track' => 'required|' diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index 4387f2ee..df875e1a 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -20,6 +20,8 @@ namespace Poniverse\Ponyfm\Providers; +use DB; +use Illuminate\Database\SQLiteConnection; use Illuminate\Foundation\Application; use Illuminate\Support\ServiceProvider; use PfmValidator; diff --git a/app/User.php b/app/User.php index a1fe972d..562d7727 100644 --- a/app/User.php +++ b/app/User.php @@ -20,7 +20,6 @@ namespace Poniverse\Ponyfm; -use Exception; use Gravatar; use Illuminate\Auth\Authenticatable; use Illuminate\Auth\Passwords\CanResetPassword; @@ -28,8 +27,7 @@ use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract; use Illuminate\Contracts\Auth\CanResetPassword as CanResetPasswordContract; use Illuminate\Database\Eloquent\Model; use Illuminate\Foundation\Auth\Access\Authorizable; -use Illuminate\Support\Facades\Auth; -use Illuminate\Support\Facades\URL; +use Auth; use Illuminate\Support\Str; use Venturecraft\Revisionable\RevisionableTrait; diff --git a/composer.json b/composer.json index 6b7875a2..f91a28e5 100644 --- a/composer.json +++ b/composer.json @@ -19,7 +19,7 @@ "require-dev": { "fzaninotto/faker": "~1.4", "mockery/mockery": "0.9.*", - "phpunit/phpunit": "~4.0", + "phpunit/phpunit": "~4.1", "phpspec/phpspec": "~2.1" }, "autoload": { diff --git a/composer.lock b/composer.lock index d271ed7c..a215e567 100644 --- a/composer.lock +++ b/composer.lock @@ -4,27 +4,27 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "edca1732ab37f49b64614d5729d652d3", - "content-hash": "b476009ee841e5b048e73b4fab8372ee", + "hash": "3bd61c88ad775531ffc26d83323d4598", + "content-hash": "be4e60cde6dc921af9be5a5fb94ac4e3", "packages": [ { "name": "barryvdh/laravel-ide-helper", - "version": "v2.1.0", + "version": "v2.1.2", "source": { "type": "git", "url": "https://github.com/barryvdh/laravel-ide-helper.git", - "reference": "83999f8467374adcb8893f566c9171c9d9691f50" + "reference": "d82e8f191fb043a0f8cbf2de64fd3027bfa4f772" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/barryvdh/laravel-ide-helper/zipball/83999f8467374adcb8893f566c9171c9d9691f50", - "reference": "83999f8467374adcb8893f566c9171c9d9691f50", + "url": "https://api.github.com/repos/barryvdh/laravel-ide-helper/zipball/d82e8f191fb043a0f8cbf2de64fd3027bfa4f772", + "reference": "d82e8f191fb043a0f8cbf2de64fd3027bfa4f772", "shasum": "" }, "require": { - "illuminate/console": "5.0.x|5.1.x", - "illuminate/filesystem": "5.0.x|5.1.x", - "illuminate/support": "5.0.x|5.1.x", + "illuminate/console": "5.0.x|5.1.x|5.2.x", + "illuminate/filesystem": "5.0.x|5.1.x|5.2.x", + "illuminate/support": "5.0.x|5.1.x|5.2.x", "php": ">=5.4.0", "phpdocumentor/reflection-docblock": "2.0.4", "symfony/class-loader": "~2.3" @@ -68,33 +68,33 @@ "phpstorm", "sublime" ], - "time": "2015-08-13 11:40:00" + "time": "2015-12-21 19:48:06" }, { "name": "classpreloader/classpreloader", - "version": "2.0.0", + "version": "3.0.0", "source": { "type": "git", "url": "https://github.com/ClassPreloader/ClassPreloader.git", - "reference": "8c3c14b10309e3b40bce833913a6c0c0b8c8f962" + "reference": "9b10b913c2bdf90c3d2e0d726b454fb7f77c552a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ClassPreloader/ClassPreloader/zipball/8c3c14b10309e3b40bce833913a6c0c0b8c8f962", - "reference": "8c3c14b10309e3b40bce833913a6c0c0b8c8f962", + "url": "https://api.github.com/repos/ClassPreloader/ClassPreloader/zipball/9b10b913c2bdf90c3d2e0d726b454fb7f77c552a", + "reference": "9b10b913c2bdf90c3d2e0d726b454fb7f77c552a", "shasum": "" }, "require": { - "nikic/php-parser": "~1.3", + "nikic/php-parser": "^1.0|^2.0", "php": ">=5.5.9" }, "require-dev": { - "phpunit/phpunit": "~4.0" + "phpunit/phpunit": "^4.8|^5.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-master": "3.0-dev" } }, "autoload": { @@ -122,7 +122,7 @@ "class", "preload" ], - "time": "2015-06-28 21:39:13" + "time": "2015-11-09 22:51:51" }, { "name": "codescale/ffmpeg-php", @@ -327,16 +327,16 @@ }, { "name": "doctrine/cache", - "version": "v1.5.1", + "version": "v1.5.4", "source": { "type": "git", "url": "https://github.com/doctrine/cache.git", - "reference": "2b9cec5a5e722010cbebc91713d4c11eaa064d5e" + "reference": "47cdc76ceb95cc591d9c79a36dc3794975b5d136" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/cache/zipball/2b9cec5a5e722010cbebc91713d4c11eaa064d5e", - "reference": "2b9cec5a5e722010cbebc91713d4c11eaa064d5e", + "url": "https://api.github.com/repos/doctrine/cache/zipball/47cdc76ceb95cc591d9c79a36dc3794975b5d136", + "reference": "47cdc76ceb95cc591d9c79a36dc3794975b5d136", "shasum": "" }, "require": { @@ -393,7 +393,7 @@ "cache", "caching" ], - "time": "2015-11-02 18:35:48" + "time": "2015-12-19 05:03:47" }, { "name": "doctrine/collections", @@ -463,16 +463,16 @@ }, { "name": "doctrine/common", - "version": "v2.5.1", + "version": "v2.5.2", "source": { "type": "git", "url": "https://github.com/doctrine/common.git", - "reference": "0009b8f0d4a917aabc971fb089eba80e872f83f9" + "reference": "311001fd9865a4d0d59efff4eac6d7dcb3f5270c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/common/zipball/0009b8f0d4a917aabc971fb089eba80e872f83f9", - "reference": "0009b8f0d4a917aabc971fb089eba80e872f83f9", + "url": "https://api.github.com/repos/doctrine/common/zipball/311001fd9865a4d0d59efff4eac6d7dcb3f5270c", + "reference": "311001fd9865a4d0d59efff4eac6d7dcb3f5270c", "shasum": "" }, "require": { @@ -489,7 +489,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.6.x-dev" + "dev-master": "2.5.x-dev" } }, "autoload": { @@ -532,7 +532,7 @@ "persistence", "spl" ], - "time": "2015-08-31 13:00:22" + "time": "2015-12-04 12:49:42" }, { "name": "doctrine/dbal", @@ -607,16 +607,16 @@ }, { "name": "doctrine/inflector", - "version": "v1.0.1", + "version": "v1.1.0", "source": { "type": "git", "url": "https://github.com/doctrine/inflector.git", - "reference": "0bcb2e79d8571787f18b7eb036ed3d004908e604" + "reference": "90b2128806bfde671b6952ab8bea493942c1fdae" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/inflector/zipball/0bcb2e79d8571787f18b7eb036ed3d004908e604", - "reference": "0bcb2e79d8571787f18b7eb036ed3d004908e604", + "url": "https://api.github.com/repos/doctrine/inflector/zipball/90b2128806bfde671b6952ab8bea493942c1fdae", + "reference": "90b2128806bfde671b6952ab8bea493942c1fdae", "shasum": "" }, "require": { @@ -628,7 +628,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "1.1.x-dev" } }, "autoload": { @@ -670,7 +670,7 @@ "singularize", "string" ], - "time": "2014-12-20 21:24:13" + "time": "2015-11-06 14:35:42" }, { "name": "doctrine/lexer", @@ -728,16 +728,16 @@ }, { "name": "guzzlehttp/guzzle", - "version": "6.1.0", + "version": "6.1.1", "source": { "type": "git", "url": "https://github.com/guzzle/guzzle.git", - "reference": "66fd14b4d0b8f2389eaf37c5458608c7cb793a81" + "reference": "c6851d6e48f63b69357cbfa55bca116448140e0c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/66fd14b4d0b8f2389eaf37c5458608c7cb793a81", - "reference": "66fd14b4d0b8f2389eaf37c5458608c7cb793a81", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/c6851d6e48f63b69357cbfa55bca116448140e0c", + "reference": "c6851d6e48f63b69357cbfa55bca116448140e0c", "shasum": "" }, "require": { @@ -786,20 +786,20 @@ "rest", "web service" ], - "time": "2015-09-08 17:36:26" + "time": "2015-11-23 00:47:50" }, { "name": "guzzlehttp/promises", - "version": "1.0.2", + "version": "1.0.3", "source": { "type": "git", "url": "https://github.com/guzzle/promises.git", - "reference": "97fe7210def29451ec74923b27e552238defd75a" + "reference": "b1e1c0d55f8083c71eda2c28c12a228d708294ea" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/promises/zipball/97fe7210def29451ec74923b27e552238defd75a", - "reference": "97fe7210def29451ec74923b27e552238defd75a", + "url": "https://api.github.com/repos/guzzle/promises/zipball/b1e1c0d55f8083c71eda2c28c12a228d708294ea", + "reference": "b1e1c0d55f8083c71eda2c28c12a228d708294ea", "shasum": "" }, "require": { @@ -837,20 +837,20 @@ "keywords": [ "promise" ], - "time": "2015-08-15 19:37:21" + "time": "2015-10-15 22:28:00" }, { "name": "guzzlehttp/psr7", - "version": "1.2.0", + "version": "1.2.1", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "4ef919b0cf3b1989523138b60163bbcb7ba1ff7e" + "reference": "4d0bdbe1206df7440219ce14c972aa57cc5e4982" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/4ef919b0cf3b1989523138b60163bbcb7ba1ff7e", - "reference": "4ef919b0cf3b1989523138b60163bbcb7ba1ff7e", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/4d0bdbe1206df7440219ce14c972aa57cc5e4982", + "reference": "4d0bdbe1206df7440219ce14c972aa57cc5e4982", "shasum": "" }, "require": { @@ -895,7 +895,7 @@ "stream", "uri" ], - "time": "2015-08-15 19:32:36" + "time": "2015-11-03 01:34:55" }, { "name": "intouch/laravel-newrelic", @@ -1071,30 +1071,30 @@ }, { "name": "jeremeamia/SuperClosure", - "version": "2.1.0", + "version": "2.2.0", "source": { "type": "git", "url": "https://github.com/jeremeamia/super_closure.git", - "reference": "b712f39c671e5ead60c7ebfe662545456aade833" + "reference": "29a88be2a4846d27c1613aed0c9071dfad7b5938" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/jeremeamia/super_closure/zipball/b712f39c671e5ead60c7ebfe662545456aade833", - "reference": "b712f39c671e5ead60c7ebfe662545456aade833", + "url": "https://api.github.com/repos/jeremeamia/super_closure/zipball/29a88be2a4846d27c1613aed0c9071dfad7b5938", + "reference": "29a88be2a4846d27c1613aed0c9071dfad7b5938", "shasum": "" }, "require": { - "nikic/php-parser": "~1.0", - "php": ">=5.4" + "nikic/php-parser": "^1.2|^2.0", + "php": ">=5.4", + "symfony/polyfill-php56": "^1.0" }, "require-dev": { - "codeclimate/php-test-reporter": "~0.1.2", - "phpunit/phpunit": "~4.0" + "phpunit/phpunit": "^4.0|^5.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.1-dev" + "dev-master": "2.2-dev" } }, "autoload": { @@ -1125,7 +1125,7 @@ "serialize", "tokenizer" ], - "time": "2015-03-11 20:06:43" + "time": "2015-12-05 17:17:57" }, { "name": "kriswallsmith/assetic", @@ -1143,7 +1143,10 @@ }, "require": { "php": ">=5.3.1", - "symfony/process": "~2.1" + "symfony/process": "~2.1|~3.0" + }, + "conflict": { + "twig/twig": "<1.23" }, "require-dev": { "cssmin/cssmin": "*", @@ -1203,20 +1206,20 @@ }, { "name": "laravel/framework", - "version": "v5.1.16", + "version": "v5.1.27", "source": { "type": "git", "url": "https://github.com/laravel/framework.git", - "reference": "e34dcc0c57e0f560248aec5128161256ff8bf4e1" + "reference": "b16f80878fd3603022d3c84593397cedd9af0bcf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/framework/zipball/e34dcc0c57e0f560248aec5128161256ff8bf4e1", - "reference": "e34dcc0c57e0f560248aec5128161256ff8bf4e1", + "url": "https://api.github.com/repos/laravel/framework/zipball/b16f80878fd3603022d3c84593397cedd9af0bcf", + "reference": "b16f80878fd3603022d3c84593397cedd9af0bcf", "shasum": "" }, "require": { - "classpreloader/classpreloader": "~2.0", + "classpreloader/classpreloader": "~2.0|~3.0", "danielstjules/stringy": "~1.8", "doctrine/inflector": "~1.0", "ext-mbstring": "*", @@ -1226,8 +1229,9 @@ "monolog/monolog": "~1.11", "mtdowling/cron-expression": "~1.0", "nesbot/carbon": "~1.19", + "paragonie/random_compat": "~1.1", "php": ">=5.5.9", - "psy/psysh": "~0.5.1", + "psy/psysh": "0.6.*", "swiftmailer/swiftmailer": "~5.1", "symfony/console": "2.7.*", "symfony/css-selector": "2.7.*", @@ -1257,7 +1261,6 @@ "illuminate/events": "self.version", "illuminate/exception": "self.version", "illuminate/filesystem": "self.version", - "illuminate/foundation": "self.version", "illuminate/hashing": "self.version", "illuminate/http": "self.version", "illuminate/log": "self.version", @@ -1276,7 +1279,7 @@ "require-dev": { "aws/aws-sdk-php": "~3.0", "iron-io/iron_mq": "~2.0", - "mockery/mockery": "~0.9.1", + "mockery/mockery": "~0.9.2", "pda/pheanstalk": "~3.0", "phpunit/phpunit": "~4.0", "predis/predis": "~1.0" @@ -1285,7 +1288,7 @@ "aws/aws-sdk-php": "Required to use the SQS queue driver and SES mail driver (~3.0).", "doctrine/dbal": "Required to rename columns and drop SQLite columns (~2.4).", "fzaninotto/faker": "Required to use the eloquent factory builder (~1.4).", - "guzzlehttp/guzzle": "Required to use the Mailgun and Mandrill mail drivers (~5.3|~6.0).", + "guzzlehttp/guzzle": "Required to use the Mailgun and Mandrill mail drivers and the ping methods on schedules (~5.3|~6.0).", "iron-io/iron_mq": "Required to use the iron queue driver (~2.0).", "league/flysystem-aws-s3-v3": "Required to use the Flysystem S3 driver (~1.0).", "league/flysystem-rackspace": "Required to use the Flysystem Rackspace driver (~1.0).", @@ -1327,31 +1330,34 @@ "framework", "laravel" ], - "time": "2015-09-04 12:46:14" + "time": "2015-12-17 20:35:38" }, { "name": "league/flysystem", - "version": "1.0.12", + "version": "1.0.16", "source": { "type": "git", "url": "https://github.com/thephpleague/flysystem.git", - "reference": "7323424a9d39c24e597ed3f2144419dfbb52e086" + "reference": "183e1a610664baf6dcd6fceda415baf43cbdc031" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/7323424a9d39c24e597ed3f2144419dfbb52e086", - "reference": "7323424a9d39c24e597ed3f2144419dfbb52e086", + "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/183e1a610664baf6dcd6fceda415baf43cbdc031", + "reference": "183e1a610664baf6dcd6fceda415baf43cbdc031", "shasum": "" }, "require": { "php": ">=5.4.0" }, + "conflict": { + "league/flysystem-sftp": "<1.0.6" + }, "require-dev": { "ext-fileinfo": "*", "mockery/mockery": "~0.9", "phpspec/phpspec": "^2.2", "phpspec/prophecy-phpunit": "~1.0", - "phpunit/phpunit": "~4.1" + "phpunit/phpunit": "~4.8" }, "suggest": { "ext-fileinfo": "Required for MimeType", @@ -1408,20 +1414,20 @@ "sftp", "storage" ], - "time": "2015-09-05 12:06:41" + "time": "2015-12-19 20:16:43" }, { "name": "monolog/monolog", - "version": "1.17.1", + "version": "1.17.2", "source": { "type": "git", "url": "https://github.com/Seldaek/monolog.git", - "reference": "0524c87587ab85bc4c2d6f5b41253ccb930a5422" + "reference": "bee7f0dc9c3e0b69a6039697533dca1e845c8c24" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/monolog/zipball/0524c87587ab85bc4c2d6f5b41253ccb930a5422", - "reference": "0524c87587ab85bc4c2d6f5b41253ccb930a5422", + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/bee7f0dc9c3e0b69a6039697533dca1e845c8c24", + "reference": "bee7f0dc9c3e0b69a6039697533dca1e845c8c24", "shasum": "" }, "require": { @@ -1435,10 +1441,11 @@ "aws/aws-sdk-php": "^2.4.9", "doctrine/couchdb": "~1.0@dev", "graylog2/gelf-php": "~1.0", + "jakub-onderka/php-parallel-lint": "0.9", "php-console/php-console": "^3.1.3", "phpunit/phpunit": "~4.5", "phpunit/phpunit-mock-objects": "2.3.0", - "raven/raven": "~0.11", + "raven/raven": "^0.13", "ruflin/elastica": ">=0.90 <3.0", "swiftmailer/swiftmailer": "~5.3", "videlalvaro/php-amqplib": "~2.4" @@ -1484,7 +1491,7 @@ "logging", "psr-3" ], - "time": "2015-08-31 09:17:37" + "time": "2015-10-14 12:51:02" }, { "name": "mtdowling/cron-expression", @@ -1532,16 +1539,16 @@ }, { "name": "nesbot/carbon", - "version": "1.20.0", + "version": "1.21.0", "source": { "type": "git", "url": "https://github.com/briannesbitt/Carbon.git", - "reference": "bfd3eaba109c9a2405c92174c8e17f20c2b9caf3" + "reference": "7b08ec6f75791e130012f206e3f7b0e76e18e3d7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/bfd3eaba109c9a2405c92174c8e17f20c2b9caf3", - "reference": "bfd3eaba109c9a2405c92174c8e17f20c2b9caf3", + "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/7b08ec6f75791e130012f206e3f7b0e76e18e3d7", + "reference": "7b08ec6f75791e130012f206e3f7b0e76e18e3d7", "shasum": "" }, "require": { @@ -1549,12 +1556,12 @@ "symfony/translation": "~2.6|~3.0" }, "require-dev": { - "phpunit/phpunit": "~4.0" + "phpunit/phpunit": "~4.0|~5.0" }, "type": "library", "autoload": { - "psr-0": { - "Carbon": "src" + "psr-4": { + "Carbon\\": "src/Carbon/" } }, "notification-url": "https://packagist.org/downloads/", @@ -1575,36 +1582,42 @@ "datetime", "time" ], - "time": "2015-06-25 04:19:39" + "time": "2015-11-04 20:07:17" }, { "name": "nikic/php-parser", - "version": "v1.4.0", + "version": "v2.0.0", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "196f177cfefa0f1f7166c0a05d8255889be12418" + "reference": "c542e5d86a9775abd1021618eb2430278bfc1e01" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/196f177cfefa0f1f7166c0a05d8255889be12418", - "reference": "196f177cfefa0f1f7166c0a05d8255889be12418", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/c542e5d86a9775abd1021618eb2430278bfc1e01", + "reference": "c542e5d86a9775abd1021618eb2430278bfc1e01", "shasum": "" }, "require": { "ext-tokenizer": "*", - "php": ">=5.3" + "php": ">=5.4" }, + "require-dev": { + "phpunit/phpunit": "~4.0" + }, + "bin": [ + "bin/php-parse" + ], "type": "library", "extra": { "branch-alias": { - "dev-master": "1.4-dev" + "dev-master": "2.0-dev" } }, "autoload": { - "files": [ - "lib/bootstrap.php" - ] + "psr-4": { + "PhpParser\\": "lib/PhpParser" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -1620,7 +1633,55 @@ "parser", "php" ], - "time": "2015-07-14 17:31:05" + "time": "2015-12-04 15:28:43" + }, + { + "name": "paragonie/random_compat", + "version": "1.1.4", + "source": { + "type": "git", + "url": "https://github.com/paragonie/random_compat.git", + "reference": "d762ee5b099a29044603cd4649851e81aa66cb47" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/paragonie/random_compat/zipball/d762ee5b099a29044603cd4649851e81aa66cb47", + "reference": "d762ee5b099a29044603cd4649851e81aa66cb47", + "shasum": "" + }, + "require": { + "php": ">=5.2.0" + }, + "require-dev": { + "phpunit/phpunit": "4.*|5.*" + }, + "suggest": { + "ext-libsodium": "Provides a modern crypto API that can be used to generate random bytes." + }, + "type": "library", + "autoload": { + "files": [ + "lib/random.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Paragon Initiative Enterprises", + "email": "security@paragonie.com", + "homepage": "https://paragonie.com" + } + ], + "description": "PHP 5.x polyfill for random_bytes() and random_int() from PHP 7", + "keywords": [ + "csprng", + "pseudorandom", + "random" + ], + "time": "2015-12-10 14:48:13" }, { "name": "pda/pheanstalk", @@ -1810,29 +1871,29 @@ }, { "name": "psy/psysh", - "version": "v0.5.2", + "version": "v0.6.1", "source": { "type": "git", "url": "https://github.com/bobthecow/psysh.git", - "reference": "aaf8772ade08b5f0f6830774a5d5c2f800415975" + "reference": "0f04df0b23663799a8941fae13cd8e6299bde3ed" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/bobthecow/psysh/zipball/aaf8772ade08b5f0f6830774a5d5c2f800415975", - "reference": "aaf8772ade08b5f0f6830774a5d5c2f800415975", + "url": "https://api.github.com/repos/bobthecow/psysh/zipball/0f04df0b23663799a8941fae13cd8e6299bde3ed", + "reference": "0f04df0b23663799a8941fae13cd8e6299bde3ed", "shasum": "" }, "require": { "dnoegel/php-xdg-base-dir": "0.1", "jakub-onderka/php-console-highlighter": "0.3.*", - "nikic/php-parser": "^1.2.1", + "nikic/php-parser": "^1.2.1|~2.0", "php": ">=5.3.9", "symfony/console": "~2.3.10|^2.4.2|~3.0", "symfony/var-dumper": "~2.7|~3.0" }, "require-dev": { "fabpot/php-cs-fixer": "~1.5", - "phpunit/phpunit": "~3.7|~4.0", + "phpunit/phpunit": "~3.7|~4.0|~5.0", "squizlabs/php_codesniffer": "~2.0", "symfony/finder": "~2.1|~3.0" }, @@ -1848,15 +1909,15 @@ "type": "library", "extra": { "branch-alias": { - "dev-develop": "0.6.x-dev" + "dev-develop": "0.7.x-dev" } }, "autoload": { "files": [ "src/Psy/functions.php" ], - "psr-0": { - "Psy\\": "src/" + "psr-4": { + "Psy\\": "src/Psy/" } }, "notification-url": "https://packagist.org/downloads/", @@ -1878,7 +1939,7 @@ "interactive", "shell" ], - "time": "2015-07-16 15:26:57" + "time": "2015-11-12 16:18:56" }, { "name": "swiftmailer/swiftmailer", @@ -1935,35 +1996,37 @@ }, { "name": "symfony/class-loader", - "version": "v2.7.3", + "version": "v2.8.0", "source": { "type": "git", "url": "https://github.com/symfony/class-loader.git", - "reference": "2fccbc544997340808801a7410cdcb96dd12edc4" + "reference": "51f83451bf0ddfc696e47e4642d6cd10fcfce160" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/class-loader/zipball/2fccbc544997340808801a7410cdcb96dd12edc4", - "reference": "2fccbc544997340808801a7410cdcb96dd12edc4", + "url": "https://api.github.com/repos/symfony/class-loader/zipball/51f83451bf0ddfc696e47e4642d6cd10fcfce160", + "reference": "51f83451bf0ddfc696e47e4642d6cd10fcfce160", "shasum": "" }, "require": { "php": ">=5.3.9" }, "require-dev": { - "symfony/finder": "~2.0,>=2.0.5", - "symfony/phpunit-bridge": "~2.7" + "symfony/finder": "~2.0,>=2.0.5|~3.0.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.7-dev" + "dev-master": "2.8-dev" } }, "autoload": { "psr-4": { "Symfony\\Component\\ClassLoader\\": "" - } + }, + "exclude-from-classmap": [ + "/Tests/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -1981,20 +2044,20 @@ ], "description": "Symfony ClassLoader Component", "homepage": "https://symfony.com", - "time": "2015-06-25 12:52:11" + "time": "2015-11-26 07:00:59" }, { "name": "symfony/console", - "version": "v2.7.3", + "version": "v2.7.7", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "d6cf02fe73634c96677e428f840704bfbcaec29e" + "reference": "16bb1cb86df43c90931df65f529e7ebd79636750" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/d6cf02fe73634c96677e428f840704bfbcaec29e", - "reference": "d6cf02fe73634c96677e428f840704bfbcaec29e", + "url": "https://api.github.com/repos/symfony/console/zipball/16bb1cb86df43c90931df65f529e7ebd79636750", + "reference": "16bb1cb86df43c90931df65f529e7ebd79636750", "shasum": "" }, "require": { @@ -2003,7 +2066,6 @@ "require-dev": { "psr/log": "~1.0", "symfony/event-dispatcher": "~2.1", - "symfony/phpunit-bridge": "~2.7", "symfony/process": "~2.1" }, "suggest": { @@ -2020,7 +2082,10 @@ "autoload": { "psr-4": { "Symfony\\Component\\Console\\": "" - } + }, + "exclude-from-classmap": [ + "/Tests/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -2038,28 +2103,25 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2015-07-28 15:18:12" + "time": "2015-11-18 09:54:26" }, { "name": "symfony/css-selector", - "version": "v2.7.3", + "version": "v2.7.7", "source": { "type": "git", "url": "https://github.com/symfony/css-selector.git", - "reference": "0b5c07b516226b7dd32afbbc82fe547a469c5092" + "reference": "abb47717fb88aebd9437da2fc8bb01a50a36679f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/css-selector/zipball/0b5c07b516226b7dd32afbbc82fe547a469c5092", - "reference": "0b5c07b516226b7dd32afbbc82fe547a469c5092", + "url": "https://api.github.com/repos/symfony/css-selector/zipball/abb47717fb88aebd9437da2fc8bb01a50a36679f", + "reference": "abb47717fb88aebd9437da2fc8bb01a50a36679f", "shasum": "" }, "require": { "php": ">=5.3.9" }, - "require-dev": { - "symfony/phpunit-bridge": "~2.7" - }, "type": "library", "extra": { "branch-alias": { @@ -2069,7 +2131,10 @@ "autoload": { "psr-4": { "Symfony\\Component\\CssSelector\\": "" - } + }, + "exclude-from-classmap": [ + "/Tests/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -2091,20 +2156,20 @@ ], "description": "Symfony CssSelector Component", "homepage": "https://symfony.com", - "time": "2015-05-15 13:33:16" + "time": "2015-10-30 20:10:21" }, { "name": "symfony/debug", - "version": "v2.7.3", + "version": "v2.7.7", "source": { "type": "git", "url": "https://github.com/symfony/debug.git", - "reference": "9daa1bf9f7e615fa2fba30357e479a90141222e3" + "reference": "0dbc119596f4afc82d9b2eb2a7e6a4af1ee763fa" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/9daa1bf9f7e615fa2fba30357e479a90141222e3", - "reference": "9daa1bf9f7e615fa2fba30357e479a90141222e3", + "url": "https://api.github.com/repos/symfony/debug/zipball/0dbc119596f4afc82d9b2eb2a7e6a4af1ee763fa", + "reference": "0dbc119596f4afc82d9b2eb2a7e6a4af1ee763fa", "shasum": "" }, "require": { @@ -2116,13 +2181,7 @@ }, "require-dev": { "symfony/class-loader": "~2.2", - "symfony/http-foundation": "~2.1", - "symfony/http-kernel": "~2.3.24|~2.5.9|~2.6,>=2.6.2", - "symfony/phpunit-bridge": "~2.7" - }, - "suggest": { - "symfony/http-foundation": "", - "symfony/http-kernel": "" + "symfony/http-kernel": "~2.3.24|~2.5.9|~2.6,>=2.6.2" }, "type": "library", "extra": { @@ -2133,7 +2192,10 @@ "autoload": { "psr-4": { "Symfony\\Component\\Debug\\": "" - } + }, + "exclude-from-classmap": [ + "/Tests/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -2151,28 +2213,27 @@ ], "description": "Symfony Debug Component", "homepage": "https://symfony.com", - "time": "2015-07-09 16:07:40" + "time": "2015-10-30 20:10:21" }, { "name": "symfony/dom-crawler", - "version": "v2.7.3", + "version": "v2.7.7", "source": { "type": "git", "url": "https://github.com/symfony/dom-crawler.git", - "reference": "9dabece63182e95c42b06967a0d929a5df78bc35" + "reference": "b33593cbfe1d81b50d48353f338aca76a08658d8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/9dabece63182e95c42b06967a0d929a5df78bc35", - "reference": "9dabece63182e95c42b06967a0d929a5df78bc35", + "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/b33593cbfe1d81b50d48353f338aca76a08658d8", + "reference": "b33593cbfe1d81b50d48353f338aca76a08658d8", "shasum": "" }, "require": { "php": ">=5.3.9" }, "require-dev": { - "symfony/css-selector": "~2.3", - "symfony/phpunit-bridge": "~2.7" + "symfony/css-selector": "~2.3" }, "suggest": { "symfony/css-selector": "" @@ -2186,7 +2247,10 @@ "autoload": { "psr-4": { "Symfony\\Component\\DomCrawler\\": "" - } + }, + "exclude-from-classmap": [ + "/Tests/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -2204,20 +2268,20 @@ ], "description": "Symfony DomCrawler Component", "homepage": "https://symfony.com", - "time": "2015-07-09 16:07:40" + "time": "2015-11-02 20:20:53" }, { "name": "symfony/event-dispatcher", - "version": "v2.7.3", + "version": "v2.8.0", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "9310b5f9a87ec2ea75d20fec0b0017c77c66dac3" + "reference": "a5eb815363c0388e83247e7e9853e5dbc14999cc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/9310b5f9a87ec2ea75d20fec0b0017c77c66dac3", - "reference": "9310b5f9a87ec2ea75d20fec0b0017c77c66dac3", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/a5eb815363c0388e83247e7e9853e5dbc14999cc", + "reference": "a5eb815363c0388e83247e7e9853e5dbc14999cc", "shasum": "" }, "require": { @@ -2225,11 +2289,10 @@ }, "require-dev": { "psr/log": "~1.0", - "symfony/config": "~2.0,>=2.0.5", - "symfony/dependency-injection": "~2.6", - "symfony/expression-language": "~2.6", - "symfony/phpunit-bridge": "~2.7", - "symfony/stopwatch": "~2.3" + "symfony/config": "~2.0,>=2.0.5|~3.0.0", + "symfony/dependency-injection": "~2.6|~3.0.0", + "symfony/expression-language": "~2.6|~3.0.0", + "symfony/stopwatch": "~2.3|~3.0.0" }, "suggest": { "symfony/dependency-injection": "", @@ -2238,13 +2301,16 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.7-dev" + "dev-master": "2.8-dev" } }, "autoload": { "psr-4": { "Symfony\\Component\\EventDispatcher\\": "" - } + }, + "exclude-from-classmap": [ + "/Tests/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -2262,28 +2328,25 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", - "time": "2015-06-18 19:21:56" + "time": "2015-10-30 20:15:42" }, { "name": "symfony/finder", - "version": "v2.7.3", + "version": "v2.7.7", "source": { "type": "git", - "url": "https://github.com/symfony/Finder.git", - "reference": "ae0f363277485094edc04c9f3cbe595b183b78e4" + "url": "https://github.com/symfony/finder.git", + "reference": "a06a0c0ff7db3736a50d530c908cca547bf13da9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Finder/zipball/ae0f363277485094edc04c9f3cbe595b183b78e4", - "reference": "ae0f363277485094edc04c9f3cbe595b183b78e4", + "url": "https://api.github.com/repos/symfony/finder/zipball/a06a0c0ff7db3736a50d530c908cca547bf13da9", + "reference": "a06a0c0ff7db3736a50d530c908cca547bf13da9", "shasum": "" }, "require": { "php": ">=5.3.9" }, - "require-dev": { - "symfony/phpunit-bridge": "~2.7" - }, "type": "library", "extra": { "branch-alias": { @@ -2293,7 +2356,10 @@ "autoload": { "psr-4": { "Symfony\\Component\\Finder\\": "" - } + }, + "exclude-from-classmap": [ + "/Tests/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -2311,28 +2377,27 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "time": "2015-07-09 16:07:40" + "time": "2015-10-30 20:10:21" }, { "name": "symfony/http-foundation", - "version": "v2.7.3", + "version": "v2.7.7", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", - "reference": "863af6898081b34c65d42100c370b9f3c51b70ca" + "reference": "e83a3d105ddaf5a113e803c904fdec552d1f1c35" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/863af6898081b34c65d42100c370b9f3c51b70ca", - "reference": "863af6898081b34c65d42100c370b9f3c51b70ca", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/e83a3d105ddaf5a113e803c904fdec552d1f1c35", + "reference": "e83a3d105ddaf5a113e803c904fdec552d1f1c35", "shasum": "" }, "require": { "php": ">=5.3.9" }, "require-dev": { - "symfony/expression-language": "~2.4", - "symfony/phpunit-bridge": "~2.7" + "symfony/expression-language": "~2.4" }, "type": "library", "extra": { @@ -2346,6 +2411,9 @@ }, "classmap": [ "Resources/stubs" + ], + "exclude-from-classmap": [ + "/Tests/" ] }, "notification-url": "https://packagist.org/downloads/", @@ -2364,20 +2432,20 @@ ], "description": "Symfony HttpFoundation Component", "homepage": "https://symfony.com", - "time": "2015-07-22 10:11:00" + "time": "2015-11-20 17:41:18" }, { "name": "symfony/http-kernel", - "version": "v2.7.3", + "version": "v2.7.7", "source": { "type": "git", "url": "https://github.com/symfony/http-kernel.git", - "reference": "405d3e7a59ff7a28ec469441326a0ac79065ea98" + "reference": "5570de31e8fbc03777a8c61eb24f9b626e5e5941" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-kernel/zipball/405d3e7a59ff7a28ec469441326a0ac79065ea98", - "reference": "405d3e7a59ff7a28ec469441326a0ac79065ea98", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/5570de31e8fbc03777a8c61eb24f9b626e5e5941", + "reference": "5570de31e8fbc03777a8c61eb24f9b626e5e5941", "shasum": "" }, "require": { @@ -2400,7 +2468,6 @@ "symfony/dom-crawler": "~2.0,>=2.0.5", "symfony/expression-language": "~2.4", "symfony/finder": "~2.0,>=2.0.5", - "symfony/phpunit-bridge": "~2.7", "symfony/process": "~2.0,>=2.0.5", "symfony/routing": "~2.2", "symfony/stopwatch": "~2.3", @@ -2426,7 +2493,10 @@ "autoload": { "psr-4": { "Symfony\\Component\\HttpKernel\\": "" - } + }, + "exclude-from-classmap": [ + "/Tests/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -2444,28 +2514,133 @@ ], "description": "Symfony HttpKernel Component", "homepage": "https://symfony.com", - "time": "2015-07-31 13:24:45" + "time": "2015-11-23 11:57:49" }, { - "name": "symfony/process", - "version": "v2.7.3", + "name": "symfony/polyfill-php56", + "version": "v1.0.0", "source": { "type": "git", - "url": "https://github.com/symfony/Process.git", - "reference": "48aeb0e48600321c272955132d7606ab0a49adb3" + "url": "https://github.com/symfony/polyfill-php56.git", + "reference": "a6bd4770a6967517e6610529e14afaa3111094a3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Process/zipball/48aeb0e48600321c272955132d7606ab0a49adb3", - "reference": "48aeb0e48600321c272955132d7606ab0a49adb3", + "url": "https://api.github.com/repos/symfony/polyfill-php56/zipball/a6bd4770a6967517e6610529e14afaa3111094a3", + "reference": "a6bd4770a6967517e6610529e14afaa3111094a3", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "symfony/polyfill-util": "~1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Php56\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 5.6+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "time": "2015-11-04 20:28:58" + }, + { + "name": "symfony/polyfill-util", + "version": "v1.0.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-util.git", + "reference": "4271c55cbc0a77b2641f861b978123e46b3da969" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-util/zipball/4271c55cbc0a77b2641f861b978123e46b3da969", + "reference": "4271c55cbc0a77b2641f861b978123e46b3da969", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Util\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony utilities for portability of PHP codes", + "homepage": "https://symfony.com", + "keywords": [ + "compat", + "compatibility", + "polyfill", + "shim" + ], + "time": "2015-11-04 20:28:58" + }, + { + "name": "symfony/process", + "version": "v2.7.7", + "source": { + "type": "git", + "url": "https://github.com/symfony/process.git", + "reference": "f6290983c8725d0afa29bdc3e5295879de3e58f5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/process/zipball/f6290983c8725d0afa29bdc3e5295879de3e58f5", + "reference": "f6290983c8725d0afa29bdc3e5295879de3e58f5", "shasum": "" }, "require": { "php": ">=5.3.9" }, - "require-dev": { - "symfony/phpunit-bridge": "~2.7" - }, "type": "library", "extra": { "branch-alias": { @@ -2475,7 +2650,10 @@ "autoload": { "psr-4": { "Symfony\\Component\\Process\\": "" - } + }, + "exclude-from-classmap": [ + "/Tests/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -2493,20 +2671,20 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2015-07-01 11:25:50" + "time": "2015-11-19 16:11:24" }, { "name": "symfony/routing", - "version": "v2.7.3", + "version": "v2.7.7", "source": { "type": "git", - "url": "https://github.com/symfony/Routing.git", - "reference": "ea9134f277162b02e5f80ac058b75a77637b0d26" + "url": "https://github.com/symfony/routing.git", + "reference": "7450f6196711b124fb8b04a12286d01a0401ddfe" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Routing/zipball/ea9134f277162b02e5f80ac058b75a77637b0d26", - "reference": "ea9134f277162b02e5f80ac058b75a77637b0d26", + "url": "https://api.github.com/repos/symfony/routing/zipball/7450f6196711b124fb8b04a12286d01a0401ddfe", + "reference": "7450f6196711b124fb8b04a12286d01a0401ddfe", "shasum": "" }, "require": { @@ -2522,7 +2700,6 @@ "symfony/config": "~2.7", "symfony/expression-language": "~2.4", "symfony/http-foundation": "~2.3", - "symfony/phpunit-bridge": "~2.7", "symfony/yaml": "~2.0,>=2.0.5" }, "suggest": { @@ -2540,7 +2717,10 @@ "autoload": { "psr-4": { "Symfony\\Component\\Routing\\": "" - } + }, + "exclude-from-classmap": [ + "/Tests/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -2564,20 +2744,20 @@ "uri", "url" ], - "time": "2015-07-09 16:07:40" + "time": "2015-11-18 13:41:01" }, { "name": "symfony/translation", - "version": "v2.7.3", + "version": "v2.7.7", "source": { "type": "git", - "url": "https://github.com/symfony/Translation.git", - "reference": "c8dc34cc936152c609cdd722af317e4239d10dd6" + "url": "https://github.com/symfony/translation.git", + "reference": "e4ecb9c3ba1304eaf24de15c2d7a428101c1982f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Translation/zipball/c8dc34cc936152c609cdd722af317e4239d10dd6", - "reference": "c8dc34cc936152c609cdd722af317e4239d10dd6", + "url": "https://api.github.com/repos/symfony/translation/zipball/e4ecb9c3ba1304eaf24de15c2d7a428101c1982f", + "reference": "e4ecb9c3ba1304eaf24de15c2d7a428101c1982f", "shasum": "" }, "require": { @@ -2589,8 +2769,7 @@ "require-dev": { "psr/log": "~1.0", "symfony/config": "~2.7", - "symfony/intl": "~2.3", - "symfony/phpunit-bridge": "~2.7", + "symfony/intl": "~2.4", "symfony/yaml": "~2.2" }, "suggest": { @@ -2607,7 +2786,10 @@ "autoload": { "psr-4": { "Symfony\\Component\\Translation\\": "" - } + }, + "exclude-from-classmap": [ + "/Tests/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -2625,28 +2807,25 @@ ], "description": "Symfony Translation Component", "homepage": "https://symfony.com", - "time": "2015-07-09 16:07:40" + "time": "2015-11-18 13:41:01" }, { "name": "symfony/var-dumper", - "version": "v2.7.3", + "version": "v2.7.7", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "e8903ebba5eb019f5886ffce739ea9e3b7519579" + "reference": "72bcb27411780eaee9469729aace73c0d46fb2b8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/e8903ebba5eb019f5886ffce739ea9e3b7519579", - "reference": "e8903ebba5eb019f5886ffce739ea9e3b7519579", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/72bcb27411780eaee9469729aace73c0d46fb2b8", + "reference": "72bcb27411780eaee9469729aace73c0d46fb2b8", "shasum": "" }, "require": { "php": ">=5.3.9" }, - "require-dev": { - "symfony/phpunit-bridge": "~2.7" - }, "suggest": { "ext-symfony_debug": "" }, @@ -2662,7 +2841,10 @@ ], "psr-4": { "Symfony\\Component\\VarDumper\\": "" - } + }, + "exclude-from-classmap": [ + "/Tests/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -2684,20 +2866,20 @@ "debug", "dump" ], - "time": "2015-07-28 15:18:12" + "time": "2015-11-18 13:41:01" }, { "name": "venturecraft/revisionable", - "version": "1.23.0", + "version": "1.24.0", "source": { "type": "git", "url": "https://github.com/VentureCraft/revisionable.git", - "reference": "75af7add8d857ac0dfcb41398f1958c7ac51d72c" + "reference": "99c27d94f80ae9240cec89c4276f61e748e989a5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/VentureCraft/revisionable/zipball/75af7add8d857ac0dfcb41398f1958c7ac51d72c", - "reference": "75af7add8d857ac0dfcb41398f1958c7ac51d72c", + "url": "https://api.github.com/repos/VentureCraft/revisionable/zipball/99c27d94f80ae9240cec89c4276f61e748e989a5", + "reference": "99c27d94f80ae9240cec89c4276f61e748e989a5", "shasum": "" }, "require": { @@ -2732,7 +2914,7 @@ "model", "revision" ], - "time": "2015-11-09 22:01:31" + "time": "2015-12-09 21:48:10" }, { "name": "vlucas/phpdotenv", @@ -3034,36 +3216,36 @@ }, { "name": "phpspec/phpspec", - "version": "2.2.1", + "version": "2.4.0", "source": { "type": "git", "url": "https://github.com/phpspec/phpspec.git", - "reference": "e9a40577323e67f1de2e214abf32976a0352d8f8" + "reference": "1d3938e6d9ffb1bd4805ea8ddac62ea48767f358" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/phpspec/zipball/e9a40577323e67f1de2e214abf32976a0352d8f8", - "reference": "e9a40577323e67f1de2e214abf32976a0352d8f8", + "url": "https://api.github.com/repos/phpspec/phpspec/zipball/1d3938e6d9ffb1bd4805ea8ddac62ea48767f358", + "reference": "1d3938e6d9ffb1bd4805ea8ddac62ea48767f358", "shasum": "" }, "require": { "doctrine/instantiator": "^1.0.1", + "ext-tokenizer": "*", "php": ">=5.3.3", "phpspec/php-diff": "~1.0.0", "phpspec/prophecy": "~1.4", "sebastian/exporter": "~1.0", - "symfony/console": "~2.3", - "symfony/event-dispatcher": "~2.1", - "symfony/finder": "~2.1", - "symfony/process": "~2.1", - "symfony/yaml": "~2.1" + "symfony/console": "~2.3|~3.0", + "symfony/event-dispatcher": "~2.1|~3.0", + "symfony/finder": "~2.1|~3.0", + "symfony/process": "^2.6|~3.0", + "symfony/yaml": "~2.1|~3.0" }, "require-dev": { "behat/behat": "^3.0.11", "bossa/phpspec2-expect": "~1.0", "phpunit/phpunit": "~4.4", - "symfony/filesystem": "~2.1", - "symfony/process": "~2.1" + "symfony/filesystem": "~2.1|~3.0" }, "suggest": { "phpspec/nyan-formatters": "~1.0 – Adds Nyan formatters" @@ -3108,7 +3290,7 @@ "testing", "tests" ], - "time": "2015-05-30 15:21:40" + "time": "2015-11-29 02:03:49" }, { "name": "phpspec/prophecy", @@ -3172,16 +3354,16 @@ }, { "name": "phpunit/php-code-coverage", - "version": "2.2.2", + "version": "2.2.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "2d7c03c0e4e080901b8f33b2897b0577be18a13c" + "reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/2d7c03c0e4e080901b8f33b2897b0577be18a13c", - "reference": "2d7c03c0e4e080901b8f33b2897b0577be18a13c", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/eabf68b476ac7d0f73793aada060f1c1a9bf8979", + "reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979", "shasum": "" }, "require": { @@ -3230,7 +3412,7 @@ "testing", "xunit" ], - "time": "2015-08-04 03:42:39" + "time": "2015-10-06 15:47:00" }, { "name": "phpunit/php-file-iterator", @@ -3363,16 +3545,16 @@ }, { "name": "phpunit/php-token-stream", - "version": "1.4.6", + "version": "1.4.8", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "3ab72c62e550370a6cd5dc873e1a04ab57562f5b" + "reference": "3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/3ab72c62e550370a6cd5dc873e1a04ab57562f5b", - "reference": "3ab72c62e550370a6cd5dc873e1a04ab57562f5b", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da", + "reference": "3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da", "shasum": "" }, "require": { @@ -3408,20 +3590,20 @@ "keywords": [ "tokenizer" ], - "time": "2015-08-16 08:51:00" + "time": "2015-09-15 10:49:45" }, { "name": "phpunit/phpunit", - "version": "4.8.6", + "version": "4.8.21", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "2246830f4a1a551c67933e4171bf2126dc29d357" + "reference": "ea76b17bced0500a28098626b84eda12dbcf119c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/2246830f4a1a551c67933e4171bf2126dc29d357", - "reference": "2246830f4a1a551c67933e4171bf2126dc29d357", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/ea76b17bced0500a28098626b84eda12dbcf119c", + "reference": "ea76b17bced0500a28098626b84eda12dbcf119c", "shasum": "" }, "require": { @@ -3480,20 +3662,20 @@ "testing", "xunit" ], - "time": "2015-08-24 04:09:38" + "time": "2015-12-12 07:45:58" }, { "name": "phpunit/phpunit-mock-objects", - "version": "2.3.7", + "version": "2.3.8", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", - "reference": "5e2645ad49d196e020b85598d7c97e482725786a" + "reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/5e2645ad49d196e020b85598d7c97e482725786a", - "reference": "5e2645ad49d196e020b85598d7c97e482725786a", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/ac8e7a3db35738d56ee9a76e78a4e03d97628983", + "reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983", "shasum": "" }, "require": { @@ -3536,7 +3718,7 @@ "mock", "xunit" ], - "time": "2015-08-19 09:14:08" + "time": "2015-10-02 06:51:40" }, { "name": "sebastian/comparator", @@ -3604,28 +3786,28 @@ }, { "name": "sebastian/diff", - "version": "1.3.0", + "version": "1.4.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "863df9687835c62aa423a22412d26fa2ebde3fd3" + "reference": "13edfd8706462032c2f52b4b862974dd46b71c9e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/863df9687835c62aa423a22412d26fa2ebde3fd3", - "reference": "863df9687835c62aa423a22412d26fa2ebde3fd3", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/13edfd8706462032c2f52b4b862974dd46b71c9e", + "reference": "13edfd8706462032c2f52b4b862974dd46b71c9e", "shasum": "" }, "require": { "php": ">=5.3.3" }, "require-dev": { - "phpunit/phpunit": "~4.2" + "phpunit/phpunit": "~4.8" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.3-dev" + "dev-master": "1.4-dev" } }, "autoload": { @@ -3648,24 +3830,24 @@ } ], "description": "Diff implementation", - "homepage": "http://www.github.com/sebastianbergmann/diff", + "homepage": "https://github.com/sebastianbergmann/diff", "keywords": [ "diff" ], - "time": "2015-02-22 15:13:53" + "time": "2015-12-08 07:14:41" }, { "name": "sebastian/environment", - "version": "1.3.2", + "version": "1.3.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "6324c907ce7a52478eeeaede764f48733ef5ae44" + "reference": "6e7133793a8e5a5714a551a8324337374be209df" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/6324c907ce7a52478eeeaede764f48733ef5ae44", - "reference": "6324c907ce7a52478eeeaede764f48733ef5ae44", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/6e7133793a8e5a5714a551a8324337374be209df", + "reference": "6e7133793a8e5a5714a551a8324337374be209df", "shasum": "" }, "require": { @@ -3702,7 +3884,7 @@ "environment", "hhvm" ], - "time": "2015-08-03 06:14:51" + "time": "2015-12-02 08:37:27" }, { "name": "sebastian/exporter", @@ -3772,16 +3954,16 @@ }, { "name": "sebastian/global-state", - "version": "1.0.0", + "version": "1.1.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "c7428acdb62ece0a45e6306f1ae85e1c05b09c01" + "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/c7428acdb62ece0a45e6306f1ae85e1c05b09c01", - "reference": "c7428acdb62ece0a45e6306f1ae85e1c05b09c01", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bc37d50fea7d017d3d340f230811c9f1d7280af4", + "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4", "shasum": "" }, "require": { @@ -3819,20 +4001,20 @@ "keywords": [ "global state" ], - "time": "2014-10-06 09:23:50" + "time": "2015-10-12 03:26:01" }, { "name": "sebastian/recursion-context", - "version": "1.0.1", + "version": "1.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "994d4a811bafe801fb06dccbee797863ba2792ba" + "reference": "913401df809e99e4f47b27cdd781f4a258d58791" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/994d4a811bafe801fb06dccbee797863ba2792ba", - "reference": "994d4a811bafe801fb06dccbee797863ba2792ba", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/913401df809e99e4f47b27cdd781f4a258d58791", + "reference": "913401df809e99e4f47b27cdd781f4a258d58791", "shasum": "" }, "require": { @@ -3872,7 +4054,7 @@ ], "description": "Provides functionality to recursively process PHP variables", "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "time": "2015-06-21 08:04:50" + "time": "2015-11-11 19:50:13" }, { "name": "sebastian/version", @@ -3911,34 +4093,34 @@ }, { "name": "symfony/yaml", - "version": "v2.7.3", + "version": "v3.0.0", "source": { "type": "git", - "url": "https://github.com/symfony/Yaml.git", - "reference": "71340e996171474a53f3d29111d046be4ad8a0ff" + "url": "https://github.com/symfony/yaml.git", + "reference": "177a015cb0e19ff4a49e0e2e2c5fc1c1bee07002" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Yaml/zipball/71340e996171474a53f3d29111d046be4ad8a0ff", - "reference": "71340e996171474a53f3d29111d046be4ad8a0ff", + "url": "https://api.github.com/repos/symfony/yaml/zipball/177a015cb0e19ff4a49e0e2e2c5fc1c1bee07002", + "reference": "177a015cb0e19ff4a49e0e2e2c5fc1c1bee07002", "shasum": "" }, "require": { - "php": ">=5.3.9" - }, - "require-dev": { - "symfony/phpunit-bridge": "~2.7" + "php": ">=5.5.9" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.7-dev" + "dev-master": "3.0-dev" } }, "autoload": { "psr-4": { "Symfony\\Component\\Yaml\\": "" - } + }, + "exclude-from-classmap": [ + "/Tests/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -3956,7 +4138,7 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2015-07-28 14:07:07" + "time": "2015-11-30 12:36:17" } ], "aliases": [], diff --git a/config/database.php b/config/database.php index f6cf86b4..b71c5e30 100644 --- a/config/database.php +++ b/config/database.php @@ -52,6 +52,12 @@ return [ 'prefix' => '', ], + 'memory' => [ + 'driver' => 'sqlite', + 'database' => ':memory:', + 'prefix' => '', + ], + 'mysql' => [ 'driver' => 'mysql', 'host' => env('DB_HOST', 'localhost'), diff --git a/config/filesystems.php b/config/filesystems.php index 3fffcf0a..14493dcf 100644 --- a/config/filesystems.php +++ b/config/filesystems.php @@ -48,6 +48,11 @@ return [ 'root' => storage_path('app'), ], + 'testing' => [ + 'driver' => 'local', + 'root' => storage_path('app').'/test-files', + ], + 'ftp' => [ 'driver' => 'ftp', 'host' => 'ftp.example.com', diff --git a/database/factories/ModelFactory.php b/database/factories/ModelFactory.php index 4c407d06..1c8381ae 100644 --- a/database/factories/ModelFactory.php +++ b/database/factories/ModelFactory.php @@ -31,9 +31,13 @@ $factory->define(Poniverse\Ponyfm\User::class, function ($faker) { return [ - 'name' => $faker->name, - 'email' => $faker->email, - 'password' => str_random(10), - 'remember_token' => str_random(10), + 'username' => $faker->userName, + 'display_name' => $faker->userName, + 'slug' => $faker->slug, + 'email' => $faker->email, + 'can_see_explicit_content' => true, + 'bio' => $faker->paragraph, + 'track_count' => 0, + 'comment_count' => 0, ]; }); diff --git a/database/migrations/2013_07_28_060804_create_albums.php b/database/migrations/2013_07_28_060804_create_albums.php index 3e8a834d..77158d00 100644 --- a/database/migrations/2013_07_28_060804_create_albums.php +++ b/database/migrations/2013_07_28_060804_create_albums.php @@ -19,12 +19,13 @@ */ use Illuminate\Database\Migrations\Migration; +use Illuminate\Database\Schema\Blueprint; class CreateAlbums extends Migration { public function up() { - Schema::create('albums', function ($table) { + Schema::create('albums', function (Blueprint $table) { $table->increments('id'); $table->integer('user_id')->unsigned(); $table->string('title')->index(); @@ -55,9 +56,16 @@ class CreateAlbums extends Migration public function down() { - Schema::table('tracks', function ($table) { + // These are separated to prevent weirdness with SQLite. + Schema::table('tracks', function (Blueprint $table) { $table->dropForeign('tracks_album_id_foreign'); + }); + + Schema::table('tracks', function (Blueprint $table) { $table->dropColumn('album_id'); + }); + + Schema::table('tracks', function (Blueprint $table) { $table->dropColumn('track_number'); }); diff --git a/database/migrations/2013_09_10_014644_create_latest_column.php b/database/migrations/2013_09_10_014644_create_latest_column.php index e87ec772..3ff0a183 100644 --- a/database/migrations/2013_09_10_014644_create_latest_column.php +++ b/database/migrations/2013_09_10_014644_create_latest_column.php @@ -25,24 +25,26 @@ class CreateLatestColumn extends Migration public function up() { Schema::table('tracks', function ($table) { - $table->boolean('is_latest')->notNullable()->indexed(); + $table->boolean('is_latest')->notNullable()->default(false)->indexed(); }); - DB::update(' - UPDATE tracks t1 - INNER JOIN ( - SELECT id, user_id - FROM tracks - WHERE published_at IS NOT NULL - AND deleted_at IS NULL - ORDER BY created_at DESC - LIMIT 1 - ) t2 - ON t2.id = t1.id - SET is_latest = true - WHERE t2.user_id = t1.user_id - AND published_at IS NOT NULL - '); + if ('sqlite' !== DB::getDriverName()) { + DB::update(' + UPDATE tracks t1 + INNER JOIN ( + SELECT id, user_id + FROM tracks + WHERE published_at IS NOT NULL + AND deleted_at IS NULL + ORDER BY created_at DESC + LIMIT 1 + ) t2 + ON t2.id = t1.id + SET is_latest = true + WHERE t2.user_id = t1.user_id + AND published_at IS NOT NULL + '); + } } public function down() diff --git a/database/migrations/2013_09_23_031316_create_track_hashes.php b/database/migrations/2013_09_23_031316_create_track_hashes.php index a5197c2d..d80a4ff2 100644 --- a/database/migrations/2013_09_23_031316_create_track_hashes.php +++ b/database/migrations/2013_09_23_031316_create_track_hashes.php @@ -26,13 +26,18 @@ class CreateTrackHashes extends Migration public function up() { Schema::table('tracks', function ($table) { - $table->string('hash', 32)->notNullable()->indexed(); + $table->string('hash', 32)->nullable()->indexed(); }); foreach (Track::with('user')->get() as $track) { $track->updateHash(); $track->save(); } + + Schema::table('tracks', function ($table) { + $table->string('hash', 32)->notNullable()->change(); + }); + } public function down() diff --git a/database/migrations/2013_09_24_055911_track_is_listed.php b/database/migrations/2013_09_24_055911_track_is_listed.php index e7ec4576..fc6d6dbb 100644 --- a/database/migrations/2013_09_24_055911_track_is_listed.php +++ b/database/migrations/2013_09_24_055911_track_is_listed.php @@ -25,14 +25,8 @@ class TrackIsListed extends Migration public function up() { Schema::table('tracks', function ($table) { - $table->boolean('is_listed')->notNullable()->indexed(); + $table->boolean('is_listed')->notNullable()->default(true)->indexed(); }); - - DB::update(' - UPDATE - tracks - SET - is_listed = true'); } public function down() diff --git a/database/migrations/2015_09_04_160648_make_email_nullable.php b/database/migrations/2015_09_04_160648_make_email_nullable.php index c494fe35..0294ca4f 100644 --- a/database/migrations/2015_09_04_160648_make_email_nullable.php +++ b/database/migrations/2015_09_04_160648_make_email_nullable.php @@ -30,7 +30,9 @@ class MakeEmailNullable extends Migration */ public function up() { - DB::statement('ALTER TABLE `users` MODIFY `email` VARCHAR(150) NULL;'); + Schema::table('users', function(Blueprint $table){ + $table->string('email', 150)->nullable()->change(); + }); } /** @@ -40,6 +42,8 @@ class MakeEmailNullable extends Migration */ public function down() { - DB::statement('ALTER TABLE `users` MODIFY `email` VARCHAR(150) NOT NULL DEFAULT "";'); + Schema::table('users', function (Blueprint $table) { + $table->string('email', 150)->notNullable()->default('')->change(); + }); } } diff --git a/database/migrations/2015_09_05_113647_add_new_indices.php b/database/migrations/2015_09_05_113647_add_new_indices.php index 5a7364e4..850405f8 100644 --- a/database/migrations/2015_09_05_113647_add_new_indices.php +++ b/database/migrations/2015_09_05_113647_add_new_indices.php @@ -30,7 +30,9 @@ class AddNewIndices extends Migration */ public function up() { - DB::statement('ALTER TABLE `show_songs` ADD FULLTEXT show_songs_title_fulltext (title)'); + if ('sqlite' !== DB::getDriverName()) { + DB::statement('ALTER TABLE `show_songs` ADD FULLTEXT show_songs_title_fulltext (title)'); + } Schema::table('images', function ($table) { $table->index('hash'); @@ -49,7 +51,9 @@ class AddNewIndices extends Migration */ public function down() { - DB::statement('ALTER TABLE `show_songs` DROP INDEX show_songs_title_fulltext'); + if ('sqlite' !== DB::getDriverName()) { + DB::statement('ALTER TABLE `show_songs` DROP INDEX show_songs_title_fulltext'); + } Schema::table('images', function ($table) { $table->dropIndex('images_hash_index'); diff --git a/database/migrations/2015_10_26_192855_update_track_files_with_cache.php b/database/migrations/2015_10_26_192855_update_track_files_with_cache.php index 8b27c22f..401cccf7 100644 --- a/database/migrations/2015_10_26_192855_update_track_files_with_cache.php +++ b/database/migrations/2015_10_26_192855_update_track_files_with_cache.php @@ -45,9 +45,16 @@ class UpdateTrackFilesWithCache extends Migration */ public function down() { + // These are separated to avoid a weird "no such index" error with SQLite. Schema::table('track_files', function (Blueprint $table) { $table->dropColumn('is_cacheable'); + }); + + Schema::table('track_files', function (Blueprint $table) { $table->dropColumn('expires_at'); + }); + + Schema::table('track_files', function (Blueprint $table) { $table->dropColumn('is_in_progress'); }); } diff --git a/database/migrations/2015_10_26_231224_AddTrackSourceColumn.php b/database/migrations/2015_10_26_231224_AddTrackSourceColumn.php index dfa4ec01..3ca5d0cc 100644 --- a/database/migrations/2015_10_26_231224_AddTrackSourceColumn.php +++ b/database/migrations/2015_10_26_231224_AddTrackSourceColumn.php @@ -37,10 +37,9 @@ class AddTrackSourceColumn extends Migration // Mark MLPMA tracks retroactively // --> The default value in the database, set above, will // be used automatically for all non-MLPMA tracks. - $tracks = DB::table('tracks') - ->join('mlpma_tracks', 'mlpma_tracks.track_id', '=', 'tracks.id'); - - $tracks->whereNotNull('mlpma_tracks.id')->update(['source' => 'mlpma']); + DB::table('tracks') + ->where(DB::raw('id IN (SELECT `id` FROM `mlpma_tracks`)')) + ->update(['source' => 'mlpma']); } /** diff --git a/database/migrations/2015_12_24_151903_add_sensible_defaults.php b/database/migrations/2015_12_24_151903_add_sensible_defaults.php new file mode 100644 index 00000000..20815839 --- /dev/null +++ b/database/migrations/2015_12_24_151903_add_sensible_defaults.php @@ -0,0 +1,63 @@ +. + */ + +use Illuminate\Database\Schema\Blueprint; +use Illuminate\Database\Migrations\Migration; + +class AddSensibleDefaults extends Migration +{ + /** + * Run the migrations. + * + * @return void + */ + public function up() + { + Schema::table('tracks', function(Blueprint $table){ + $table->boolean('is_listed')->default(true)->change(); + $table->boolean('is_explicit')->default(false)->change(); + $table->boolean('is_vocal')->default(false)->change(); + $table->boolean('is_downloadable')->default(false)->change(); + + $table->unsignedInteger('play_count')->default(0)->change(); + $table->unsignedInteger('view_count')->default(0)->change(); + $table->unsignedInteger('download_count')->default(0)->change(); + $table->unsignedInteger('favourite_count')->default(0)->change(); + $table->unsignedInteger('comment_count')->default(0)->change(); + }); + + Schema::table('users', function(Blueprint $table){ + $table->boolean('can_see_explicit_content')->default(false)->change(); + $table->text('bio')->default('')->change(); + $table->unsignedInteger('track_count')->default(0)->change(); + $table->unsignedInteger('comment_count')->default(0)->change(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + // This migration is not reversible. + } +} diff --git a/phpunit.xml b/phpunit.xml index 276262db..f6a7a5ca 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -24,5 +24,8 @@ + + + diff --git a/tests/ApiAuthTest.php b/tests/ApiAuthTest.php new file mode 100644 index 00000000..ac824531 --- /dev/null +++ b/tests/ApiAuthTest.php @@ -0,0 +1,59 @@ +. + */ + +use Illuminate\Foundation\Testing\WithoutMiddleware; +use Illuminate\Foundation\Testing\DatabaseMigrations; +use Illuminate\Foundation\Testing\DatabaseTransactions; +use Poniverse\Ponyfm\User; + +class ApiAuthTest extends TestCase { + use DatabaseMigrations; + + /** + * Ensures that when we call the Pony.fm API with a user who has never + * logged into Pony.fm before, a Pony.fm account is created for them using + * their Poniverse details. + */ + public function testApiCreatesNewUser() { + $user = factory(User::class)->make(); + $accessTokenInfo = new \Poniverse\AccessTokenInfo('nonsense-token'); + $accessTokenInfo->setIsActive(true); + $accessTokenInfo->setScopes(['basic', 'ponyfm-upload-track']); + + + $poniverse = Mockery::mock('overload:Poniverse'); + $poniverse->shouldReceive('getUser') + ->andReturn([ + 'username' => $user->username, + 'display_name' => $user->display_name, + 'email' => $user->email, + ]); + + $poniverse->shouldReceive('setAccessToken'); + + $poniverse + ->shouldReceive('getAccessTokenInfo') + ->andReturn($accessTokenInfo); + + $this->dontSeeInDatabase('users', ['username' => $user->username]); + $this->post('/api/v1/tracks', ['access_token' => 'nonsense-token']); + $this->seeInDatabase('users', ['username' => $user->username]); + } +} diff --git a/tests/ApiTest.php b/tests/ApiTest.php new file mode 100644 index 00000000..e375695c --- /dev/null +++ b/tests/ApiTest.php @@ -0,0 +1,59 @@ +. + */ + +use Illuminate\Foundation\Testing\WithoutMiddleware; +use Illuminate\Foundation\Testing\DatabaseMigrations; +use Poniverse\Ponyfm\User; + +class ApiTest extends TestCase { + use DatabaseMigrations; + use WithoutMiddleware; + + public function testUploadWithoutFile() { + $user = factory(User::class)->create(); + + $this->actingAs($user) + ->post('/api/v1/tracks', []) + ->seeJsonEquals([ + 'errors' => [ + 'track' => ['You must upload an audio file!'] + ], + 'message' => 'Validation failed' + ]); + $this->assertResponseStatus(400); + } + + public function testUploadWithFile() { + $this->expectsJobs(Poniverse\Ponyfm\Jobs\EncodeTrackFile::class); + + $user = factory(User::class)->create(); + + $file = $this->getTestFileForUpload('ponyfm-test.flac'); + $this->actingAs($user) + ->call('POST', '/api/v1/tracks', [], [], ['track' => $file]); + + $this->assertResponseStatus(202); + $this->seeJsonEquals([ + 'message' => "This track has been accepted for processing! Poll the status_url to know when it's ready to publish.", + 'id' => 1, + 'status_url' => "http://ponyfm-testing.poni/api/v1/tracks/1/upload-status" + ]); + } +} diff --git a/tests/ExampleTest.php b/tests/ExampleTest.php deleted file mode 100644 index 7e81d37a..00000000 --- a/tests/ExampleTest.php +++ /dev/null @@ -1,19 +0,0 @@ -visit('/') - ->see('Laravel 5'); - } -} diff --git a/tests/TestCase.php b/tests/TestCase.php index 8578b17e..7d33ab5c 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -1,5 +1,23 @@ . + */ + class TestCase extends Illuminate\Foundation\Testing\TestCase { /** @@ -7,7 +25,9 @@ class TestCase extends Illuminate\Foundation\Testing\TestCase * * @var string */ - protected $baseUrl = 'http://localhost'; + protected $baseUrl = 'http://ponyfm-testing.poni'; + + protected static $initializedFiles = false; /** * Creates the application. @@ -22,4 +42,77 @@ class TestCase extends Illuminate\Foundation\Testing\TestCase return $app; } + + /** + * @before + */ + public function initializeTestFiles() { + // Ensure we have the Pony.fm test files + if (!static::$initializedFiles) { + Storage::disk('local')->makeDirectory('test-files'); + $storage = Storage::disk('testing'); + + // To add new test files, upload them to poniverse.net/files + // and add them here with their last-modified date as a Unix + // timestamp. + $files = [ + 'ponyfm-test.flac' => 1450965707 + ]; + + foreach ($files as $filename => $lastModifiedTimestamp) { + if ( + !$storage->has($filename) || + $storage->lastModified($filename) < $lastModifiedTimestamp + ) { + echo "Downloading test file: ${filename}...".PHP_EOL; + + $testFileUrl = "https://poniverse.net/files/ponyfm-test-files/${filename}"; + $data = \Httpful\Request::getQuick($testFileUrl); + + if ($data->code === 200) { + $storage->put( + $filename, + $data->body + ); + } else { + $this->fail("A necessary test file was unavailable: ${testFileUrl}"); + } + } + } + + // Delete any unnecessary test files + foreach ($storage->allFiles() as $filename) { + if (!isset($files[$filename])) { + $storage->delete($filename); + } + } + + static::$initializedFiles = true; + } + + } + + public function tearDown() { + Storage::disk('local')->deleteDirectory('testing-datastore'); + parent::tearDown(); + } + + /** + * Returns an object for testing file uploads using the given test file. + * In a test, to "attach" a file to the `track` field, call the following: + * + * $this->call('POST', '/api/v1/tracks', [], [], ['track' => $file]); + * // then, deal with the response + * + * Adapted from: http://laravel.io/forum/03-09-2014-unit-test-progressive-unit-test-for-uploaded-files-with-validation?page=1#reply-27008 + * + * @param $filename + * @return \Symfony\Component\HttpFoundation\File\UploadedFile + */ + public function getTestFileForUpload($filename) { + Storage::disk('local')->makeDirectory('testing-datastore/tmp'); + Storage::disk('local')->copy("test-files/${filename}", "testing-datastore/tmp/${filename}"); + + return new \Symfony\Component\HttpFoundation\File\UploadedFile(storage_path("app/testing-datastore/tmp/${filename}"), $filename, null, null, null, true); + } }