Specifics of your environment
Using the build tarballs from https://github.com/simplesamlphp/simplesamlphp/releases. Either simplesamlphp-*-full.tar.gz and simplesamlphp-*-slim.tar.gz. The application incorporating SimpleSAMLphp has its own dependency on Twig.
Describe the bug
When including Twig in your application's dependencies, and then call the SimpleSAMLphp autoloader, an error will trigger.
To Reproduce
- Have Twig as a dependency in your application
- Use the autoloader that loads Twig
- Use the autoloader that loads SimpleSAMLphp
- Attempt to autoload, such as
new \SimpleSAML\Auth\Simple
- See an error similar to:
PHP message: PHP Fatal error: Cannot redeclare function twig_cycle() (previously declared in /usr/share/simplesamlphp/vendor/twig/twig/src/Resources/core.php:23) in /usr/share/php/Twig/Resources/core.php on line 23'
Expected behavior
Using Twig in your project does not conflict with SimpleSAMLphp's usage of Twig.
Proposed solution
The generated file vendor/composer/autoload_static.php in the tarball can be patched, to remove all references to /twig/src/Resources/; these files contain only deprecated functions that are not used in the SimpleSAMLphp application.
Additional context
twigphp/Twig#4180 Deprecated functions in Resources directory cause collisions
Specifics of your environment
Using the build tarballs from https://github.com/simplesamlphp/simplesamlphp/releases. Either
simplesamlphp-*-full.tar.gzandsimplesamlphp-*-slim.tar.gz. The application incorporating SimpleSAMLphp has its own dependency on Twig.Describe the bug
When including Twig in your application's dependencies, and then call the SimpleSAMLphp autoloader, an error will trigger.
To Reproduce
new \SimpleSAML\Auth\SimpleExpected behavior
Using Twig in your project does not conflict with SimpleSAMLphp's usage of Twig.
Proposed solution
The generated file
vendor/composer/autoload_static.phpin the tarball can be patched, to remove all references to/twig/src/Resources/; these files contain only deprecated functions that are not used in the SimpleSAMLphp application.Additional context
twigphp/Twig#4180 Deprecated functions in Resources directory cause collisions