BrianHenryIE / strauss

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

Infinite loop #73

Closed jonerickson closed 7 months ago

jonerickson commented 1 year ago

I am receiving an infinite loop with the recursiveGetAllDependencies() function when using the PHAR as reported by Xdebug. Attached is my composer.json.

It appears to be around the league/flysystem package. Multiple lines like so:

   45.3508   30967016  30. BrianHenryIE\Strauss\Console\Commands\Compose->recursiveGetAllDependencies($requiredPackageNames = [1 => 'league/flysystem-local', 2 => 'league/mime-type-detection']) phar:///Users/jonerickson/PhpstormProjects/wordpress-community-hive/strauss.phar/src/Console/Commands/Compose.php:173
   45.4071   25482912  31. BrianHenryIE\Strauss\Console\Commands\Compose->recursiveGetAllDependencies($requiredPackageNames = [2 => 'league/flysystem', 3 => 'league/mime-type-detection']) phar:///Users/jonerickson/PhpstormProjects/wordpress-community-hive/strauss.phar/src/Console/Commands/Compose.php:173
   45.4556   27192200  32. BrianHenryIE\Strauss\Console\Commands\Compose->recursiveGetAllDependencies($requiredPackageNames = [1 => 'league/flysystem-local', 2 => 'league/mime-type-detection']) phar:///Users/jonerickson/PhpstormProjects/wordpress-community-hive/strauss.phar/src/Console/Commands/Compose.php:173
   45.4996   28892624  33. BrianHenryIE\Strauss\Console\Commands\Compose->recursiveGetAllDependencies($requiredPackageNames = [2 => 'league/flysystem', 3 => 'league/mime-type-detection']) phar:///Users/jonerickson/PhpstormProjects/wordpress-community-hive/strauss.phar/src/Console/Commands/Compose.php:173
   45.5499   30601912  34. BrianHenryIE\Strauss\Console\Commands\Compose->recursiveGetAllDependencies($requiredPackageNames = [1 => 'league/flysystem-local', 2 => 'league/mime-type-detection']) phar:///Users/jonerickson/PhpstormProjects/wordpress-community-hive/strauss.phar/src/Console/Commands/Compose.php:173
   45.6173   25444520  35. BrianHenryIE\Strauss\Console\Commands\Compose->recursiveGetAllDependencies($requiredPackageNames = [2 => 'league/flysystem', 3 => 'league/mime-type-detection']) phar:///Users/jonerickson/PhpstormProjects/wordpress-community-hive/strauss.phar/src/Console/Commands/Compose.php:173
   45.6785   27153808  36. BrianHenryIE\Strauss\Console\Commands\Compose->recursiveGetAllDependencies($requiredPackageNames = [1 => 'league/flysystem-local', 2 => 'league/mime-type-detection']) phar:///Users/jonerickson/PhpstormProjects/wordpress-community-hive/strauss.phar/src/Console/Commands/Compose.php:173

Any help on how to diagnose would be great.

{
    "require": {
        "php": "^8.1",
        "roots/acorn": "^3.2",
        "guzzlehttp/guzzle": "^7.0",
        "web-token/jwt-framework": "^3.2"
    },
    "require-dev": {
        "spatie/laravel-ignition": "^1.6",
        "laravel/pint": "^v1.10.5",
        "fzaninotto/faker": "^1.5"
    },
    "autoload": {
        "psr-4": {
            "CommunityHive\\App\\": "src/app",
            "CommunityHive\\Database\\Factories\\": "src/database/factories/",
            "CommunityHive\\Database\\Seeders\\": "src/database/seeders/"
        }
    },
    "autoload-dev": {
        "psr-4": {
            "Tests\\": "src/tests/"
        }
    },
    "post-autoload-dump": [
        "Roots\\Acorn\\ComposerScripts::postAutoloadDump"
    ]
}
kodie commented 10 months ago

I'm running into this exact same issue.

BrianHenryIE commented 9 months ago

I think this should work: https://github.com/BrianHenryIE/strauss/commit/d26e040ebfc1f8cfca90c2f3a78fc4c04ca49823

Is it only with the phar? I'm not sure how to write a test for it if so.

BrianHenryIE commented 7 months ago

Should be fixed in the latest release