Skip to content

Commit

Permalink
Merge pull request #25 from membrane-php/fix-composer-commmand
Browse files Browse the repository at this point in the history
Check for autoload in both possible locations
  • Loading branch information
carnage authored Nov 5, 2024
2 parents 40b6a9a + a71a066 commit 334f1b2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
12 changes: 11 additions & 1 deletion bin/membrane-router
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
#!/usr/bin/env php
<?php

require __DIR__ . '/../vendor/autoload.php';
$autoloadFiles = [
__DIR__ . '/../vendor/autoload.php',
__DIR__ . '/../../../autoload.php'
];

foreach ($autoloadFiles as $autoloadFile) {
if (file_exists($autoloadFile)) {
require_once $autoloadFile;
break;
}
}

use Membrane\OpenAPIRouter\Console\Command\CacheOpenAPIRoutes;
use Symfony\Component\Console\Application;
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"infection/infection": "^0.27.0",
"phpunit/phpunit": "^10.5.38",
"phpstan/phpstan": "^1.12.7",
"squizlabs/php_codesniffer": "^3.5.4",
"squizlabs/php_codesniffer": "^3.7",
"guzzlehttp/psr7": "^2.4",
"mikey179/vfsstream": "^1.6.7"
},
Expand Down

0 comments on commit 334f1b2

Please sign in to comment.