Laravel 5.8 and updated dependencies (#10489)

* Laravel 5.8
and dependencies

* Fix cache time

* upstream base file changes

* Accidentally ran composer with PHP 7.3

* fix test error

* one more

* one more

* one more

* fix dotenv loading
This commit is contained in:
Tony Murray 2019-08-05 15:54:58 -05:00 committed by GitHub
parent e99f421511
commit 42fd5afb23
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
27 changed files with 440 additions and 899 deletions

View File

@ -42,7 +42,7 @@ class Eloquent
if (!Laravel::isBooted() && is_null(self::$capsule)) {
$install_dir = realpath(__DIR__ . '/../../');
(new Dotenv($install_dir))->load();
Dotenv::create($install_dir)->load();
$db_config = include($install_dir . '/config/database.php');
$settings = $db_config['connections'][$db_config['default']];

View File

@ -43,7 +43,7 @@ use Cache;
class ObjectCache
{
private static $cache_time = 5;
private static $cache_time = 300;
public static function applications()
{

View File

@ -85,7 +85,7 @@ class Checks
return;
}
Cache::put('checks_popup_timeout', true, Config::get('checks_popup_timer', 5));
Cache::put('checks_popup_timeout', true, Config::get('checks_popup_timer', 5) * 60);
$user = Auth::user();

View File

@ -35,9 +35,8 @@
"easybook/geshi": "^1.0.8",
"ezyang/htmlpurifier": "^4.8",
"fico7489/laravel-pivot": "^3.0",
"fideloper/proxy": "^4.0",
"influxdb/influxdb-php": "^1.14",
"laravel/laravel": "5.7.*",
"laravel/laravel": "5.8.*",
"oriceon/toastr-5-laravel": "dev-master",
"pear/console_color2": "^0.1",
"pear/console_table": "^1.3",
@ -47,12 +46,12 @@
"spatie/laravel-cors": "1.3.*",
"symfony/yaml": "^4.0",
"tecnickcom/tcpdf": "~6.2.0",
"wpb/string-blade-compiler": "3.7.x-dev",
"wpb/string-blade-compiler": "3.8.x-dev",
"xjtuwangke/passwordhash": "dev-master"
},
"require-dev": {
"barryvdh/laravel-debugbar": "^3.2",
"barryvdh/laravel-ide-helper": "^2.5",
"barryvdh/laravel-ide-helper": "^2.6",
"beyondcode/laravel-dump-server": "^1.0",
"filp/whoops": "^2.0",
"fzaninotto/faker": "^1.4",
@ -61,8 +60,8 @@
"justinrainbow/json-schema": "^5.2",
"laravel/dusk": "^5.0",
"mockery/mockery": "^1.0",
"nunomaduro/collision": "^2.0",
"phpunit/phpunit": "^7.0",
"nunomaduro/collision": "^3.0",
"phpunit/phpunit": "^7.5",
"squizlabs/php_codesniffer": "^2.9.1",
"staudenmeir/dusk-updater": "^1.0"
},

1207
composer.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -201,6 +201,7 @@ return [
'aliases' => [
'App' => Illuminate\Support\Facades\App::class,
'Arr' => Illuminate\Support\Arr::class,
'Artisan' => Illuminate\Support\Facades\Artisan::class,
'Auth' => Illuminate\Support\Facades\Auth::class,
'Blade' => Illuminate\Support\Facades\Blade::class,
@ -230,6 +231,7 @@ return [
'Schema' => Illuminate\Support\Facades\Schema::class,
'Session' => Illuminate\Support\Facades\Session::class,
'Storage' => Illuminate\Support\Facades\Storage::class,
'Str' => Illuminate\Support\Str::class,
'URL' => Illuminate\Support\Facades\URL::class,
'Validator' => Illuminate\Support\Facades\Validator::class,
'View' => Illuminate\Support\Facades\View::class,

View File

@ -52,6 +52,7 @@ return [
'token' => [
'driver' => 'token_driver',
'provider' => 'token_provider',
'hash' => false,
],
],

View File

@ -45,7 +45,7 @@ return [
'app_id' => env('PUSHER_APP_ID'),
'options' => [
'cluster' => env('PUSHER_APP_CLUSTER'),
'encrypted' => true,
'useTLS' => true,
],
],

View File

@ -21,8 +21,8 @@ return [
| using this caching library. This connection is used when another is
| not explicitly specified when executing a given caching function.
|
| Supported: "apc", "array", "database", "file", "memcached", "redis"
|
| Supported: "apc", "array", "database", "file",
| "memcached", "redis", "dynamodb" |
*/
'default' => env('CACHE_DRIVER', 'array'),
@ -83,6 +83,15 @@ return [
'connection' => 'cache',
],
'dynamodb' => [
'driver' => 'dynamodb',
'key' => env('AWS_ACCESS_KEY_ID'),
'secret' => env('AWS_SECRET_ACCESS_KEY'),
'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
'table' => env('DYNAMODB_CACHE_TABLE', 'cache'),
'endpoint' => env('DYNAMODB_ENDPOINT'),
],
],
/*

View File

@ -8,6 +8,7 @@
| request an environment variable to be created upstream or send a pull request.
*/
use Illuminate\Support\Str;
use LibreNMS\Config;
$fallback_db_config = Config::getDatabaseSettings();
@ -47,6 +48,7 @@ return [
// 'sqlite' => [
// 'driver' => 'sqlite',
// 'url' => env('DATABASE_URL'),
// 'database' => env('DB_DATABASE', database_path('database.sqlite')),
// 'prefix' => '',
// 'foreign_key_constraints' => env('DB_FOREIGN_KEYS', true),
@ -54,6 +56,7 @@ return [
'mysql' => [
'driver' => 'mysql',
'url' => env('DATABASE_URL'),
'host' => env('DB_HOST', $fallback_db_config['db_host']),
'port' => env('DB_PORT', $fallback_db_config['db_port']),
'database' => env('DB_DATABASE', $fallback_db_config['db_name']),
@ -66,6 +69,9 @@ return [
'prefix_indexes' => true,
'strict' => true,
'engine' => null,
'options' => extension_loaded('pdo_mysql') ? array_filter([
PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
]) : [],
],
'testing' => [
@ -85,6 +91,7 @@ return [
'pgsql' => [
'driver' => 'pgsql',
'url' => env('DATABASE_URL'),
'host' => env('DB_HOST', '127.0.0.1'),
'port' => env('DB_PORT', '5432'),
'database' => env('DB_DATABASE', 'forge'),
@ -99,6 +106,7 @@ return [
'sqlsrv' => [
'driver' => 'sqlsrv',
'url' => env('DATABASE_URL'),
'host' => env('DB_HOST', 'localhost'),
'port' => env('DB_PORT', '1433'),
'database' => env('DB_DATABASE', 'forge'),
@ -143,9 +151,14 @@ return [
'redis' => [
'client' => 'predis',
'client' => env('REDIS_CLIENT', 'predis'),
'options' => [
'cluster' => env('REDIS_CLUSTER', 'predis'),
'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_database_'),
],
'default' => [
'url' => env('REDIS_URL'),
'host' => env('REDIS_HOST', '127.0.0.1'),
'password' => env('REDIS_PASSWORD', null),
'port' => env('REDIS_PORT', 6379),
@ -153,6 +166,7 @@ return [
],
'cache' => [
'url' => env('REDIS_URL'),
'host' => env('REDIS_HOST', '127.0.0.1'),
'password' => env('REDIS_PASSWORD', null),
'port' => env('REDIS_PORT', 6379),

View File

@ -20,7 +20,7 @@ return [
| your application here. By default, Laravel is setup for SMTP mail.
|
| Supported: "smtp", "sendmail", "mailgun", "mandrill", "ses",
| "sparkpost", "log", "array"
| "sparkpost", "postmark", "log", "array"
|
*/

View File

@ -53,15 +53,16 @@ return [
'host' => 'localhost',
'queue' => 'default',
'retry_after' => 90,
'block_for' => 0,
],
'sqs' => [
'driver' => 'sqs',
'key' => env('SQS_KEY', 'your-public-key'),
'secret' => env('SQS_SECRET', 'your-secret-key'),
'key' => env('AWS_ACCESS_KEY_ID'),
'secret' => env('AWS_SECRET_ACCESS_KEY'),
'prefix' => env('SQS_PREFIX', 'https://sqs.us-east-1.amazonaws.com/your-account-id'),
'queue' => env('SQS_QUEUE', 'your-queue-name'),
'region' => env('SQS_REGION', 'us-east-1'),
'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
],
'redis' => [

View File

@ -28,10 +28,14 @@ return [
'endpoint' => env('MAILGUN_ENDPOINT', 'api.mailgun.net'),
],
'postmark' => [
'token' => env('POSTMARK_TOKEN'),
],
'ses' => [
'key' => env('SES_KEY'),
'secret' => env('SES_SECRET'),
'region' => env('SES_REGION', 'us-east-1'),
'key' => env('AWS_ACCESS_KEY_ID'),
'secret' => env('AWS_SECRET_ACCESS_KEY'),
'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
],
'sparkpost' => [

View File

@ -22,7 +22,7 @@ return [
| you may specify any of the other wonderful drivers provided here.
|
| Supported: "file", "cookie", "database", "apc",
| "memcached", "redis", "array"
| "memcached", "redis", "dynamodb", "array"
|
*/
@ -100,9 +100,9 @@ return [
| Session Cache Store
|--------------------------------------------------------------------------
|
| When using the "apc" or "memcached" session drivers, you may specify a
| cache store that should be used for these sessions. This value must
| correspond with one of the application's configured cache stores.
| When using the "apc", "memcached", or "dynamodb" session drivers you may
| list a cache store that should be used for these sessions. This value
| must match with one of the application's configured cache "stores".
|
*/

View File

@ -10,12 +10,12 @@
"production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
},
"devDependencies": {
"axios": "^0.18",
"bootstrap": "^4.0.0",
"axios": "^0.19",
"bootstrap": "^4.1.0",
"cross-env": "^5.1",
"jquery": "^3.2",
"laravel-mix": "^4.0.7",
"lodash": "^4.17.5",
"lodash": "^4.17.13",
"popper.js": "^1.12",
"resolve-url-loader": "^2.3.1",
"sass": "^1.15.2",

View File

@ -33,12 +33,12 @@
</whitelist>
</filter>
<php>
<env name="APP_ENV" value="testing"/>
<env name="BCRYPT_ROUNDS" value="4"/>
<env name="CACHE_DRIVER" value="array"/>
<env name="MAIL_DRIVER" value="array"/>
<env name="QUEUE_CONNECTION" value="sync"/>
<env name="SESSION_DRIVER" value="array"/>
<env name="DB_CONNECTION" value="testing"/>
<server name="APP_ENV" value="testing"/>
<server name="BCRYPT_ROUNDS" value="4"/>
<server name="CACHE_DRIVER" value="array"/>
<server name="MAIL_DRIVER" value="array"/>
<server name="QUEUE_CONNECTION" value="sync"/>
<server name="SESSION_DRIVER" value="array"/>
<server name="DB_CONNECTION" value="testing"/>
</php>
</phpunit>

View File

@ -17,8 +17,8 @@ window.Vue = require('vue');
* Eg. ./components/ExampleComponent.vue -> <example-component></example-component>
*/
const files = require.context('./', true, /\.vue$/i)
files.keys().map(key => Vue.component(key.split('/').pop().split('.')[0], files(key).default))
const files = require.context('./', true, /\.vue$/i);
files.keys().map(key => Vue.component(key.split('/').pop().split('.')[0], files(key).default));
/**
* Next, we will create a fresh Vue application instance and attach it to
@ -27,5 +27,5 @@ files.keys().map(key => Vue.component(key.split('/').pop().split('.')[0], files(
*/
const app = new Vue({
el: '#app'
el: '#app',
});

View File

@ -1,4 +1,3 @@
window._ = require('lodash');
/**

View File

@ -13,7 +13,7 @@ return [
|
*/
'password' => 'Passwords must be at least six characters and match the confirmation.',
'password' => 'Passwords must be at least eight characters and match the confirmation.',
'reset' => 'Your password has been reset!',
'sent' => 'We have e-mailed your password reset link!',
'token' => 'This password reset token is invalid.',

View File

@ -40,6 +40,7 @@ return [
'dimensions' => 'The :attribute has invalid image dimensions.',
'distinct' => 'The :attribute field has a duplicate value.',
'email' => 'The :attribute must be a valid email address.',
'ends_with' => 'The :attribute must end with one of the following: :values',
'exists' => 'The selected :attribute is invalid.',
'file' => 'The :attribute must be a file.',
'filled' => 'The :attribute field must have a value.',

View File

@ -3,7 +3,7 @@
$body-bg: #f8fafc;
// Typography
$font-family-sans-serif: "Nunito", sans-serif;
$font-family-sans-serif: 'Nunito', sans-serif;
$font-size-base: 0.9rem;
$line-height-base: 1.6;
@ -11,7 +11,7 @@ $line-height-base: 1.6;
$blue: #3490dc;
$indigo: #6574cd;
$purple: #9561e2;
$pink: #f66D9b;
$pink: #f66d9b;
$red: #e3342f;
$orange: #f6993f;
$yellow: #ffed4a;

View File

@ -1,4 +1,3 @@
// Fonts
@import url('https://fonts.googleapis.com/css?family=Nunito');
@ -7,8 +6,3 @@
// Bootstrap
@import '~bootstrap/scss/bootstrap';
.navbar-laravel {
background-color: #fff;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

View File

@ -34,7 +34,7 @@ class AuthSSOTest extends DBTestCase
private $original_auth_mech = null;
private $server;
public function setUp()
public function setUp(): void
{
parent::setUp();
@ -470,7 +470,7 @@ class AuthSSOTest extends DBTestCase
$this->assertTrue($a->authSSOParseGroups() === 10);
}
public function tearDown()
public function tearDown(): void
{
Config::set('auth_mechanism', $this->original_auth_mech);
Config::forget('sso');

View File

@ -31,7 +31,7 @@ class DBSetupTest extends DBTestCase
{
protected $db_name;
public function setUp()
public function setUp(): void
{
parent::setUp();
$this->db_name = dbFetchCell('SELECT DATABASE()');

View File

@ -27,14 +27,14 @@ namespace LibreNMS\Tests;
abstract class DBTestCase extends LaravelTestCase
{
public function setUp()
public function setUp(): void
{
parent::setUp();
$this->dbSetUp();
set_debug(false);
}
public function tearDown()
public function tearDown(): void
{
$this->dbTearDown();
parent::tearDown();

View File

@ -42,7 +42,7 @@ abstract class TestCase extends \PHPUnit\Framework\TestCase
$this->snmpsim = $snmpsim;
}
public function setUp()
public function setUp(): void
{
parent::setUp();
set_debug(false); // prevent warnings from stopping execution for legacy code

View File

@ -12,4 +12,4 @@ const mix = require('laravel-mix');
*/
mix.js('resources/js/app.js', 'public/js')
.sass('resources/sass/app.scss', 'public/css');
.sass('resources/sass/app.scss', 'public/css');