Skip to content

Fatal error: Cannot redeclare humbug_phpscoper_expose_class() #809

Closed
@leoloso

Description

@leoloso

Bug report

Question Answer
PHP-Scoper version 0.18.1
PHP version 8.1
Platform with version MacOS 13
Github Repo https://github.com/leoloso/PoP

I'm using PHP-Scoper to scope 2 WordPress plugins. When I install both of them on the same site, I get the following error:

Fatal error: Cannot redeclare humbug_phpscoper_expose_class() (previously declared in /app/wordpress/wp-content/plugins/graphql-api/vendor/scoper-autoload.php:23) in /app/wordpress/wp-content/plugins/graphql-api-pro/vendor/scoper-autoload.php on line 27

The reason is clear: both plugins define function humbug_phpscoper_expose_class in the global space.

Maybe we can append if(!function_exists('humbug_phpscoper_expose_class')) { ... when declaring the function?

For reference, this is one of my scoper.inc.php.

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