Merge branch 'wip/config-write-replacement' into wip/config-file

# Conflicts:
#	config/app.php
#	config/auth.php
#	config/cms.php
#	config/database.php
This commit is contained in:
Luke Towers 2022-03-15 21:52:10 -06:00
commit 3da0a32393
11 changed files with 26 additions and 51 deletions

View File

@ -1,7 +1,7 @@
{
"files.associations": {
"**/modules/*/behaviors/*/partials/*.htm": "php",
"**/modules/*/controllers/*.htm": "php",
"**/modules/*/controllers/*/*.htm": "php",
"**/modules/*/formwidgets/*/partials/*.htm": "php",
"**/modules/*/layouts/*.htm": "php",
"**/modules/*/models/*/*.htm": "php",

View File

@ -249,7 +249,7 @@ return [
// 'Illuminate\Html\HtmlServiceProvider', // Example
'System\ServiceProvider',
System\ServiceProvider::class,
]),
/*

View File

@ -11,7 +11,8 @@ return [
| If set to true, users will be given a limited number of attempts to sign
| in to the Backend before being blocked for a specified number of minutes.
|
*/
*/
'enabled' => true,
/*
@ -21,7 +22,8 @@ return [
|
| Number of failed attempts allowed while trying to authenticate a user.
|
*/
*/
'attemptLimit' => 5,
/*
@ -32,7 +34,8 @@ return [
| The number of minutes to suspend further attempts on authentication once
| the attempt limit is reached.
|
*/
*/
'suspensionTime' => 15,
],

View File

@ -91,7 +91,7 @@ return [
|
*/
'backendSkin' => 'Backend\Skins\Standard',
'backendSkin' => \Backend\Skins\Standard::class,
/*
|--------------------------------------------------------------------------
@ -156,7 +156,7 @@ return [
|
*/
'enableRoutesCache' => false,
'enableRoutesCache' => env('ROUTES_CACHE', false),
/*
|--------------------------------------------------------------------------
@ -196,7 +196,7 @@ return [
|
*/
'enableAssetCache' => false,
'enableAssetCache' => env('ASSET_CACHE', false),
/*
|--------------------------------------------------------------------------
@ -250,7 +250,7 @@ return [
|
*/
'databaseTemplates' => false,
'databaseTemplates' => env('DATABASE_TEMPLATES', false),
/*
|--------------------------------------------------------------------------
@ -360,7 +360,7 @@ return [
|
*/
'linkPolicy' => 'detect',
'linkPolicy' => env('LINK_POLICY', 'detect'),
/*
|--------------------------------------------------------------------------
@ -396,7 +396,7 @@ return [
|
*/
'enableCsrfProtection' => true,
'enableCsrfProtection' => env('ENABLE_CSRF', true),
/*
|--------------------------------------------------------------------------

View File

@ -58,7 +58,6 @@ return [
'unix_socket' => env('DB_SOCKET', ''),
'url' => env('DATABASE_URL'),
'username' => env('DB_USERNAME', 'winter'),
'varcharmax' => 191,
],
'pgsql' => [

View File

@ -24,18 +24,12 @@ class DbBackendTimestampFix extends Migration
DbDongle::convertTimestamps($table);
}
// Use this opportunity to reset backend preferences and styles for stable
Db::table('system_settings')
->where('item', 'backend_brand_settings')
->delete()
;
// Use this opportunity to reset backend preferences for stable
Db::table('backend_user_preferences')
->where('namespace', 'backend')
->where('group', 'backend')
->where('item', 'preferences')
->delete()
;
->delete();
}
public function down()

View File

@ -80,7 +80,7 @@ trait UploadableWidget
// Use the configured upload path unless it's null, in which case use the user-provided path
$path = !empty($this->uploadPath) ? $this->uploadPath : Request::input('path');
$path = MediaLibrary::validatePath($path);
$filePath = $path . '/' . $fileName;
$filePath = rtrim($path, '/') . '/' . $fileName;
/*
* getRealPath() can be empty for some environments (IIS)

View File

@ -83,9 +83,6 @@ class ServiceProvider extends ModuleServiceProvider
*/
public function boot()
{
// Fix UTF8MB4 support for MariaDB < 10.2 and MySQL < 5.7
$this->applyDatabaseDefaultStringLength();
// Fix use of Storage::url() for local disks that haven't been configured correctly
foreach (Config::get('filesystems.disks') as $key => $config) {
if ($config['driver'] === 'local' && ends_with($config['root'], '/storage/app') && empty($config['url'])) {
@ -313,6 +310,7 @@ class ServiceProvider extends ModuleServiceProvider
App::singleton('twig.environment.mailer', function ($app) {
$twig = MarkupManager::makeBaseTwigEnvironment();
$twig->addTokenParser(new \System\Twig\MailPartialTokenParser);
return $twig;
});
// Register .htm extension for Twig views
@ -610,24 +608,4 @@ class ServiceProvider extends ModuleServiceProvider
{
View::share('appName', Config::get('app.name'));
}
/**
* Fix UTF8MB4 support for old versions of MariaDB (<10.2) and MySQL (<5.7)
*/
protected function applyDatabaseDefaultStringLength()
{
if (Db::getDriverName() !== 'mysql') {
return;
}
$defaultStrLen = Db::getConfig('varcharmax');
if ($defaultStrLen === null && Db::getConfig('charset') === 'utf8mb4') {
$defaultStrLen = 191;
}
if ($defaultStrLen !== null) {
Schema::defaultStringLength((int) $defaultStrLen);
}
}
}

View File

@ -556,7 +556,7 @@ class MediaLibrary
* @param string $path Specifies a path to process.
* @return string Returns a processed string.
*/
protected function getMediaPath($path)
public function getMediaPath($path)
{
return $this->storageFolder.$path;
}
@ -774,7 +774,7 @@ class MediaLibrary
* communicating with the remote storage.
* @return mixed Returns the storage disk object.
*/
protected function getStorageDisk()
public function getStorageDisk()
{
if ($this->storageDisk) {
return $this->storageDisk;

View File

@ -22,6 +22,11 @@ class DbSystemTimestampFix extends Migration
DbDongle::convertTimestamps($table, $columns);
}
// Use this opportunity to reset backend styles for stable
Db::table('system_settings')
->where('item', 'backend_brand_settings')
->delete();
}
public function down()

View File

@ -6,7 +6,6 @@ use Block;
use SystemException;
use Exception;
use Throwable;
use Symfony\Component\Debug\Exception\FatalThrowableError;
use Config;
/**
@ -246,11 +245,8 @@ trait ViewMaker
try {
include $filePath;
}
catch (Exception $e) {
$this->handleViewException($e, $obLevel);
}
catch (Throwable $e) {
$this->handleViewException(new FatalThrowableError($e), $obLevel);
$this->handleViewException($e, $obLevel);
}
return ob_get_clean();