BrianHenryIE / strauss

Prefix PHP namespaces and classnames to allow multiple versions of libraries to exist without conflict.
https://brianhenryie.github.io/strauss/
MIT License
140 stars 23 forks source link

Removal of helper.php in package #124

Open JUVOJustin opened 1 week ago

JUVOJustin commented 1 week ago

With prefixing and copying enabled strauss removes the following file of the extended ACF library: https://github.com/vinkla/extended-acf/blob/master/src/helpers.php

This leads to errors since the function can not be loaded as mentioned in extended acf´s readme. The workaround for now is to exclude the package.

"strauss": {
            "target_directory": "vendor/vendor-prefixed",
            "namespace_prefix": "My_Project\\Dependencies\\",
            "classmap_prefix": "My_Project",
            "constant_prefix": "MY_PROJECT",
            "exclude_from_copy": {
                "packages": [
                    "phpseclib/phpseclib",
                    "johnbillion/extended-cpts",
                    "symfony/polyfill-php80",
                    "wp-cli/wp-cli",
                    "timber/timber",
                    "twig/twig",
                    "vinkla/extended-acf"
                ],
                "namespaces": [
                ]
            },
            "exclude_from_prefix": {
                "packages": [
                    "johnbillion/extended-cpts",
                    "phpseclib/phpseclib",
                    "timber/timber",
                    "twig/twig",
                    "wp-cli/wp-cli",
                    "vinkla/extended-acf"
                ]
            },
            "delete_vendor_files": true
        }

The conent of the file is: <?php // This file was deleted by {@see https://github.com/BrianHenryIE/strauss}.

JUVOJustin commented 1 week ago

Actually i just got the same error for another package:

Fatal error: Uncaught My_Project\Dependencies\Symfony\Component\Intl\Exception\ResourceBundleNotFoundException: The resource bundle "/var/www/html/wp-content/plugins/my-project/vendor/vendor-prefixed/symfony/intl/Resources/data/regions/root.php" does not exist.