{"action":"created","issue":{"url":"https://api.github.com/repos/symfony/symfony/issues/25472","repository_url":"https://api.github.com/repos/symfony/symfony","labels_url":"https://api.github.com/repos/symfony/symfony/issues/25472/labels{/name}","comments_url":"https://api.github.com/repos/symfony/symfony/issues/25472/comments","events_url":"https://api.github.com/repos/symfony/symfony/issues/25472/events","html_url":"https://github.com/symfony/symfony/issues/25472","id":281469586,"number":25472,"title":"[DI] Can't dump container if undefined constants (e.g ext not installed)","user":{"login":"Taluu","id":239685,"avatar_url":"https://avatars3.githubusercontent.com/u/239685?v=4","gravatar_id":"","url":"https://api.github.com/users/Taluu","html_url":"https://github.com/Taluu","followers_url":"https://api.github.com/users/Taluu/followers","following_url":"https://api.github.com/users/Taluu/following{/other_user}","gists_url":"https://api.github.com/users/Taluu/gists{/gist_id}","starred_url":"https://api.github.com/users/Taluu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Taluu/subscriptions","organizations_url":"https://api.github.com/users/Taluu/orgs","repos_url":"https://api.github.com/users/Taluu/repos","events_url":"https://api.github.com/users/Taluu/events{/privacy}","received_events_url":"https://api.github.com/users/Taluu/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2017-12-12T17:23:38Z","updated_at":"2017-12-12T21:13:34Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"| Q                | A\r\n| ---------------- | -----\r\n| Bug report?      | yes\r\n| Feature request? | no\r\n| BC Break report? | no\r\n| RFC?             | no\r\n| Symfony version  | 3.4.0+ ?\r\n\r\nI'm currently working on a bundle which can support another service if an extension is installed (amqp's pecl). So I made a service that can use `AMQP_` constants.\r\n\r\nThe thing is, if the extension is *not* installed, and if I don't plan to use that one, and want to use another service (e.g phpamqplib's php implementation), as the dic is scanning the files, it complains about undefined constants and assuming its string form.\r\n\r\nTested with a basic flex installation on the master version of my bundle https://github.com/Wisembly/AMQPBundle and the recipe available on the recipe contrib repo.\r\n\r\n```\r\nbin/console -vvv\r\n\r\nIn ReflectionClassResource.php line 124:\r\n\r\n  [ErrorException]\r\n  Notice: Use of undefined constant AMQP_EX_TYPE_DIRECT - assumed 'AMQP_EX_TYPE_D\r\n  IRECT'\r\n\r\nException trace:\r\n Symfony\\Component\\Config\\Resource\\ReflectionClassResource->generateSignature() at /home/talus/dev/test-amqp-bundle/vendor/symfony/config/Resource/ReflectionClassResource.php:108\r\n Symfony\\Component\\Config\\Resource\\ReflectionClassResource->computeHash() at /home/talus/dev/test-amqp-bundle/vendor/symfony/config/Resource/ReflectionClassResource.php:60\r\n Symfony\\Component\\Config\\Resource\\ReflectionClassResource->serialize() at n/a:n/a\r\n serialize() at /home/talus/dev/test-amqp-bundle/vendor/symfony/config/ResourceCheckerConfigCache.php:132\r\n Symfony\\Component\\Config\\ResourceCheckerConfigCache->write() at /home/talus/dev/test-amqp-bundle/vendor/symfony/framework-bundle/DependencyInjection/Compiler/ContainerBuilderDebugDumpPass.php:32\r\n Symfony\\Bundle\\FrameworkBundle\\DependencyInjection\\Compiler\\ContainerBuilderDebugDumpPass->process() at /home/talus/dev/test-amqp-bundle/vendor/symfony/dependency-injection/Compiler/Compiler.php:95\r\n Symfony\\Component\\DependencyInjection\\Compiler\\Compiler->compile() at /home/talus/dev/test-amqp-bundle/vendor/symfony/dependency-injection/ContainerBuilder.php:707\r\n Symfony\\Component\\DependencyInjection\\ContainerBuilder->compile() at /home/talus/dev/test-amqp-bundle/vendor/symfony/http-kernel/Kernel.php:503\r\n Symfony\\Component\\HttpKernel\\Kernel->initializeContainer() at /home/talus/dev/test-amqp-bundle/vendor/symfony/http-kernel/Kernel.php:125\r\n Symfony\\Component\\HttpKernel\\Kernel->boot() at /home/talus/dev/test-amqp-bundle/vendor/symfony/framework-bundle/Console/Application.php:63\r\n Symfony\\Bundle\\FrameworkBundle\\Console\\Application->doRun() at /home/talus/dev/test-amqp-bundle/vendor/symfony/console/Application.php:148\r\n Symfony\\Component\\Console\\Application->run() at /home/talus/dev/test-amqp-bundle/bin/console:36\r\n```"},"comment":{"url":"https://api.github.com/repos/symfony/symfony/issues/comments/351196319","html_url":"https://github.com/symfony/symfony/issues/25472#issuecomment-351196319","issue_url":"https://api.github.com/repos/symfony/symfony/issues/25472","id":351196319,"user":{"login":"Taluu","id":239685,"avatar_url":"https://avatars3.githubusercontent.com/u/239685?v=4","gravatar_id":"","url":"https://api.github.com/users/Taluu","html_url":"https://github.com/Taluu","followers_url":"https://api.github.com/users/Taluu/followers","following_url":"https://api.github.com/users/Taluu/following{/other_user}","gists_url":"https://api.github.com/users/Taluu/gists{/gist_id}","starred_url":"https://api.github.com/users/Taluu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Taluu/subscriptions","organizations_url":"https://api.github.com/users/Taluu/orgs","repos_url":"https://api.github.com/users/Taluu/repos","events_url":"https://api.github.com/users/Taluu/events{/privacy}","received_events_url":"https://api.github.com/users/Taluu/received_events","type":"User","site_admin":false},"created_at":"2017-12-12T21:13:34Z","updated_at":"2017-12-12T21:13:34Z","author_association":"CONTRIBUTOR","body":"Removing the definition in the extension works. I'll let you close if you don't think it's worth the trouble to look for a fix as this kind of an edge case imo."}}
{"actor":{"display_login":"Taluu"}}