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

Got php fatal error on a symfony 2.8 project #240

Closed
sn0opr opened this issue Dec 9, 2016 · 8 comments
Closed

Got php fatal error on a symfony 2.8 project #240

sn0opr opened this issue Dec 9, 2016 · 8 comments
Assignees
Labels

Comments

@sn0opr
Copy link

sn0opr commented Dec 9, 2016

This is the first time I use GrumPHP after installing the package with composer, I run bin/grumphp git:init (the bin folder is set in /bin/ in the composer folder) I get:

PHP Fatal error:  Class 'ProxyManager\Configuration' not found in /home/rala/project/marabout-bsch/vendor/symfony/symfony/src/Symfony/Bridge/ProxyManager/LazyProxy/Instantiator/RuntimeInstantiator.php on line 36

But with global installation it works correctly

@veewee veewee added the question label Dec 9, 2016
@veewee
Copy link
Contributor

veewee commented Dec 9, 2016

Hello @sn0opr,

It looks like the ocramius/proxy-manager package is not loaded in your project.
GrumPHP requires the symfony/proxy-manager-brige, which should load the proxy-manager.
Can you give me some additional details about your project or your composer.json file?
Since this question has been asked before in e.g. #219, it might be something that we want to alter in our package. Normally the proxy manager should be loaded during a composer install.

@sn0opr
Copy link
Author

sn0opr commented Dec 9, 2016

Hi @veewee I did the same thing #219 , I required the ocramius/proxy-manager package and it worked. But it's strange, it's already required by grumphp
Additional thing, before I require proxy-manager, I required grumphp globally, and it worked without any problem

@veewee
Copy link
Contributor

veewee commented Dec 10, 2016

That is strange... Can you tell me if you also installed GrumPHP globally?

@sn0opr
Copy link
Author

sn0opr commented Dec 10, 2016

@veewee When I installed it globally it worked as expected

@sn0opr
Copy link
Author

sn0opr commented Dec 10, 2016

@veewee best thing is to try with a symfony 2.8 project

@veewee
Copy link
Contributor

veewee commented Dec 10, 2016

Hello @sn0opr,

I just tried with Symfony 2.8 by entering following commands:

composer create-project symfony/framework-standard-edition test "2.8.*"
cd test
git init
composer require --dev phpro/grumphp

At that point I retrieved following error during the installation:

GrumPHP can not sniff your commits. Did you specify the correct git-dir?
PHP Fatal error:  Class 'ProxyManager\Configuration' not found in /Users/verweto/Projects/tmp/test/vendor/symfony/symfony/src/Symfony/Bridge/ProxyManager/LazyProxy/Instantiator/RuntimeInstantiator.php on line 36
PHP Stack trace:
PHP   1. {main}() /Users/verweto/Projects/tmp/test/vendor/phpro/grumphp/bin/grumphp:0
PHP   2. GrumPHP\Console\Application->__construct() /Users/verweto/Projects/tmp/test/vendor/phpro/grumphp/bin/grumphp:30
PHP   3. GrumPHP\Console\Application->getContainer() /Users/verweto/Projects/tmp/test/vendor/phpro/grumphp/src/GrumPHP/Console/Application.php:57
PHP   4. GrumPHP\Configuration\ContainerFactory::buildFromConfiguration() /Users/verweto/Projects/tmp/test/vendor/phpro/grumphp/src/GrumPHP/Console/Application.php:157
PHP   5. Symfony\Bridge\ProxyManager\LazyProxy\Instantiator\RuntimeInstantiator->__construct() /Users/verweto/Projects/tmp/test/vendor/phpro/grumphp/src/GrumPHP/Configuration/ContainerFactory.php:28

GrumPHP can not sniff your commits. Did you specify the correct git-dir?
PHP Fatal error:  Class 'ProxyManager\Configuration' not found in /Users/verweto/Projects/tmp/test/vendor/symfony/symfony/src/Symfony/Bridge/ProxyManager/LazyProxy/Instantiator/RuntimeInstantiator.php on line 36
PHP Stack trace:
PHP   1. {main}() /Users/verweto/Projects/tmp/test/vendor/phpro/grumphp/bin/grumphp:0
PHP   2. GrumPHP\Console\Application->__construct() /Users/verweto/Projects/tmp/test/vendor/phpro/grumphp/bin/grumphp:30
PHP   3. GrumPHP\Console\Application->getContainer() /Users/verweto/Projects/tmp/test/vendor/phpro/grumphp/src/GrumPHP/Console/Application.php:57
PHP   4. GrumPHP\Configuration\ContainerFactory::buildFromConfiguration() /Users/verweto/Projects/tmp/test/vendor/phpro/grumphp/src/GrumPHP/Console/Application.php:157
PHP   5. Symfony\Bridge\ProxyManager\LazyProxy\Instantiator\RuntimeInstantiator->__construct() /Users/verweto/Projects/tmp/test/vendor/phpro/grumphp/src/GrumPHP/Configuration/ContainerFactory.php:28

After running composer show, I noticed that following package is included:

symfony/symfony                      v2.8.14 The Symfony PHP framework

This package replaces the proxy-manager bridge, but does not require the ocramius/proxy-manager package:

$ composer show symfony/symfony

name     : symfony/symfony
descrip. : The Symfony PHP framework
keywords : framework
versions : * v2.8.14
type     : library
license  : MIT License (MIT) (OSI approved) https://spdx.org/licenses/MIT.html#licenseText
source   : [git] https://github.com/symfony/symfony.git 6ceca5b4154c80839270c38aa65373de76127df7
dist     : [zip] https://api.github.com/repos/symfony/symfony/zipball/6ceca5b4154c80839270c38aa65373de76127df7 6ceca5b4154c80839270c38aa65373de76127df7

requires
doctrine/common ~2.4
php >=5.3.9
psr/log ~1.0
symfony/polyfill-apcu ~1.1
symfony/polyfill-intl-icu ~1.0
symfony/polyfill-mbstring ~1.0
symfony/polyfill-php54 ~1.0
symfony/polyfill-php55 ~1.0
symfony/polyfill-php56 ~1.0
symfony/polyfill-php70 ~1.0
symfony/polyfill-util ~1.0
symfony/security-acl ~2.7|~3.0.0
twig/twig ~1.28|~2.0

replaces
...
symfony/proxy-manager-bridge self.version
...

I'll fix this bug to make sure that it works with the full Symfony framework.

@veewee
Copy link
Contributor

veewee commented Dec 10, 2016

@sn0opr,

Thanks for reporting. This issue is fixed in #240 and will be released in 0.10.2.

@veewee veewee closed this as completed Dec 10, 2016
@sn0opr
Copy link
Author

sn0opr commented Dec 11, 2016

@veewee thank you for the great tool

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

No branches or pull requests

2 participants