wintercms / winter

Free, open-source, self-hosted CMS platform based on the Laravel PHP Framework.
https://wintercms.com
MIT License
1.38k stars 195 forks source link

Composer post create project commands fail on Windows #1242

Open damsfx opened 1 day ago

damsfx commented 1 day ago

Winter CMS Build

dev-develop

PHP Version

8.1

Database engine

MySQL/MariaDB

Plugins installed

No response

Issue description

Related

The new composer post commands on Windows are done with all default values.

My tests are running the following on both Windows and Windows Subsystem Linux:

wintercms/winter (dev-develop 5f53526)
winter/storm (dev-develop a37c1f9)
winter/wn-backend-module (dev-develop e11d279)
winter/wn-cms-module (dev-develop 3ba7bcf)
winter/wn-system-module (dev-develop 9ac3b57)

Steps to replicate

On a Windows system, simply run composer create-project wintercms/winter example.com "dev-develop"

Workaround

No response

nialma commented 17 hours ago

It works on my windows system as the old composer-installation and like the the documentaion. When composer create-project wintercms/winter . "dev-develop" is done ypu can run winter:install and all works as know (select, database, etc)

bennothommo commented 16 hours ago

@damsfx @nialma according to this - https://github.com/composer/composer/issues/11709#issuecomment-1801650122 - it won't be doable for php artisan winter:install to work on Windows as part of the post-create-project scripts.

Instead of @nialma's suggestion of rolling back the post-create-project-cmd changes in #1243, I wonder if we could opt instead to change it so it can bootstrap Winter non-interactively. Ideally, we can follow similar steps to what our devcontainer bootstrap script does, namely:

This would get the environment set up in a way that it could be run immediately.

Any thoughts on the above? (/cc @LukeTowers)

nialma commented 15 hours ago

@bennothommo

just did this for myself because I work with Windows and there is currently an error. With the "step back" in Composer I'm back to the "old" installation - if there's an easier way, I don't mind - it works fine for me under Windows....

Your idea is good, but not everyone works with SQLite... they should

  1. a query of the DB can be installed
  2. DB name can be queried etc... The current installation mode is really good

@damsfx i work also and at the moment only with windows an php artisan winter:install does ask me anything as the "old" versions with the "step back" in the composer.js

bennothommo commented 14 hours ago

@nialma You're right, not everyone uses SQLite, but the intention is to make it so that composer create-project wintercms/winter can be used to basically get started with a Winter project immediately and then, if necessary, the user can modify the configuration / .env file to suit their environment.

You can see that Laravel does exactly the same thing when someone runs composer create-project laravel/laravel.

nialma commented 9 hours ago

@bennothommo that sounds plausible and good....

You can see that Laravel does exactly the same thing when someone runs composer create-project laravel/laravel.

and that is the reason why i use for a laravel-project a downloaded version and make it manual and not with composer...... local i use laragon with marianDB/mySQL php 8.2.24

damsfx commented 8 hours ago

@bennothommo @nialma For myself, I use both MariaDB and SQLite databases, depending on the needs of the project.

Aligning with Laravel's choices doesn't worry me, as long as it allows new users to have a project up and running in a single command line. Then, for those who want other settings, there's nothing to stop them running a php artisan winter:install --force command, right?

In my opinion, the more WinterCMS is aligned with Laravel, the better! Povilas' experience in testing Laravel-based CMS fits in with this idea.