ConfigWriter issue if you winter:env before winter:install #59
-
Description:If you run winter:env before winter:install, you'll encounter: In ConfigWriter.php(45) : eval()'d code line 128: syntax error, unexpected ',', expecting ';' Full output: daniel@desktop:/mnt/d/VBRP/Brumalia/install$ docker exec -ti -u www-data winter_web bash -c "cd /var/www/html && php artisan winter:install"
.========================================================================.
db d8b db d888888b d8b db d888888b d88888b d8888b. ...
88 I8I 88 `88' 888o 88 `~~88~~' 88' 88 `8D ... ..... ...
88 I8I 88 88 88V8o 88 88 88ooooo 88oobY' .. ... ..
Y8 I8I 88 88 88 V8o88 88 88~~~~~ 88`8b .. ... ..
`8b d8'8b d8' .88. 88 V888 88 88. 88 `88. ... ..... ...
`8b8' `8d8' Y888888P VP V8P YP Y88888P 88 YD ...
`============================= INSTALLATION =============================
Database type [SQLite]:
[0] MySQL
[1] Postgres
[2] SQLite
[3] SQL Server
> 0
MySQL Host [localhost]:
> mysql.home.hawton.io
MySQL Port [3306]:
> 3306
Database Name [database]:
> brumalia
MySQL Login [root]:
> root
MySQL Password []:
> --snip, even though it's a dev test env-- In ConfigWriter.php(45) : eval()'d code line 128: syntax error, unexpected ',', expecting ';'` Steps To Reproduce:
Additional info:It appears the preg_replace is catching the "redis" array's default item, and changing that as well. When I attempted to debug the eval'd contents, this is what was being passed to eval: <?php return [
/*
|--------------------------------------------------------------------------
| PDO Fetch Style
|--------------------------------------------------------------------------
|
| By default, database results will be returned as instances of the PHP
| stdClass object; however, you may desire to retrieve records in an
| array format for simplicity. Here you can tweak the fetch style.
|
*/
'fetch' => PDO::FETCH_CLASS,
/*
|--------------------------------------------------------------------------
| Default Database Connection Name
|--------------------------------------------------------------------------
|
| 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' => env('DB_CONNECTION', '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 Laravel is shown below to make development simple.
|
|
| All database work in Laravel 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' => [
'driver' => 'sqlite',
'database' => env('DB_DATABASE', 'storage/database.sqlite'),
'prefix' => '',
],
'mysql' => [
'driver' => 'mysql',
'engine' => 'InnoDB',
'host' => env('DB_HOST', 'localhost'),
'port' => env('DB_PORT', 3306),
'database' => env('DB_DATABASE', 'database'),
'username' => env('DB_USERNAME', ''),
'password' => env('DB_PASSWORD', ''),
'charset' => 'utf8mb4',
'collation' => 'utf8mb4_unicode_ci',
'prefix' => '',
'varcharmax' => 191,
],
'pgsql' => [
'driver' => 'pgsql',
'host' => env('DB_HOST', 'localhost'),
'port' => env('DB_PORT', 5432),
'database' => env('DB_DATABASE', 'database'),
'username' => env('DB_USERNAME', ''),
'password' => env('DB_PASSWORD', ''),
'charset' => 'utf8',
'prefix' => '',
'schema' => 'public',
],
'sqlsrv' => [
'driver' => 'sqlsrv',
'host' => env('DB_HOST', 'localhost'),
'port' => env('DB_PORT', 5432),
'database' => env('DB_DATABASE', 'database'),
'username' => env('DB_USERNAME', ''),
'password' => env('DB_PASSWORD', ''),
'prefix' => '',
],
],
/*
|--------------------------------------------------------------------------
| 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 have not actually be run in the databases.
|
*/
'migrations' => 'migrations',
/*
|--------------------------------------------------------------------------
| Redis Databases
|--------------------------------------------------------------------------
|
| Redis is an open source, fast, and advanced key-value store that also
| provides a richer set of commands than a typical key-value systems
| such as APC or Memcached. Laravel makes it easy to dig right in.
|
*/
'redis' => [
'client' => 'predis',
'cluster' => false,
'default' => 'mysql',
'password' => env('REDIS_PASSWORD', null),
'port' => env('REDIS_PORT', 6379),
'database' => 0,
],
],
/*
|--------------------------------------------------------------------------
| Use DB configuration for testing
|--------------------------------------------------------------------------
|
| When running plugin tests Winter CMS by default uses SQLite in memory.
| You can override this behavior by setting `useConfigForTesting` to true.
|
| After that Winter CMS will take DB parameters from the config.
| If file `/config/testing/database.php` exists, config will be read from it,
| but remember that when not specified it will use parameters specified in
| `/config/database.php`.
|
*/
'useConfigForTesting' => env('DB_USE_CONFIG_FOR_TESTING', false),
]; Notice redis.default is no longer an array, but a string of "mysql". |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
@dhawton If you use |
Beta Was this translation helpful? Give feedback.
@dhawton
winter:env
andwinter:install
do basically the same thing, in that the set up your configuration for use in Winter (install
then follows this up with additional work). They're not really designed to be used together.If you use
winter:env
to set up your.env
file, you should instead runwinter:up
afterwards to run the migrations. You would only usewinter:install
on a fresh copy without any modifications.