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

php error on init #30

Open
Aviortheking opened this issue Feb 26, 2019 · 9 comments
Open

php error on init #30

Aviortheking opened this issue Feb 26, 2019 · 9 comments

Comments

@Aviortheking
Copy link

Aviortheking commented Feb 26, 2019

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
Copy link
Owner

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
Copy link
Author

Aviortheking commented Feb 26, 2019

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
Copy link
Owner

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
Copy link

paulalbertdev commented Aug 24, 2019

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
Copy link

Yivan commented Oct 19, 2019

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
Copy link

tech62 commented Nov 5, 2019

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
Copy link

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
Copy link

tech62 commented Nov 14, 2019

Anybody can try to fix this issue please ?

@Yivan
Copy link

Yivan commented Nov 14, 2019

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.

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

No branches or pull requests

5 participants