winter/config/database.php
Luke Towers f6510979cc Sync config defaults with Laravel 9.x skeleton
Changed from Laravel defaults:
- Array configuration items should have their assigner operators aligned and keys should be sorted alphabetically

Removed:
- database.fetch: Removed from the default in Laravel 5.4 (and originally changed to FETCH_OBJ in 5.3) see 770c41552f & https://github.com/laravel/laravel/pull/3815
- filesystems.cloud: Removed from the default in Laravel 8.4.4 since it's not good practice to use Storage::cloud(), should use explicit disk configurations instead. See 82213fbf40
- services.mandrill: No longer officially supported since < Laravel 6.x; can use the SMTP driver instead
- services.sparkport: No longer officially supported in Laravel since < Laravel 6.x or Winter since v1.2 (third party package to reprovide driver is available but config should be manually added when desired.)
- services.stripe: Removed in Laravel v5.8.35, see 83d2ecc0e9

Explicitly not synced:
- Some calls to env(), will be addressed by future work on the ConfigWriter
- auth.php, will be addressed by future work to bring the Winter auth system more in line with the Laravel one
- cors.php, not implemented by default in Winter at the moment, plugins are available
- filesystems.php: storage.links & storage.disks.public not included because storage:link is not supported by Winter yet and further thought is needed for its inclusion.
- mail.php: markdown - Laravel's markdown mail functionality not verified to work within Winter which has it's own set of email templating logic. May be investigated and included later down the road if desired.
- sanctum.php: Laravel Sanctum is an authentication system for Laravel that is completely untested with Winter. Can be evaluated at a later date for inclusion.
2022-02-14 14:42:24 -06:00

145 lines
5.3 KiB
PHP

<?php
return [
/*
|--------------------------------------------------------------------------
| Default Database Connection Name
|--------------------------------------------------------------------------
|
| Here you may specify which of the database connections below you wish
| to use as your default connection for all database work. Of course
| you may use many connections at once using the Database library.
|
*/
'default' => 'mysql',
/*
|--------------------------------------------------------------------------
| Database Connections
|--------------------------------------------------------------------------
|
| Here are each of the database connections setup for your application.
| Of course, examples of configuring each database platform that is
| supported by Winter CMS is shown below to make development simple.
|
| All database work in Winter CMS is done through the PHP PDO facilities
| so make sure you have the driver for your particular database of
| choice installed on your machine before you begin development.
|
*/
'connections' => [
'sqlite' => [
'database' => env('DB_DATABASE', storage_path('database.sqlite')),
'driver' => 'sqlite',
'foreign_key_constraints' => env('DB_FOREIGN_KEYS', true),
'prefix' => '',
'url' => env('DATABASE_URL'),
],
'mysql' => [
'charset' => 'utf8mb4',
'collation' => 'utf8mb4_unicode_ci',
'database' => env('DB_DATABASE', 'winter'),
'driver' => 'mysql',
'engine' => 'InnoDB',
'host' => env('DB_HOST', '127.0.0.1'),
'options' => extension_loaded('pdo_mysql') ? array_filter([
PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
]) : [],
'password' => env('DB_PASSWORD', ''),
'port' => env('DB_PORT', '3306'),
'prefix' => '',
'prefix_indexes' => true,
'strict' => true,
'unix_socket' => env('DB_SOCKET', ''),
'url' => env('DATABASE_URL'),
'username' => env('DB_USERNAME', 'winter'),
'varcharmax' => 191,
],
'pgsql' => [
'charset' => 'utf8',
'database' => env('DB_DATABASE', 'winter'),
'driver' => 'pgsql',
'host' => env('DB_HOST', '127.0.0.1'),
'password' => env('DB_PASSWORD', ''),
'port' => env('DB_PORT', '5432'),
'prefix' => '',
'prefix_indexes' => true,
'search_path' => 'public',
'sslmode' => 'prefer',
'url' => env('DATABASE_URL'),
'username' => env('DB_USERNAME', 'winter'),
],
'sqlsrv' => [
'charset' => 'utf8',
'database' => env('DB_DATABASE', 'winter'),
'driver' => 'sqlsrv',
'host' => env('DB_HOST', '127.0.0.1'),
'password' => env('DB_PASSWORD', ''),
'port' => env('DB_PORT', '1433'),
'prefix' => '',
'prefix_indexes' => true,
'url' => env('DATABASE_URL'),
'username' => env('DB_USERNAME', 'winter'),
],
],
/*
|--------------------------------------------------------------------------
| Migration Repository Table
|--------------------------------------------------------------------------
|
| This table keeps track of all the migrations that have already run for
| your application. Using this information, we can determine which of
| the migrations on disk haven't actually been run in the database.
|
*/
'migrations' => 'migrations',
/*
|--------------------------------------------------------------------------
| Redis Databases
|--------------------------------------------------------------------------
|
| Redis is an open source, fast, and advanced key-value store that also
| provides a richer body of commands than a typical key-value system
| such as APC or Memcached. Winter makes it easy to dig right in.
|
*/
'redis' => [
'client' => env('REDIS_CLIENT', 'phpredis'),
'options' => [
'cluster' => env('REDIS_CLUSTER', 'redis'),
'prefix' => env('REDIS_PREFIX', str_slug(env('APP_NAME', 'winter'), '_').'_database_'),
],
'default' => [
'database' => env('REDIS_DB', '0'),
'host' => env('REDIS_HOST', '127.0.0.1'),
'password' => env('REDIS_PASSWORD'),
'port' => env('REDIS_PORT', '6379'),
'url' => env('REDIS_URL'),
],
'cache' => [
'database' => env('REDIS_CACHE_DB', '1'),
'host' => env('REDIS_HOST', '127.0.0.1'),
'password' => env('REDIS_PASSWORD'),
'port' => env('REDIS_PORT', '6379'),
'url' => env('REDIS_URL'),
],
],
];