Skip to content

Release tarball contains deprecated Twig includes #2687

Description

@jornane

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

  1. Have Twig as a dependency in your application
  2. Use the autoloader that loads Twig
  3. Use the autoloader that loads SimpleSAMLphp
  4. Attempt to autoload, such as new \SimpleSAML\Auth\Simple
  5. 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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions