Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problematic setup in Windows with MySQL #508

Open
darkWolf-PR opened this issue Feb 26, 2024 · 1 comment
Open

Problematic setup in Windows with MySQL #508

darkWolf-PR opened this issue Feb 26, 2024 · 1 comment

Comments

@darkWolf-PR
Copy link

I´ve been messing with this Skeleton few years ago, which lead to literally having to remove like 90% of the stuff to at least get it working...so I´ve kind of logged some errors u get when trying to set this up on Windows machine.

I´m using Windows with Wamp(same with Xampp/whatever else) server, many different PHP versions and VirtualHosts and this is pretty much the only working line from whole installation:
composer create-project -s dev contributte/webapp-skeleton acme

Makefile is not available in Win-and even if u get make from gnuwin32, it runs anly these:

	composer install
	
	mkdir -p var/tmp var/log

Copying neon file fails:

cp config\local.neon.example config\local.neon
process_begin: CreateProcess(NULL, cp config\local.neon.example config\local.neon, ...) failed.
make (e=2): Systém nemůže nalézt uvedený soubor.
make: *** [init] Error 2

Setup fails on Chmod

mkdir -p var/tmp var/log
The syntax of the command is incorrect.
make: *** [setup] Error 1

cs or phpstan fails with:

vendor/bin/codesniffer app tests
'vendor' is not recognized as an internal or external command,
operable program or batch file.
make: *** [cs] Error 1

phpstan can be run on Win like:
php vendor/bin/phpstan analyse -c phpstan.neon --memory-limit=512M

but I did not found a way, how to run codesniffer, runing it like this php vendor/bin/codesniffer app tests
leads to this(I have no idea, what it means or where´s problem):

# Support bash to support `source` with fallback on $0 if this does not run with bash
# https://stackoverflow.com/a/35006505/6512
selfArg="$BASH_SOURCE"
if [ -z "$selfArg" ]; then
    selfArg="$0"
fi

self=$(realpath $selfArg 2> /dev/null)
if [ -z "$self" ]; then
    self="$selfArg"
fi

dir=$(cd "${self%[/\\]*}" > /dev/null; cd ../contributte/qa/bin && pwd)

if [ -d /proc/cygdrive ]; then
    case $(which php) in
        $(readlink -n /proc/cygdrive)/*)
            # We are in Cygwin using Windows php, so the path must be translated
            dir=$(cygpath -m "$dir");
            ;;
    esac
fi

export COMPOSER_RUNTIME_BIN_DIR=$(cd "${self%[/\\]*}" > /dev/null; pwd)

# If bash is sourcing this file, we have to source the target as well
bashSource="$BASH_SOURCE"
if [ -n "$bashSource" ]; then
    if [ "$bashSource" != "$0" ]; then
        source "${dir}/codesniffer" "$@"
        return
    fi
fi

"${dir}/codesniffer" "$@"

I have phpcs in global Composer, but running it with default config leads to thousands of errors(wrong use of spaces-tabs etc.) and pointing to "ruleset.xml" leads to this error(which I have no idea, how to repair):

>phpcs --standard=ruleset.xml app
ERROR: Referenced sniff "SlevomatCodingStandard.Arrays.TrailingArrayComma" does not exist

And of course, BUILD codes(if u manage to change Postgres to MySQL) can be only run like this:
php bin/console orm:schema-tool:drop --force --full-database

Keeping the NETTE_DEBUG=1 fails all these codes with "NETTE_DEBUG not recognized as any command".

I´ve also did not found a way, how to set ENV variable with VirtualHosts in Wamp, so I had to put it in htaccess to activate debug and Tracy - and that can be easilly forgotten and uploaded to production...

Most of these points seems to be valid for all Contributte skeletons. I just think using Windows should not be completely ignored.

@f3l1x
Copy link
Member

f3l1x commented Feb 27, 2024

Hi @darkWolf-PR, thank you for your report. I do not use windows thus I do not know how to fix it. In sledovanitv.cz, we are using similar setup and some folks are running Windows (WSL2) without any troubles.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants