Skip to content

Commit

Permalink
Merge pull request #58 from madewithlove/phar-issue
Browse files Browse the repository at this point in the history
Phar issue
  • Loading branch information
Andreas Creten authored Oct 27, 2020
2 parents 29e0feb + fa93caf commit 5a7551e
Show file tree
Hide file tree
Showing 3 changed files with 10,710 additions and 0 deletions.
6 changes: 6 additions & 0 deletions app/Semver/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@ public function run()
/* @var Dispatcher $dispatcher */
/* @type ServerRequestInterface $request */
$request = $this->container->get(ServerRequestInterface::class);

// Hack to fix issue with phar in URI
if($request->getUri()->getPath() == '/packages/psalm/phar') {
$request = $request->withUri($request->getUri()->withPath('/packages/psalm/p-h-a-r'));
}

$response = new Response();
$dispatcher = $this->container->get(RouteCollection::class);

Expand Down
3 changes: 3 additions & 0 deletions app/Semver/Http/Controllers/PackageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ public function __construct(Packagist $packagist, ServerRequestInterface $reques
*/
public function versions($vendor, $package)
{
// Hack to fix issue with phar in URI
$package = $package == 'p-h-a-r' ? 'phar' : $package;

$this->packagist->setMinimumStability('dev');

$versions = $this->packagist->getVersions($vendor, $package);
Expand Down
Loading

0 comments on commit 5a7551e

Please # to comment.