TheNouillet / symfony-vscode

Symfony extension for Visual Studio Code
MIT License
20 stars 22 forks source link

php error on init #30

Open Aviortheking opened 5 years ago

Aviortheking commented 5 years ago

I've got this on init as an error

PHP Fatal error:  Cannot use Riak\Object as Object because 'Object' is a special class name in /home/avior/Git/stm/vendor/doctrine/cache/lib/Doctrine/Common/Cache/RiakCache.php on line 8
10:24:39 CRITICAL  [php] Fatal Compile Error: Cannot use Riak\Object as Object because 'Object' is a special class name ["exception" => Symfony\Component\Debug\Exception\FatalErrorException { …}]

In RiakCache.php line 8:

  Compile Error: Cannot use Riak\Object as Object because 'Object' is a speci  
  al class name                                                                

debug:container [--show-private] [--show-arguments] [--show-hidden] [--tag TAG] [--tags] [--parameter PARAMETER] [--parameters] [--types] [--format FORMAT] [--raw] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-e|--env ENV] [--no-debug] [--] <command> [<name>]

more exactly i can repeat it by refreshing the service definition view

TheNouillet commented 5 years ago

Hello

If you have a PHP error, it means that you can't use the Symfony console at all (which the extension uses to fetch the container elements). Are you sure that your Riak PHP client is up to date ?

That said, I dont't think this issue have something to do with the extension itself.

Aviortheking commented 5 years ago

Well i use the console myself and I think Riak PHP Client is up to date (I used composer create-project symfony/website-skeleton folder to start a project)

TheNouillet commented 5 years ago

I think the solution to this issue is the one proposed in #32. Parsing dump files as an alternative allow the extension to be completely independent from the project execution.

paulalbertdev commented 4 years ago

Hello ! I'm working on a "normal" symfony 4 project, built from "composer create-project symfony/website-skeleton", but got the exact same error...

"php bin/console debug:container" runs smoothly, as well on my physical machine as inside of my docker container (I tried with and without the special docker json config)

image

Any idea of a solution to fix this ?

Yivan commented 4 years ago

Hello @TheNouillet

First, thanks a lot for providing this great extension.

Actually this the only one on vscode able to enhance this ide experience with symfony, so it is a precious one.

I go back on this issue, as get the same error about Riak package having an Object method, making an error on php +7.2.

Running the command from command line work as expected, great. Running the same via your extension brings this Riak error. From where come the Riak Package ? It it a vscode or you extension dependency... I cannot understand why it work great in command line and not using your extension. Are you calling it differently ?

Our VSCODE config: Shell Command: docker exec mycontainer-php /bin/sh -c 'cd /var/www/html && php "$@"'' -- (I tried too: docker exec mycontainer-php /bin/bash -c 'cd /var/www/html && php "$@" -- ') Shell Executable: /bin/bash Console Path: /var/www/html/bin/console => we get the Riak error

Running directly from bash (same linux user than the one used to launch vscode): docker exec mycontainer-php /bin/bash -c 'cd /var/www/html && php /var/www/html/bin/console -- debug:container' => work great, return the list of containers

Any clues ?

You talk about another version which will no more depends of synfony commands, is it on the way, is there any roadmap/date ?

Side question: where do you append the command "debug:container", at the end of the shell command ? What is the purpose of the placeholder $@, you append only the console path here ?

Thanks!

tech62 commented 4 years ago

i've got this error with vscode php 7.3 and symfony 4.9.0 Project created with symfony new --full projectname

CRITICAL [php] Fatal Compile Error: Cannot use Riak\Object as Object because 'Object' is a special class name ["exception" => Symfony\Component\Debug\Exception\FatalErrorException { …}] In RiakCache.php line 8: Compile Error: Cannot use Riak\Object as Object because 'Object' is a special class name debug:container [--show-private] [--show-arguments] [--show-hidden] [--tag TAG] [--tags] [--parameter PARAMETER] [--parameters] [--types] [--env-var ENV-VAR] [--env-vars] [--format FORMAT] [--raw] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-e|--env ENV] [--no-debug] [--] []

paulalbertdev commented 4 years ago

Quick dirty temporary fix : Edit RiakCache.php in your vendor files on your development environment, and make each function return false without doing nothing.

tech62 commented 4 years ago

Anybody can try to fix this issue please ?

Yivan commented 4 years ago

Yes would be nice, but only maintainers can update this repository. This is a weird error because running from command line work, but running done by the extension send back this Object' is a special class name. This error is legitime i think as Object is a reserved keyword now. What i don't understand is way direct bin/console call work, but the extension calling it don't work. So I think it can be corrected at this extension level. Sadly this repository seems no more maintened (the problem of vscode extension... and no good php support natively on this ide, a choise made by Microsoft).

If @TheNouillet @VeberAxel @axel-veber-beclood are around, as they are the 3 contributor, it would be realy great to make it works again, as this is the only one good extension (all others have problem or not maintened too).

Thanks.