zecure / shadowd_ui

The Shadow Daemon user interface
GNU General Public License v2.0
20 stars 9 forks source link

PHP Warning: "continue" targeting switch is equivalent to "break". #48

Closed markuman closed 2 years ago

markuman commented 3 years ago

Running php app/console swd:register --env=prod --admin --name=admin in container image zecure/shadowd_ui:2 using mysql backings with mariadb 10.5, some php warnings are returned

PHP Warning:  "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /var/shadowd_ui/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php on line 2636
PHP Warning:  "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /var/shadowd_ui/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php on line 2665
zit-hb commented 3 years ago

Strange, php-cli in the Docker image is configured to hide warnings (9d5b2324aee760db01e1218a8ee90ecdc5d55dbe) until I find the time to port the UI to a newer Symfony version. May I ask how you run the command?

markuman commented 3 years ago

I simply jumped into the container

~$ docker exec -ti shadowdui /bin/bash
root@ef6098a2eb88:/var/shadowd_ui# php app/console swd:register --env=prod --admin --name=admin
zit-hb commented 2 years ago

I was stuck with the LTS upgrade, so I have decided now to do a release prior to it to finally get rid of the warning. As of 2.0.5 it should not be a problem anymore.

mrfixit2001 commented 2 years ago

@zit-hb This issue is not resolved. I'm trying to implement this on Debian Buster installed on an older NAS (armv5) and I've had to compile everything from source because the provided dockers are all for the wrong arch and result in "exec user process caused: exec format error" in the docker log and the containers just continue to restart.

When compiling the UI, I encounter this issue and cannot find a good way around it.

I tried editing the Dockerfile to use arm32v5/debian:buster instead of the ubuntu container in hopes of working around that but then I run into a different error: "In ArrayLoader.php line 44: Unknown package has no name defined..."

There's not really a clearly documented process for installing this locally (or on different architectures). I was eventually able to figure out how to compile shadowd itself from source and that's installed, but without the UI there's no good way for me to actually configure it. Would appreciate any feedback you have.

zit-hb commented 2 years ago

Hey @mrfixit2001,

in general you can find information on how to install it manually here:

I have never tried to run it on ARM, so I have no experience there. The UI does not have to be compiled though. Since it is PHP code it should be no problem to run it under a different architecture if you follow the documentation.

The warning you either have to ignore for now or disable warnings in the PHP-CLI output. Disabling it is what I did for now in the Docker image. It is unfortunate but it is currently not possible to simply update the version of the library that causes it to a version where they resolved it (branch update/symfony4). It is just a cosmetic thing though, no influence on the functionality.

mrfixit2001 commented 2 years ago

@zit-hb Thank you for the response! I wasn’t able to disable the warning, can you advise how you worked around that? I tried this but it didn't seem to take effect: https://github.com/zecure/shadowd_ui/commit/9d5b2324aee760db01e1218a8ee90ecdc5d55dbe

I've searched the system for all php.ini files and there's only two, one for CLI and one for apache. I've edited both and even tried setting error_reporting to zero. Nothing gets me passed this error.